結果

問題 No.2715 Unique Chimatagram
ユーザー rlangevinrlangevin
提出日時 2024-04-05 22:02:15
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 602 bytes
コンパイル時間 166 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 79,828 KB
最終ジャッジ日時 2024-04-05 22:02:46
合計ジャッジ時間 29,012 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
55,612 KB
testcase_01 AC 48 ms
61,852 KB
testcase_02 AC 42 ms
55,612 KB
testcase_03 AC 51 ms
62,092 KB
testcase_04 AC 42 ms
55,612 KB
testcase_05 AC 42 ms
55,612 KB
testcase_06 AC 40 ms
55,612 KB
testcase_07 AC 41 ms
55,612 KB
testcase_08 TLE -
testcase_09 TLE -
testcase_10 AC 934 ms
78,040 KB
testcase_11 TLE -
testcase_12 TLE -
testcase_13 TLE -
testcase_14 TLE -
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 AC 70 ms
72,508 KB
testcase_19 AC 74 ms
72,508 KB
testcase_20 AC 78 ms
72,644 KB
testcase_21 AC 77 ms
72,508 KB
testcase_22 AC 71 ms
72,508 KB
testcase_23 AC 70 ms
72,508 KB
testcase_24 AC 71 ms
72,508 KB
testcase_25 AC 72 ms
72,508 KB
testcase_26 AC 72 ms
72,508 KB
testcase_27 AC 70 ms
72,508 KB
testcase_28 TLE -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *

N = int(input())
S = [None] * N
for i in range(N):
    S[i] = Counter(input())
    
def check(a, b):
    for k, v in S[b].items():
        if S[a][k] < v:
            return 0
    return 1
    
for i in range(N):
    temp = 0
    for k in range(26):
        S[i][chr(ord("a") + k)] += 1
        for j in range(N):
            if check(i, j):
                temp += 1
        if temp == 1:
            ans = ""
            for k, v in S[i].items():
                ans += k * v
            print(ans)
            exit()
        S[i][chr(ord("a") + k)] -= 1
        
print(-1)
0