結果

問題 No.2715 Unique Chimatagram
ユーザー ShirotsumeShirotsume
提出日時 2024-04-05 21:47:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,044 ms / 2,000 ms
コード長 750 bytes
コンパイル時間 198 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 89,536 KB
最終ジャッジ日時 2024-04-05 21:47:33
合計ジャッジ時間 6,456 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
66,304 KB
testcase_01 AC 62 ms
66,304 KB
testcase_02 AC 51 ms
66,304 KB
testcase_03 AC 54 ms
66,304 KB
testcase_04 AC 50 ms
66,304 KB
testcase_05 AC 52 ms
66,304 KB
testcase_06 AC 52 ms
66,304 KB
testcase_07 AC 50 ms
66,304 KB
testcase_08 AC 97 ms
88,256 KB
testcase_09 AC 97 ms
88,124 KB
testcase_10 AC 94 ms
88,000 KB
testcase_11 AC 115 ms
88,384 KB
testcase_12 AC 93 ms
88,124 KB
testcase_13 AC 94 ms
87,616 KB
testcase_14 AC 100 ms
88,640 KB
testcase_15 AC 95 ms
88,252 KB
testcase_16 AC 91 ms
88,128 KB
testcase_17 AC 96 ms
88,252 KB
testcase_18 AC 96 ms
89,536 KB
testcase_19 AC 97 ms
89,536 KB
testcase_20 AC 97 ms
89,536 KB
testcase_21 AC 120 ms
89,536 KB
testcase_22 AC 97 ms
89,536 KB
testcase_23 AC 99 ms
89,536 KB
testcase_24 AC 98 ms
89,536 KB
testcase_25 AC 97 ms
89,536 KB
testcase_26 AC 96 ms
89,536 KB
testcase_27 AC 99 ms
89,536 KB
testcase_28 AC 134 ms
83,392 KB
testcase_29 AC 121 ms
83,520 KB
testcase_30 AC 131 ms
83,392 KB
testcase_31 AC 121 ms
83,392 KB
testcase_32 AC 148 ms
83,520 KB
testcase_33 AC 50 ms
66,304 KB
testcase_34 AC 51 ms
66,304 KB
testcase_35 AC 49 ms
66,304 KB
testcase_36 AC 49 ms
66,304 KB
testcase_37 AC 50 ms
66,304 KB
testcase_38 AC 61 ms
73,696 KB
testcase_39 AC 117 ms
79,680 KB
testcase_40 AC 98 ms
79,552 KB
testcase_41 AC 1,044 ms
87,488 KB
testcase_42 AC 98 ms
84,032 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, time, random
from collections import deque, Counter, defaultdict
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 61 - 1
mod = 998244353
import string
n = ii()
s = [sorted(input()) for _ in range(n)]
ts = []
for v in s:
    for x in string.ascii_lowercase:
        ts.append(sorted(v + [x]))
ts = set(map(tuple, ts))
s = list(map(tuple, s))
for v in ts:
    cnt = set()
    for i in range(len(v)):
        now = tuple(v[:i] + v[i + 1:])
        for j in range(n):
            if tuple(now) == s[j]:
                cnt.add(j)
        if len(cnt) > 1:
            break
    if len(cnt) == 1:
        print(''.join(v))
        exit()
print(-1)
0