結果
| 問題 | No.2738 CPC To F | 
| コンテスト | |
| ユーザー |  vwxyz | 
| 提出日時 | 2024-07-17 08:46:59 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 385 bytes | 
| コンパイル時間 | 172 ms | 
| コンパイル使用メモリ | 12,672 KB | 
| 実行使用メモリ | 17,032 KB | 
| 最終ジャッジ日時 | 2024-07-17 08:47:02 | 
| 合計ジャッジ時間 | 2,328 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | WA * 22 | 
ソースコード
N=int(input())
S=input()
idx=[]
for i in range(N):
    if S[i]=="T":
        if i<3 and S[i-3:i]!=list("CPC"):
            continue
        if i+2<=N and S[i+1]=="F" or i+4<=N and S[i+1:i+4]=="CPC":
            idx.append(i)
le=len(idx)
use=[]
for i in idx:
    if use:
        p=use[-1]
        if S[p+1]=="C" and i-p<=5:
            continue
    use.append(i)
ans=len(use)
print(ans)
            
            
            
        