結果

問題 No.1651 Removing Cards
ユーザー hir355hir355
提出日時 2021-08-20 22:32:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 413 ms / 2,000 ms
コード長 229 bytes
コンパイル時間 160 ms
コンパイル使用メモリ 82,528 KB
実行使用メモリ 98,048 KB
最終ジャッジ日時 2024-04-22 05:20:39
合計ジャッジ時間 12,572 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,352 KB
testcase_01 AC 38 ms
51,968 KB
testcase_02 AC 60 ms
72,320 KB
testcase_03 AC 42 ms
52,864 KB
testcase_04 AC 41 ms
52,736 KB
testcase_05 AC 40 ms
52,096 KB
testcase_06 AC 40 ms
52,096 KB
testcase_07 AC 40 ms
52,224 KB
testcase_08 AC 41 ms
52,608 KB
testcase_09 AC 319 ms
76,160 KB
testcase_10 AC 321 ms
76,288 KB
testcase_11 AC 321 ms
76,032 KB
testcase_12 AC 327 ms
76,160 KB
testcase_13 AC 323 ms
76,160 KB
testcase_14 AC 327 ms
76,328 KB
testcase_15 AC 403 ms
97,664 KB
testcase_16 AC 413 ms
95,360 KB
testcase_17 AC 394 ms
95,104 KB
testcase_18 AC 386 ms
95,604 KB
testcase_19 AC 387 ms
95,412 KB
testcase_20 AC 390 ms
95,356 KB
testcase_21 AC 394 ms
95,296 KB
testcase_22 AC 344 ms
97,792 KB
testcase_23 AC 311 ms
76,416 KB
testcase_24 AC 295 ms
76,332 KB
testcase_25 AC 364 ms
97,792 KB
testcase_26 AC 357 ms
95,104 KB
testcase_27 AC 402 ms
98,048 KB
testcase_28 AC 393 ms
97,920 KB
testcase_29 AC 394 ms
97,664 KB
testcase_30 AC 397 ms
97,536 KB
testcase_31 AC 395 ms
97,712 KB
testcase_32 AC 311 ms
76,160 KB
testcase_33 AC 322 ms
76,032 KB
testcase_34 AC 319 ms
76,032 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