結果
問題 |
No.2738 CPC To F
|
ユーザー |
![]() |
提出日時 | 2024-12-06 03:09:16 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 140 ms / 2,000 ms |
コード長 | 258 bytes |
コンパイル時間 | 357 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 11,776 KB |
最終ジャッジ日時 | 2024-12-06 03:09:20 |
合計ジャッジ時間 | 2,704 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
ソースコード
N=int(input()) S=input().strip() ANS=0 ind=len(S)-1 while ind>=0: if ind-4>=0 and S[ind-4:ind+1]=="CPCTF": ANS+=1 ind-=5 elif ind-6>=0 and S[ind-6:ind+1]=="CPCTCPC": ANS+=1 ind-=7 else: ind-=1 print(ANS)