結果

問題 No.2715 Unique Chimatagram
ユーザー june19312june19312
提出日時 2024-04-05 21:36:25
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 810 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 80,592 KB
最終ジャッジ日時 2024-04-05 21:36:34
合計ジャッジ時間 5,747 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,460 KB
testcase_01 AC 39 ms
53,460 KB
testcase_02 AC 39 ms
53,460 KB
testcase_03 AC 39 ms
53,460 KB
testcase_04 AC 39 ms
53,460 KB
testcase_05 AC 39 ms
53,460 KB
testcase_06 AC 39 ms
53,460 KB
testcase_07 AC 40 ms
53,460 KB
testcase_08 AC 85 ms
79,360 KB
testcase_09 AC 85 ms
79,360 KB
testcase_10 AC 86 ms
79,188 KB
testcase_11 AC 87 ms
79,952 KB
testcase_12 AC 89 ms
79,444 KB
testcase_13 AC 87 ms
79,444 KB
testcase_14 AC 84 ms
79,440 KB
testcase_15 AC 87 ms
79,488 KB
testcase_16 AC 84 ms
79,440 KB
testcase_17 AC 85 ms
79,360 KB
testcase_18 AC 87 ms
80,592 KB
testcase_19 AC 86 ms
80,592 KB
testcase_20 AC 88 ms
80,592 KB
testcase_21 AC 87 ms
80,592 KB
testcase_22 AC 87 ms
80,592 KB
testcase_23 AC 87 ms
80,592 KB
testcase_24 AC 86 ms
80,592 KB
testcase_25 AC 86 ms
80,592 KB
testcase_26 AC 86 ms
80,592 KB
testcase_27 AC 85 ms
80,592 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 40 ms
53,460 KB
testcase_34 AC 39 ms
53,460 KB
testcase_35 AC 38 ms
53,460 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 79 ms
78,408 KB
testcase_42 AC 53 ms
63,192 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 = S + [j]
            nex2.sort()
            nex3 = "".join(nex2)
            if nex3 in dic2 and dic2[nex3] == 1:
                print(nex3)
                exit()
print(-1)

0