結果
| 問題 | 
                            No.2246 1333-like Number
                             | 
                    
| コンテスト | |
| ユーザー | 
                             lam6er
                         | 
                    
| 提出日時 | 2025-04-15 23:04:16 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 562 bytes | 
| コンパイル時間 | 176 ms | 
| コンパイル使用メモリ | 81,976 KB | 
| 実行使用メモリ | 67,652 KB | 
| 最終ジャッジ日時 | 2025-04-15 23:06:24 | 
| 合計ジャッジ時間 | 3,919 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 1 TLE * 1 -- * 22 | 
ソースコード
import heapq
n = int(input())
heap = []
# Generate all a and b pairs where a < b
for a in range(1, 10):
    for b in range(a + 1, 10):
        initial = str(a) + str(b)
        heapq.heappush(heap, (2, initial, a, b, 1))
count = 0
result = ""
while heap:
    length, current, a, b, k = heapq.heappop(heap)
    count += 1
    if count == n:
        result = current
        break
    # Generate next number by appending b
    next_str = current + str(b)
    next_length = length + 1
    heapq.heappush(heap, (next_length, next_str, a, b, k + 1))
print(result)
            
            
            
        
            
lam6er