結果

問題 No.2246 1333-like Number
ユーザー n_na
提出日時 2023-03-17 23:15:15
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 386 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 82,416 KB
実行使用メモリ 259,328 KB
最終ジャッジ日時 2024-09-18 12:17:17
合計ジャッジ時間 3,813 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other WA * 1 TLE * 1 -- * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque

N = int(input())

deq = deque()
cnt = 0
for a in range(1,9):
    for b in range(a+1,10):
        deq.append((10*a + b, b))
        cnt += 1

if N <= cnt:
    print(deq[N-1])
else:
    while cnt < N:
        a,b = deq.popleft()
        X = 10*a + b
        deq.append((X,b))
        cnt += 1
        if cnt == N:
            print(X)
            break
    
0