結果

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

ソースコード

diff #

import itertools

n = int(input())

li = [i for i in range(n)]
s = input()

comb = itertools.combinations(li, 5)

count = 0
for item in comb:
    tmp = s[item[0]] + s[item[1]] + s[item[2]] + s[item[3]] + s[item[4]]

    if (tmp[0] == tmp[2]) and (tmp[0] != tmp[1]) and (tmp[0] != tmp[3]) and (tmp[0] != tmp[4]) and (tmp[1] != tmp[3]) and (tmp[1] != tmp[4]) and (tmp[3] != tmp[4]):
        count += 1

print(count)
0