結果

問題 No.2865 Base 10 Subsets 2
ユーザー miya145592miya145592
提出日時 2024-08-30 21:38:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 342 bytes
コンパイル時間 155 ms
コンパイル使用メモリ 82,384 KB
実行使用メモリ 53,384 KB
最終ジャッジ日時 2024-08-30 21:38:10
合計ジャッジ時間 1,328 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,364 KB
testcase_01 AC 36 ms
52,948 KB
testcase_02 AC 37 ms
53,148 KB
testcase_03 AC 36 ms
52,216 KB
testcase_04 AC 36 ms
53,384 KB
testcase_05 AC 39 ms
52,032 KB
testcase_06 AC 37 ms
52,812 KB
testcase_07 AC 37 ms
52,824 KB
testcase_08 AC 37 ms
53,200 KB
testcase_09 AC 39 ms
52,608 KB
testcase_10 AC 36 ms
52,240 KB
testcase_11 AC 38 ms
52,120 KB
testcase_12 AC 36 ms
52,860 KB
testcase_13 AC 37 ms
52,696 KB
testcase_14 AC 37 ms
52,596 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
N, K = map(int, input().split())
if K==1:
    print(0)
    exit()
K-=1
dp = [0 for _ in range(20)]
i = 0
while N>0:
    a = N%10
    dp[i] = a+1
    N//=10
    i+=1
#print(dp)
ans = []
i = 0
while K>0:
    a = K%dp[i]
    ans.append(a)
    K//=dp[i]
    i+=1
ans = ans[::-1]
print("".join(map(str, ans)))
0