結果
| 問題 |
No.2738 CPC To F
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-23 17:27:19 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 552 bytes |
| コンパイル時間 | 430 ms |
| コンパイル使用メモリ | 82,336 KB |
| 実行使用メモリ | 62,492 KB |
| 最終ジャッジ日時 | 2024-10-15 18:00:51 |
| 合計ジャッジ時間 | 1,827 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 11 WA * 11 |
ソースコード
def main():
N = int(input())
S = input()
idx = -1
ctr = 0
while idx < N:
search_idx = S.find("CPCT", idx + 1)
if search_idx == -1:
break
if search_idx + 4 >= N:
break
if S[search_idx + 4] == "F":
ctr += 1
idx = search_idx
continue
if S[search_idx + 4:search_idx + 7] == "CPC":
ctr += 1
idx = search_idx + 4
continue
idx = search_idx
print(ctr)
if __name__ == "__main__":
main()