結果

問題 No.2715 Unique Chimatagram
ユーザー shobonvipshobonvip
提出日時 2024-04-06 09:20:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 440 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 87,492 KB
最終ジャッジ日時 2024-04-06 09:20:10
合計ジャッジ時間 6,239 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
60,948 KB
testcase_01 AC 45 ms
58,816 KB
testcase_02 AC 44 ms
60,948 KB
testcase_03 AC 45 ms
60,948 KB
testcase_04 AC 45 ms
60,948 KB
testcase_05 AC 45 ms
60,948 KB
testcase_06 AC 51 ms
60,948 KB
testcase_07 AC 44 ms
60,948 KB
testcase_08 AC 111 ms
85,416 KB
testcase_09 AC 116 ms
85,196 KB
testcase_10 AC 110 ms
85,276 KB
testcase_11 AC 111 ms
86,044 KB
testcase_12 AC 111 ms
85,276 KB
testcase_13 AC 112 ms
85,148 KB
testcase_14 AC 110 ms
85,196 KB
testcase_15 AC 112 ms
85,408 KB
testcase_16 AC 118 ms
85,276 KB
testcase_17 AC 111 ms
85,404 KB
testcase_18 AC 110 ms
87,492 KB
testcase_19 AC 111 ms
87,492 KB
testcase_20 AC 110 ms
87,492 KB
testcase_21 AC 112 ms
87,492 KB
testcase_22 AC 112 ms
87,492 KB
testcase_23 AC 112 ms
87,492 KB
testcase_24 AC 111 ms
87,492 KB
testcase_25 AC 117 ms
87,492 KB
testcase_26 AC 110 ms
87,492 KB
testcase_27 AC 112 ms
87,492 KB
testcase_28 AC 109 ms
77,224 KB
testcase_29 AC 110 ms
77,224 KB
testcase_30 AC 108 ms
77,232 KB
testcase_31 AC 105 ms
77,224 KB
testcase_32 AC 108 ms
77,224 KB
testcase_33 AC 44 ms
58,816 KB
testcase_34 AC 45 ms
58,816 KB
testcase_35 AC 46 ms
58,816 KB
testcase_36 AC 44 ms
60,948 KB
testcase_37 AC 45 ms
60,948 KB
testcase_38 AC 53 ms
66,376 KB
testcase_39 AC 104 ms
77,364 KB
testcase_40 AC 99 ms
77,364 KB
testcase_41 AC 112 ms
81,328 KB
testcase_42 AC 103 ms
76,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
n = int(input())
a = [[0] * 26 for i in range(n)]
t = defaultdict(int)
for i in range(n):
	s = input()
	for j in s:
		a[i][ord(j) - ord('a')] += 1

for i in range(n):
	for j in range(26):
		b = list(a[i])
		b[j] += 1
		t[tuple(b)] += 1

for x,y in t.items():
	if y == 1:
		g = []
		for i in range(26):
			for j in range(x[i]):
				g.append(chr(ord('a')+i))
		print(''.join(g))
		break
else:
	print("-1")
0