結果
| 問題 | No.2715 Unique Chimatagram |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-05 22:21:44 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 453 bytes |
| 記録 | |
| コンパイル時間 | 661 ms |
| コンパイル使用メモリ | 20,696 KB |
| 実行使用メモリ | 15,360 KB |
| 最終ジャッジ日時 | 2026-04-17 02:55:46 |
| 合計ジャッジ時間 | 7,827 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 WA * 18 |
ソースコード
n = int(input())
s = []
for i in range(n):
s.append(''.join(sorted(input())))
s.sort()
if n == 1:
print(s[0] + "a")
else:
f = True
for i in range(n-1):
a, b = s[i], s[i+1]
if a == b: continue
if len(a) < len(b):
print(a + "a")
else:
for j in range(len(a)):
if a[j] != b[j]:
for c in "abcdefghijklmnopqrstuvwxyz":
if c != a[j] and c != b[j]:
print(a+c)
break
break
f = False
break
if f: print(-1)