結果
問題 |
No.2738 CPC To F
|
ユーザー |
![]() |
提出日時 | 2024-07-17 08:48:31 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 379 bytes |
コンパイル時間 | 205 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 16,908 KB |
最終ジャッジ日時 | 2024-07-17 08:48:42 |
合計ジャッジ時間 | 2,297 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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]!="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)