結果
| 問題 |
No.2738 CPC To F
|
| コンテスト | |
| ユーザー |
vwxyz
|
| 提出日時 | 2024-07-17 08:40:29 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 295 bytes |
| コンパイル時間 | 197 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 15,744 KB |
| 最終ジャッジ日時 | 2024-07-17 08:40:34 |
| 合計ジャッジ時間 | 4,500 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 1 WA * 21 |
ソースコード
N=int(input())
S=input()
queue=[]
for s in S:
queue.append(s)
if len(queue)>=4 and queue[-4:]==list("TCPC"):
for _ in range(3):
queue.pop()
queue.append("F")
ans=0
N=len(queue)
for i in range(N-4):
if queue[i:i+5]==list("CPCTF"):
ans+=1
print(ans)
vwxyz