結果

問題 No.757 チャンパーノウン定数 (2)
ユーザー nasadigital
提出日時 2018-12-06 11:38:00
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 300 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 49,184 KB
最終ジャッジ日時 2024-09-14 02:22:28
合計ジャッジ時間 26,994 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1 RE * 1
other AC * 9 WA * 21 RE * 9 TLE * 1 -- * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
b = int(input()) 
n = int(input(), b)
digit = 0
total = 0
while True:
    total = total * b + (b - 1)
    digit += 1
    if n <= total * digit:
        break
    n -= total * digit
num = b ** (digit - 1) + ((n + digit - 1) // digit) - 1
print(np.base_repr(num, b)[(n - 1) % digit])
0