結果

問題 No.3110 Like CPCTF?
ユーザー Ka1chiX_m
提出日時 2025-04-18 23:05:02
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 361 bytes
コンパイル時間 405 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 11,520 KB
最終ジャッジ日時 2025-04-18 23:05:04
合計ジャッジ時間 1,756 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 3
other RE * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

from intertools import combinations

n = int(input())
s = input()

if n <= 4:
    print(0)

def count_valid_combinations(s):
    count = 0
    for combo in comnbinations(s, 5):
        if combo[0] != combo[2]:
            continue
        if len(set(combo)) == 4:
            count += 1
        return count
    
if n>= 5:
    print(count_valid_combinations(s))
0