結果
| 問題 | No.2738 CPC To F |
| コンテスト | |
| ユーザー |
イルカ
|
| 提出日時 | 2024-06-10 02:07:28 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 495 bytes |
| 記録 | |
| コンパイル時間 | 258 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 498,860 KB |
| 最終ジャッジ日時 | 2024-12-31 09:04:32 |
| 合計ジャッジ時間 | 3,281 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 4 RE * 18 |
ソースコード
N = int(input())
S = input()
cur = 0
l = 0
s1 = "CPCTF"
s2 = "CPCTCPC"
cnt = 0
mem = {}
def f(s):
if len(s)<5:
return 0
a = [f(s[1:])]
if s.startswith(s1):
if len(s)-len(s1) not in mem:
mem[len(s)-len(s1)] = f(s[len(s1):])
a.append(mem[len(s)-len(s1)]+1)
if s.startswith(s2):
if len(s)-len(s2) not in mem:
mem[len(s)-len(s2)] = f(s[len(s2):])
a.append(mem[len(s)-len(s2)]+1)
return max(a)
print(f(S))
"🐬?"
イルカ