結果

問題 No.1651 Removing Cards
ユーザー hir355hir355
提出日時 2021-08-20 22:32:55
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 408 ms / 2,000 ms
コード長 229 bytes
コンパイル時間 442 ms
コンパイル使用メモリ 87,224 KB
実行使用メモリ 96,724 KB
最終ジャッジ日時 2023-08-04 07:27:02
合計ジャッジ時間 14,347 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,488 KB
testcase_01 AC 76 ms
71,368 KB
testcase_02 AC 90 ms
83,380 KB
testcase_03 AC 75 ms
71,576 KB
testcase_04 AC 78 ms
71,124 KB
testcase_05 AC 76 ms
71,496 KB
testcase_06 AC 77 ms
71,592 KB
testcase_07 AC 76 ms
71,320 KB
testcase_08 AC 75 ms
71,592 KB
testcase_09 AC 330 ms
78,944 KB
testcase_10 AC 326 ms
78,332 KB
testcase_11 AC 330 ms
78,716 KB
testcase_12 AC 321 ms
78,628 KB
testcase_13 AC 323 ms
78,424 KB
testcase_14 AC 327 ms
78,604 KB
testcase_15 AC 403 ms
96,540 KB
testcase_16 AC 392 ms
96,484 KB
testcase_17 AC 405 ms
96,348 KB
testcase_18 AC 395 ms
96,400 KB
testcase_19 AC 382 ms
96,040 KB
testcase_20 AC 386 ms
96,044 KB
testcase_21 AC 384 ms
96,332 KB
testcase_22 AC 350 ms
96,724 KB
testcase_23 AC 333 ms
78,392 KB
testcase_24 AC 302 ms
78,716 KB
testcase_25 AC 360 ms
96,584 KB
testcase_26 AC 355 ms
96,336 KB
testcase_27 AC 384 ms
96,620 KB
testcase_28 AC 383 ms
96,456 KB
testcase_29 AC 408 ms
96,544 KB
testcase_30 AC 384 ms
96,360 KB
testcase_31 AC 395 ms
96,684 KB
testcase_32 AC 326 ms
78,868 KB
testcase_33 AC 320 ms
78,672 KB
testcase_34 AC 321 ms
78,524 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_right
k, q = map(int, input().split())
a = [1]
while a[-1] < 1000000000000000000:
    a.append((a[-1] * k - 1) // (k - 1) + 1)
for _ in range(q):
    n = int(input())
    print(a[bisect_right(a, n) - 1])
0