結果

問題 No.2715 Unique Chimatagram
ユーザー mkawa2mkawa2
提出日時 2024-04-05 21:36:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 106 ms / 2,000 ms
コード長 1,142 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 84,440 KB
最終ジャッジ日時 2024-04-05 21:36:28
合計ジャッジ時間 5,038 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
60,936 KB
testcase_01 AC 43 ms
60,936 KB
testcase_02 AC 43 ms
60,936 KB
testcase_03 AC 44 ms
60,936 KB
testcase_04 AC 44 ms
60,936 KB
testcase_05 AC 46 ms
60,936 KB
testcase_06 AC 47 ms
60,936 KB
testcase_07 AC 44 ms
60,936 KB
testcase_08 AC 93 ms
82,264 KB
testcase_09 AC 94 ms
82,192 KB
testcase_10 AC 94 ms
82,392 KB
testcase_11 AC 90 ms
83,032 KB
testcase_12 AC 90 ms
82,392 KB
testcase_13 AC 91 ms
82,296 KB
testcase_14 AC 98 ms
81,936 KB
testcase_15 AC 91 ms
82,412 KB
testcase_16 AC 89 ms
82,416 KB
testcase_17 AC 91 ms
82,392 KB
testcase_18 AC 87 ms
84,440 KB
testcase_19 AC 88 ms
84,440 KB
testcase_20 AC 88 ms
84,312 KB
testcase_21 AC 88 ms
84,312 KB
testcase_22 AC 87 ms
84,440 KB
testcase_23 AC 90 ms
84,312 KB
testcase_24 AC 94 ms
84,312 KB
testcase_25 AC 86 ms
84,440 KB
testcase_26 AC 86 ms
84,312 KB
testcase_27 AC 90 ms
84,440 KB
testcase_28 AC 97 ms
76,644 KB
testcase_29 AC 95 ms
76,784 KB
testcase_30 AC 96 ms
76,656 KB
testcase_31 AC 98 ms
76,644 KB
testcase_32 AC 97 ms
76,644 KB
testcase_33 AC 42 ms
58,808 KB
testcase_34 AC 44 ms
60,936 KB
testcase_35 AC 44 ms
60,936 KB
testcase_36 AC 46 ms
60,936 KB
testcase_37 AC 47 ms
60,936 KB
testcase_38 AC 54 ms
66,760 KB
testcase_39 AC 92 ms
77,424 KB
testcase_40 AC 88 ms
77,552 KB
testcase_41 AC 106 ms
83,056 KB
testcase_42 AC 97 ms
76,120 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

# sys.setrecursionlimit(200005)
# sys.set_int_max_str_digits(200005)
int1 = lambda x: int(x)-1
pDB = lambda *x: print(*x, end="\n", file=sys.stderr)
p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr)
def II(): return int(sys.stdin.readline())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def SI(): return sys.stdin.readline().rstrip()

# dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
# inf = -1-(-1 << 31)
inf = -1-(-1 << 62)

# md = 10**9+7
md = 998244353

from collections import Counter

n=II()
cnt=Counter()
for _ in range(n):
    s=[0]*26
    for c in SI():
        c=ord(c)-97
        s[c]+=1
    for i in range(26):
        s[i]+=1
        cnt[tuple(s)]+=1
        s[i]-=1

for t in cnt:
    if cnt[t]==1:
        ans=""
        for c in range(26):
            ans+=chr(c+97)*t[c]
        print(ans)
        exit()

print(-1)
0