結果
| 問題 |
No.2246 1333-like Number
|
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-04-15 23:16:06 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 472 bytes |
| コンパイル時間 | 308 ms |
| コンパイル使用メモリ | 82,120 KB |
| 実行使用メモリ | 269,028 KB |
| 最終ジャッジ日時 | 2025-04-15 23:18:14 |
| 合計ジャッジ時間 | 3,957 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 1 TLE * 1 -- * 22 |
ソースコード
import heapq
n = int(input())
heap = []
# Generate all possible (a, b) pairs and their initial numbers
for a in range(1, 10):
for b in range(a + 1, 10):
num_str = f"{a}{b}"
heapq.heappush(heap, (len(num_str), num_str, a, b))
current = None
for _ in range(n):
current = heapq.heappop(heap)
length, num_str, a, b = current
next_num_str = num_str + str(b)
heapq.heappush(heap, (len(next_num_str), next_num_str, a, b))
print(current[1])
lam6er