結果

問題 No.3110 Like CPCTF?
ユーザー Zenith Shah
提出日時 2025-04-19 18:09:47
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 522 bytes
コンパイル時間 406 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 10,240 KB
最終ジャッジ日時 2025-04-19 18:09:49
合計ジャッジ時間 2,010 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

def is_cpctf_like(sub):
    return (
        len(sub) == 5 and
        sub[0] == sub[2] and
        len(set([sub[0], sub[1], sub[3], sub[4]])) == 4
    )

def count_cpctf_like(s):
    n = len(s)
    count = 0
    for i in range(n - 4):
        if is_cpctf_like(s[i:i+5]):
            count += 1
    return count

# Sample inputs
print(count_cpctf_like("NEOSHOWCASE"))         # Output: 16
print(count_cpctf_like("PPC"))                 # Output: 0
print(count_cpctf_like("CPCTFCPCTFCPCTFCPCTFCPCTFCPCTF"))  # Output: 4011
0