結果

問題 No.2715 Unique Chimatagram
ユーザー june19312june19312
提出日時 2024-04-05 21:43:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 89 ms / 2,000 ms
コード長 815 bytes
コンパイル時間 143 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 80,592 KB
最終ジャッジ日時 2024-04-05 21:43:21
合計ジャッジ時間 4,515 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 35 ms
53,460 KB
testcase_02 AC 39 ms
53,460 KB
testcase_03 AC 37 ms
53,460 KB
testcase_04 AC 36 ms
53,460 KB
testcase_05 AC 36 ms
53,460 KB
testcase_06 AC 37 ms
53,460 KB
testcase_07 AC 35 ms
53,460 KB
testcase_08 AC 77 ms
79,316 KB
testcase_09 AC 78 ms
79,444 KB
testcase_10 AC 78 ms
79,444 KB
testcase_11 AC 78 ms
79,828 KB
testcase_12 AC 78 ms
79,444 KB
testcase_13 AC 78 ms
79,444 KB
testcase_14 AC 76 ms
79,444 KB
testcase_15 AC 77 ms
79,444 KB
testcase_16 AC 75 ms
79,444 KB
testcase_17 AC 78 ms
79,444 KB
testcase_18 AC 80 ms
80,592 KB
testcase_19 AC 89 ms
80,592 KB
testcase_20 AC 80 ms
80,592 KB
testcase_21 AC 81 ms
80,592 KB
testcase_22 AC 80 ms
80,592 KB
testcase_23 AC 80 ms
80,592 KB
testcase_24 AC 80 ms
80,592 KB
testcase_25 AC 80 ms
80,592 KB
testcase_26 AC 79 ms
80,592 KB
testcase_27 AC 80 ms
80,592 KB
testcase_28 AC 74 ms
76,076 KB
testcase_29 AC 75 ms
76,092 KB
testcase_30 AC 75 ms
76,076 KB
testcase_31 AC 88 ms
76,208 KB
testcase_32 AC 73 ms
76,076 KB
testcase_33 AC 36 ms
53,460 KB
testcase_34 AC 36 ms
53,460 KB
testcase_35 AC 37 ms
53,460 KB
testcase_36 AC 36 ms
53,460 KB
testcase_37 AC 35 ms
53,460 KB
testcase_38 AC 54 ms
66,824 KB
testcase_39 AC 71 ms
76,452 KB
testcase_40 AC 70 ms
76,324 KB
testcase_41 AC 78 ms
77,988 KB
testcase_42 AC 76 ms
75,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

dic = {}
dic2 = {}
abc = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
for i in range(N):
    S = list(input())
    S.sort()
    nex = "".join(S)
    
    if nex in dic:
        dic[nex] += 1
    else:
        dic[nex] = 1

    for j in abc:
            nex2 = S + [j]
            nex2.sort()
            nex3 = "".join(nex2)
            if nex3 not in dic2:
                dic2[nex3] = 1
            else:
                dic2[nex3] += 1

#print(dic)
#print(dic2)

for ind,val in dic.items():
    if val == 1:
        for j in abc:
            nex2 = list(ind) + [j]
            nex2.sort()
            nex3 = "".join(nex2)
            if nex3 in dic2 and dic2[nex3] == 1:
                print(nex3)
                exit()
print(-1)

0