結果

問題 No.757 チャンパーノウン定数 (2)
コンテスト
ユーザー nasadigital
提出日時 2018-12-06 11:38:00
言語 Python3
(3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 300 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 292 ms
コンパイル使用メモリ 21,540 KB
実行使用メモリ 35,768 KB
最終ジャッジ日時 2026-08-26 17:53:04
合計ジャッジ時間 29,069 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1 RE * 1
other AC * 9 WA * 21 RE * 9 TLE * 1 -- * 11
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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