結果

問題 No.2865 Base 10 Subsets 2
ユーザー ねしん
提出日時 2024-08-30 21:50:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 251 bytes
コンパイル時間 165 ms
コンパイル使用メモリ 82,596 KB
実行使用メモリ 53,976 KB
最終ジャッジ日時 2024-08-30 21:50:19
合計ジャッジ時間 1,321 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=list(map(int,input().split()))
N=str(N)
M=[]
ans=[]
for i in range(len(N)):
	M.append(int(N[i])+1)
for i in range(len(N)):
	cnt=1
	for j in range(i+1,len(N)):
		cnt*=M[j]
	ans.append(str((K-1)//cnt))
	K=(K-1)%cnt+1
ans="".join(ans)
print(int(ans))
0