結果
問題 |
No.2715 Unique Chimatagram
|
ユーザー |
|
提出日時 | 2024-04-05 22:16:17 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 536 bytes |
コンパイル時間 | 176 ms |
コンパイル使用メモリ | 82,492 KB |
実行使用メモリ | 78,812 KB |
最終ジャッジ日時 | 2024-10-01 02:30:30 |
合計ジャッジ時間 | 14,103 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 7 WA * 33 |
ソースコード
def conv(dl): res = "" for i,t in enumerate(dl): if t: a = chr(i+ord("a")) res += a*2 return res n = int(input()) dp = [[False]*26 for _ in range(n)] for i in range(n): for si in input(): x = ord(si) - ord("a") dp[i][x] = True for i in range(n): for j in range(26): if not dp[i][j]: c = [dp[k][j] for k in range(n) if k!=i] if all(c): ans = conv(dp[i]) print(ans) exit() print("-1")