結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
62,416 KB
testcase_01 AC 48 ms
61,852 KB
testcase_02 AC 40 ms
55,612 KB
testcase_03 AC 40 ms
55,612 KB
testcase_04 AC 41 ms
55,612 KB
testcase_05 AC 43 ms
55,612 KB
testcase_06 AC 42 ms
55,612 KB
testcase_07 AC 40 ms
55,612 KB
testcase_08 AC 1,170 ms
78,424 KB
testcase_09 TLE -
testcase_10 AC 263 ms
77,272 KB
testcase_11 AC 312 ms
77,524 KB
testcase_12 TLE -
testcase_13 AC 893 ms
77,908 KB
testcase_14 AC 591 ms
77,672 KB
testcase_15 AC 152 ms
77,144 KB
testcase_16 AC 361 ms
77,272 KB
testcase_17 AC 227 ms
77,404 KB
testcase_18 AC 72 ms
72,508 KB
testcase_19 AC 72 ms
72,508 KB
testcase_20 AC 76 ms
72,644 KB
testcase_21 AC 72 ms
72,508 KB
testcase_22 AC 71 ms
72,508 KB
testcase_23 AC 75 ms
72,508 KB
testcase_24 AC 72 ms
72,508 KB
testcase_25 AC 72 ms
72,508 KB
testcase_26 AC 72 ms
72,508 KB
testcase_27 AC 75 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):
    # flag = 1
    # for j in range(N):
    #     if i == j:
    #         continue
    #     if S[i] == S[j]:
    #         flag = 0
    #         break
    # if not flag:
    #     continue
    
    for k in range(26):
        temp = 0
        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