結果
| 問題 |
No.205 マージして辞書順最小
|
| コンテスト | |
| ユーザー |
ayaoni
|
| 提出日時 | 2021-08-30 22:30:11 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 71 ms / 5,000 ms |
| コード長 | 667 bytes |
| コンパイル時間 | 277 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 69,376 KB |
| 最終ジャッジ日時 | 2024-11-24 06:57:40 |
| 合計ジャッジ時間 | 2,024 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 15 |
ソースコード
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def LS2(): return list(sys.stdin.readline().rstrip())
N = I()
S = [S()+'{' for _ in range(N)]
ANS = []
while True:
S.sort()
if S[0] == '{':
break
ANS.append(S[0][0])
new_S = [S[0][1:]]
for s in S[1:]:
new_S.append(s)
S = new_S
ans = ''.join(ANS)
print(ans)
ayaoni