結果
| 問題 | No.2715 Unique Chimatagram | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2024-04-05 21:30:20 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                TLE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 841 bytes | 
| コンパイル時間 | 376 ms | 
| コンパイル使用メモリ | 82,432 KB | 
| 実行使用メモリ | 107,620 KB | 
| 最終ジャッジ日時 | 2024-10-01 01:43:42 | 
| 合計ジャッジ時間 | 18,246 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 36 TLE * 3 -- * 1 | 
ソースコード
import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
#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)]
for i in range(n):
    check = [0 for j in range(26)]
    s = input().rstrip()
    for j in s:
        check[ord(j) - ord('a')] += 1
    for j in range(26):
        check[j] += 1
        se[i].add(tuple(check))
        check[j] -= 1
for i in range(n):
    for j in se[i]:
        cnt = 0
        for k in range(n):
            if k == i:
                continue
            if j in se[k]:
                cnt += 1
        if cnt == 0:
            for k in range(26):
                for l in range(j[k]):
                    print(chr(ord('a') + k),end='')
            print()
            exit()
print(-1)
            
            
            
        