結果

問題 No.2715 Unique Chimatagram
ユーザー kk0414kk0414
提出日時 2024-04-10 23:07:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 526 bytes
コンパイル時間 463 ms
コンパイル使用メモリ 82,500 KB
実行使用メモリ 77,164 KB
最終ジャッジ日時 2024-04-10 23:07:15
合計ジャッジ時間 5,857 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,468 KB
testcase_01 AC 36 ms
52,456 KB
testcase_02 AC 36 ms
52,072 KB
testcase_03 WA -
testcase_04 AC 36 ms
53,028 KB
testcase_05 AC 33 ms
53,048 KB
testcase_06 AC 35 ms
53,428 KB
testcase_07 AC 31 ms
52,352 KB
testcase_08 AC 49 ms
66,512 KB
testcase_09 WA -
testcase_10 AC 49 ms
66,756 KB
testcase_11 AC 49 ms
68,256 KB
testcase_12 AC 49 ms
66,432 KB
testcase_13 AC 50 ms
66,572 KB
testcase_14 AC 59 ms
69,452 KB
testcase_15 AC 57 ms
69,224 KB
testcase_16 AC 51 ms
67,180 KB
testcase_17 AC 50 ms
66,536 KB
testcase_18 AC 50 ms
68,684 KB
testcase_19 AC 53 ms
67,804 KB
testcase_20 AC 51 ms
68,176 KB
testcase_21 AC 53 ms
68,168 KB
testcase_22 AC 51 ms
67,848 KB
testcase_23 AC 52 ms
68,460 KB
testcase_24 AC 51 ms
69,196 KB
testcase_25 AC 51 ms
67,492 KB
testcase_26 AC 52 ms
68,272 KB
testcase_27 AC 49 ms
68,584 KB
testcase_28 AC 87 ms
76,936 KB
testcase_29 AC 60 ms
70,308 KB
testcase_30 AC 70 ms
73,932 KB
testcase_31 AC 54 ms
68,884 KB
testcase_32 AC 147 ms
76,660 KB
testcase_33 AC 33 ms
52,872 KB
testcase_34 AC 33 ms
52,412 KB
testcase_35 AC 33 ms
52,256 KB
testcase_36 AC 35 ms
52,808 KB
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 549 ms
76,612 KB
testcase_42 AC 217 ms
77,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
L = [[0]*26 for _ in range(N)]
cand = []
for i in range(N):
    s = input()
    cand.append(s)
    for si in s:
        j = ord(si)-ord("a")
        L[i][j] += 1

for i in range(N):
    OK = [False] * N
    OK[i] = True
    for j in range(N):
        if i==j:continue
        flag = False
        for k in range(26):
            if L[j][k] != L[i][k]:
                flag = True
        OK[j] = flag
    if all(OK): break

if not all(OK):
    print("-1")
else:
    ans = cand[i] + "a"
    print(ans)
        
0