結果

問題 No.2246 1333-like Number
ユーザー n_nan_na
提出日時 2023-03-17 23:15:15
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 386 bytes
コンパイル時間 512 ms
コンパイル使用メモリ 81,784 KB
実行使用メモリ 169,608 KB
最終ジャッジ日時 2023-10-18 16:12:37
合計ジャッジ時間 4,274 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 42 ms
53,340 KB
testcase_02 AC 48 ms
61,680 KB
testcase_03 WA -
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
権限があれば一括ダウンロードができます

ソースコード

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