結果

問題 No.2715 Unique Chimatagram
ユーザー hato336hato336
提出日時 2024-04-05 21:39:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,953 ms / 2,000 ms
コード長 1,019 bytes
コンパイル時間 203 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 91,320 KB
最終ジャッジ日時 2024-04-05 21:39:50
合計ジャッジ時間 11,074 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
85,048 KB
testcase_01 AC 108 ms
85,048 KB
testcase_02 AC 110 ms
85,048 KB
testcase_03 AC 122 ms
88,248 KB
testcase_04 AC 121 ms
88,248 KB
testcase_05 AC 115 ms
88,248 KB
testcase_06 AC 114 ms
88,248 KB
testcase_07 AC 107 ms
85,048 KB
testcase_08 AC 173 ms
90,936 KB
testcase_09 AC 197 ms
91,064 KB
testcase_10 AC 172 ms
90,936 KB
testcase_11 AC 173 ms
90,936 KB
testcase_12 AC 169 ms
90,936 KB
testcase_13 AC 171 ms
91,064 KB
testcase_14 AC 174 ms
91,064 KB
testcase_15 AC 182 ms
91,064 KB
testcase_16 AC 166 ms
91,064 KB
testcase_17 AC 168 ms
90,936 KB
testcase_18 AC 172 ms
91,064 KB
testcase_19 AC 178 ms
91,064 KB
testcase_20 AC 176 ms
91,064 KB
testcase_21 AC 171 ms
91,064 KB
testcase_22 AC 195 ms
91,064 KB
testcase_23 AC 177 ms
91,064 KB
testcase_24 AC 170 ms
91,064 KB
testcase_25 AC 170 ms
91,064 KB
testcase_26 AC 170 ms
91,064 KB
testcase_27 AC 171 ms
91,064 KB
testcase_28 AC 213 ms
91,192 KB
testcase_29 AC 193 ms
90,936 KB
testcase_30 AC 196 ms
91,192 KB
testcase_31 AC 176 ms
90,936 KB
testcase_32 AC 266 ms
91,064 KB
testcase_33 AC 109 ms
85,048 KB
testcase_34 AC 105 ms
85,048 KB
testcase_35 AC 106 ms
85,048 KB
testcase_36 AC 127 ms
85,048 KB
testcase_37 AC 107 ms
85,048 KB
testcase_38 AC 127 ms
89,400 KB
testcase_39 AC 677 ms
90,296 KB
testcase_40 AC 199 ms
90,296 KB
testcase_41 AC 368 ms
91,192 KB
testcase_42 AC 1,953 ms
91,320 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
t = time.time()
#sys.setrecursionlimit(10**9)
#sys.set_int_max_str_digits(0)
#input = sys.stdin.readline
n = int(input())
se = [set() for i in range(n)]
a = []
for i in range(n):
    check = 0
    s = input().rstrip()
    a.append(s)
    for j in s:
        check += pow(12,ord(j) - ord('a'))
    for j in range(26):
        check += pow(12,j)
        se[i].add(check)
        check -= pow(12,j)

for i in range(n):
    for j in se[i]:
        if time.time() - t > 1.9:
            exit(print(-1))
        cnt = 0
        for k in range(n):
            if k == i:
                continue
            if len(a[i]) != len(a[k]):
                continue
            if j in se[k]:
                cnt += 1
        if cnt == 0:
            for k in range(26):
                for l in range((j % pow(12,k+1)) // pow(12,k)):
                    print(chr(ord('a') + k),end='')
            print()
            exit()
print(-1)
0