Submission #72574735


Source Code Expand

import sys,bisect
from heapq import heappop, heappush
from collections import deque, Counter, defaultdict
sys.setrecursionlimit(10**7)
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 63 - 1
mod = 998244353

N = ii()
S = list(input())
ans = 0
for i in range(N):
    for j in range(i+1, N):
        for k in range(j+1,N):
            if S[i]=="E" and S[j]=="G" and S[k]=="F":ans+=1
print(ans)

Submission Info

Submission Time
Task C - EGFカウント
User guild2026_288
Language Python (PyPy 3.11-v7.3.20)
Score 100
Code Size 506 Byte
Status AC
Exec Time 78 ms
Memory 106980 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 18
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 67 ms 96764 KiB
00_sample_01.txt AC 69 ms 96708 KiB
00_sample_02.txt AC 68 ms 96544 KiB
01_random_00.txt AC 67 ms 96636 KiB
01_random_01.txt AC 68 ms 96544 KiB
01_random_02.txt AC 76 ms 106180 KiB
01_random_03.txt AC 76 ms 105708 KiB
01_random_04.txt AC 72 ms 104424 KiB
01_random_05.txt AC 74 ms 105400 KiB
01_random_06.txt AC 71 ms 102900 KiB
01_random_07.txt AC 78 ms 106676 KiB
01_random_08.txt AC 68 ms 96580 KiB
01_random_09.txt AC 77 ms 106980 KiB
01_random_10.txt AC 70 ms 102636 KiB
01_random_11.txt AC 75 ms 106056 KiB
01_random_12.txt AC 70 ms 96592 KiB
01_random_13.txt AC 75 ms 106276 KiB
01_random_14.txt AC 76 ms 106088 KiB