結果

問題 No.2715 Unique Chimatagram
コンテスト
ユーザー 👑 loop0919
提出日時 2024-04-05 22:47:15
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 122 ms / 2,000 ms
+ 473µs
コード長 437 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 66 ms
コンパイル使用メモリ 82,672 KB
実行使用メモリ 103,748 KB
最終ジャッジ日時 2026-09-07 03:12:11
合計ジャッジ時間 4,877 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 40
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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()

words = []

for c in ascii_lowercase:
    for s in S:
        words.append(''.join(sorted(s + c)))

for c in ascii_lowercase:
    for key, val in Counter(words).items():
        if val == 1:
            print(key)
            exit()

print(-1)
0