結果

問題 No.2715 Unique Chimatagram
ユーザー 👑 KA37RIKA37RI
提出日時 2024-04-05 21:38:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 485 bytes
コンパイル時間 178 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 88,180 KB
最終ジャッジ日時 2024-04-05 21:38:42
合計ジャッジ時間 4,891 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
58,872 KB
testcase_01 AC 35 ms
58,872 KB
testcase_02 AC 34 ms
58,872 KB
testcase_03 AC 35 ms
58,872 KB
testcase_04 AC 36 ms
58,872 KB
testcase_05 AC 35 ms
58,872 KB
testcase_06 AC 41 ms
59,640 KB
testcase_07 AC 34 ms
58,872 KB
testcase_08 AC 99 ms
85,744 KB
testcase_09 AC 96 ms
85,744 KB
testcase_10 AC 97 ms
85,764 KB
testcase_11 AC 94 ms
85,744 KB
testcase_12 AC 95 ms
85,616 KB
testcase_13 AC 98 ms
85,616 KB
testcase_14 AC 96 ms
86,384 KB
testcase_15 AC 96 ms
85,744 KB
testcase_16 AC 93 ms
85,616 KB
testcase_17 AC 96 ms
85,744 KB
testcase_18 AC 96 ms
88,172 KB
testcase_19 AC 96 ms
88,104 KB
testcase_20 AC 97 ms
88,084 KB
testcase_21 AC 95 ms
88,084 KB
testcase_22 AC 96 ms
88,076 KB
testcase_23 AC 93 ms
88,176 KB
testcase_24 AC 91 ms
88,072 KB
testcase_25 AC 97 ms
88,180 KB
testcase_26 AC 92 ms
88,084 KB
testcase_27 AC 95 ms
88,092 KB
testcase_28 AC 124 ms
76,292 KB
testcase_29 AC 104 ms
76,288 KB
testcase_30 AC 105 ms
76,292 KB
testcase_31 AC 105 ms
76,288 KB
testcase_32 AC 105 ms
76,288 KB
testcase_33 AC 33 ms
58,872 KB
testcase_34 AC 34 ms
58,872 KB
testcase_35 AC 33 ms
58,872 KB
testcase_36 AC 33 ms
58,872 KB
testcase_37 AC 34 ms
58,872 KB
testcase_38 AC 45 ms
66,532 KB
testcase_39 AC 91 ms
77,076 KB
testcase_40 AC 87 ms
76,948 KB
testcase_41 AC 109 ms
81,032 KB
testcase_42 AC 105 ms
75,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def ctoi(c):
	return ord(c) - ord("a")
	
def itoc(i):
	return chr(ord("a") + i)

def deg(s):
	res = [0] * 26
	for c in s:
		res[ctoi(c)] += 1
	return tuple(res)
	
n = int(input())
ss = [input() for _ in range(n)]

cnt = {}
for s in ss:
	for c in "abcdefghijklmnopqrstuvwxyz":
		t = s + c
		dt = deg(t)
		if dt in cnt:
			cnt[dt] += 1
		else:
			cnt[dt] = 1
			
ans = "-1"
for dt in cnt:
	if cnt[dt] == 1:
		t = "".join(itoc(i) * dt[i] for i in range(26))
		ans = t
		break
	
print(ans)
0