結果
問題 |
No.3110 Like CPCTF?
|
ユーザー |
|
提出日時 | 2025-04-18 20:29:33 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 114 ms / 2,000 ms |
コード長 | 398 bytes |
コンパイル時間 | 414 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 96,344 KB |
最終ジャッジ日時 | 2025-04-18 20:29:42 |
合計ジャッジ時間 | 2,205 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 |
ソースコード
from itertools import combinations n=int(input()) s=list(input()) idx=[i for i in range(n)] idx=list(combinations(idx,5)) ans=0 for ord in idx: word=[] for i in ord: word.append(s[i]) if word[0]==word[2] and word[1]!=word[3] and word[3]!=word[4] and word[1]!=word[4] and len(set(word))==4 and word[0]!=word[1] and word[0]!=word[3] and word[0]!=word[4]: ans+=1 print(ans)