結果

問題 No.2715 Unique Chimatagram
ユーザー akasia_midoriakasia_midori
提出日時 2024-04-06 03:19:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 109 ms / 2,000 ms
コード長 1,076 bytes
コンパイル時間 298 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 76,636 KB
最終ジャッジ日時 2024-04-06 03:20:22
合計ジャッジ時間 4,653 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
55,612 KB
testcase_01 AC 41 ms
55,612 KB
testcase_02 AC 40 ms
55,612 KB
testcase_03 AC 40 ms
55,612 KB
testcase_04 AC 40 ms
55,612 KB
testcase_05 AC 40 ms
55,612 KB
testcase_06 AC 41 ms
55,612 KB
testcase_07 AC 41 ms
55,612 KB
testcase_08 AC 65 ms
67,960 KB
testcase_09 AC 63 ms
67,960 KB
testcase_10 AC 62 ms
67,960 KB
testcase_11 AC 63 ms
67,960 KB
testcase_12 AC 72 ms
72,796 KB
testcase_13 AC 65 ms
70,064 KB
testcase_14 AC 63 ms
67,964 KB
testcase_15 AC 63 ms
67,960 KB
testcase_16 AC 63 ms
67,960 KB
testcase_17 AC 62 ms
67,960 KB
testcase_18 AC 74 ms
74,344 KB
testcase_19 AC 72 ms
74,340 KB
testcase_20 AC 73 ms
74,340 KB
testcase_21 AC 74 ms
74,340 KB
testcase_22 AC 74 ms
74,344 KB
testcase_23 AC 74 ms
74,340 KB
testcase_24 AC 75 ms
74,344 KB
testcase_25 AC 75 ms
74,340 KB
testcase_26 AC 76 ms
74,344 KB
testcase_27 AC 75 ms
74,344 KB
testcase_28 AC 70 ms
72,808 KB
testcase_29 AC 66 ms
70,340 KB
testcase_30 AC 75 ms
73,704 KB
testcase_31 AC 66 ms
70,592 KB
testcase_32 AC 66 ms
70,340 KB
testcase_33 AC 40 ms
55,612 KB
testcase_34 AC 41 ms
55,612 KB
testcase_35 AC 40 ms
55,612 KB
testcase_36 AC 43 ms
55,612 KB
testcase_37 AC 41 ms
55,612 KB
testcase_38 AC 50 ms
63,760 KB
testcase_39 AC 83 ms
76,032 KB
testcase_40 AC 107 ms
76,560 KB
testcase_41 AC 109 ms
76,636 KB
testcase_42 AC 57 ms
65,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def oi(): return int(input())
def os(): return input().rstrip()
def mi(): return list(map(int, input().split()))

# import sys
# input = sys.stdin.readline
# import sys
# sys.setrecursionlimit(10**8)
# import pypyjit
# pypyjit.set_param('max_unroll_recursion=-1')
from collections import defaultdict
input_count = 0

N = oi()
dicts = {i:defaultdict(int) for i in range(1,12)}
for _ in range(N):
    S = "".join(sorted(list(os())))
    dicts[len(S)][S] += 1
alpha = [chr(ord("a")+i) for i in range(26)]
output = "-1"
flg = False
for i in range(1, 11):
    for k in dicts[i].keys():
        for a in alpha:
            temp = "".join(sorted(list(k+a)))
            count = 0
            sets = set([])
            for j in range(len(temp)):
                temp2 = temp[:j] + temp[j+1:]
                sets.add(temp2)
            for temp2 in sets:
                if temp2 in dicts[i]:
                    count += dicts[i][temp2]

            if count == 1:
                output = k+a
                flg = True
                break
    if flg:
        break
print(output)
0