結果

問題 No.2738 CPC To F
ユーザー tassei903tassei903
提出日時 2024-04-17 03:03:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 600 bytes
コンパイル時間 383 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 95,744 KB
最終ジャッジ日時 2024-04-17 03:03:37
合計ジャッジ時間 2,950 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
51,968 KB
testcase_01 AC 38 ms
51,840 KB
testcase_02 AC 137 ms
95,744 KB
testcase_03 AC 115 ms
95,360 KB
testcase_04 AC 41 ms
52,736 KB
testcase_05 AC 41 ms
53,248 KB
testcase_06 AC 40 ms
52,992 KB
testcase_07 AC 38 ms
52,096 KB
testcase_08 AC 51 ms
63,488 KB
testcase_09 AC 78 ms
77,568 KB
testcase_10 AC 49 ms
63,232 KB
testcase_11 AC 69 ms
77,056 KB
testcase_12 AC 74 ms
77,568 KB
testcase_13 AC 76 ms
77,824 KB
testcase_14 AC 79 ms
78,080 KB
testcase_15 AC 78 ms
77,696 KB
testcase_16 AC 82 ms
77,696 KB
testcase_17 AC 80 ms
77,568 KB
testcase_18 AC 78 ms
78,464 KB
testcase_19 AC 77 ms
77,824 KB
testcase_20 AC 84 ms
77,696 KB
testcase_21 AC 78 ms
77,696 KB
testcase_22 AC 85 ms
77,824 KB
testcase_23 AC 80 ms
78,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################

n = ni()
s = input()
s = list(s)
#print(s)
ans = 0
i = 0
while i < n-4:
    if s[i: i+5] == list("CPCTF"):
        ans += 1
        i += 5
    elif s[i: i+7] == list("CPCTCPC"):
        i += 7
        ans += 1
    else:
        i += 1

print(ans)
0