結果

問題 No.2715 Unique Chimatagram
ユーザー titiatitia
提出日時 2024-04-05 22:03:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 735 bytes
コンパイル時間 162 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 78,908 KB
最終ジャッジ日時 2024-04-05 22:03:10
合計ジャッジ時間 7,872 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
55,608 KB
testcase_01 AC 41 ms
55,608 KB
testcase_02 AC 42 ms
55,608 KB
testcase_03 AC 41 ms
55,608 KB
testcase_04 AC 43 ms
55,608 KB
testcase_05 AC 42 ms
55,608 KB
testcase_06 AC 41 ms
55,608 KB
testcase_07 AC 41 ms
55,608 KB
testcase_08 AC 340 ms
78,524 KB
testcase_09 AC 355 ms
78,268 KB
testcase_10 AC 144 ms
77,760 KB
testcase_11 AC 172 ms
78,908 KB
testcase_12 WA -
testcase_13 AC 236 ms
78,392 KB
testcase_14 AC 191 ms
78,780 KB
testcase_15 AC 116 ms
78,008 KB
testcase_16 AC 157 ms
77,504 KB
testcase_17 AC 127 ms
78,392 KB
testcase_18 AC 69 ms
73,020 KB
testcase_19 AC 69 ms
73,020 KB
testcase_20 AC 70 ms
73,020 KB
testcase_21 AC 68 ms
72,760 KB
testcase_22 AC 74 ms
72,760 KB
testcase_23 AC 69 ms
73,020 KB
testcase_24 AC 68 ms
72,760 KB
testcase_25 AC 69 ms
72,760 KB
testcase_26 AC 71 ms
73,020 KB
testcase_27 AC 69 ms
72,760 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 42 ms
55,608 KB
testcase_34 AC 41 ms
55,608 KB
testcase_35 AC 41 ms
55,608 KB
testcase_36 AC 41 ms
55,608 KB
testcase_37 AC 43 ms
55,608 KB
testcase_38 AC 60 ms
68,692 KB
testcase_39 AC 575 ms
77,272 KB
testcase_40 AC 129 ms
77,020 KB
testcase_41 AC 60 ms
68,264 KB
testcase_42 AC 59 ms
70,316 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

from collections import Counter

n=int(input())
S=[sorted(input().strip()) for i in range(n)]
CS=[]
for i in range(n):
    CS.append(Counter(S[i]))

for i in range(n):
    if i+1<n and S[i]==S[i+1]:
        continue
    if i-1>=0 and S[i]==S[i-1]:
        continue

    for x in "abcdefghijklmnopqrstuvwxyz":
        T=S[i]+[x]
        C=Counter(T)
        flag=1

        for j in range(n):
            if i==j:
                continue
            for s in Counter(CS[j]):
                if C[s]<CS[j][s]:
                    break
            else:
                flag=0
                break

        if flag==1:
            print("".join(T))
            exit()
        
        
print(-1)
0