結果
問題 |
No.2715 Unique Chimatagram
|
ユーザー |
👑 |
提出日時 | 2024-04-05 22:46:11 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 449 bytes |
コンパイル時間 | 318 ms |
コンパイル使用メモリ | 82,092 KB |
実行使用メモリ | 78,664 KB |
最終ジャッジ日時 | 2024-10-01 02:51:27 |
合計ジャッジ時間 | 6,505 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 34 WA * 6 |
ソースコード
from collections import defaultdict, Counter from string import ascii_lowercase N = int(input()) S = [''.join(sorted(input())) for _ in range(N)] if N == 1: print(S[0] + 'z') exit() di = defaultdict(list) for c in ascii_lowercase: for s in S: di[c].append(''.join(sorted(s + c))) for c in ascii_lowercase: for key, val in Counter(di[c]).items(): if val == 1: print(key) exit() print(-1)