結果
| 問題 | No.2738 CPC To F | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2024-04-23 17:27:10 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 531 bytes | 
| コンパイル時間 | 510 ms | 
| コンパイル使用メモリ | 81,920 KB | 
| 実行使用メモリ | 61,440 KB | 
| 最終ジャッジ日時 | 2024-10-15 18:00:48 | 
| 合計ジャッジ時間 | 2,478 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 5 WA * 17 | 
ソースコード
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
        idx = search_idx
    print(ctr)
if __name__ == "__main__":
    main()
            
            
            
        