結果

問題 No.1651 Removing Cards
ユーザー Kiri8128Kiri8128
提出日時 2021-08-20 22:35:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 226 ms / 2,000 ms
コード長 342 bytes
コンパイル時間 369 ms
コンパイル使用メモリ 82,476 KB
実行使用メモリ 100,608 KB
最終ジャッジ日時 2024-04-22 05:24:50
合計ジャッジ時間 8,758 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
51,712 KB
testcase_01 AC 40 ms
51,840 KB
testcase_02 AC 54 ms
65,664 KB
testcase_03 AC 40 ms
52,352 KB
testcase_04 AC 40 ms
52,352 KB
testcase_05 AC 41 ms
52,224 KB
testcase_06 AC 40 ms
52,480 KB
testcase_07 AC 40 ms
52,480 KB
testcase_08 AC 40 ms
52,352 KB
testcase_09 AC 156 ms
77,696 KB
testcase_10 AC 159 ms
77,312 KB
testcase_11 AC 158 ms
77,440 KB
testcase_12 AC 163 ms
77,440 KB
testcase_13 AC 160 ms
77,336 KB
testcase_14 AC 161 ms
77,696 KB
testcase_15 AC 219 ms
100,352 KB
testcase_16 AC 213 ms
100,292 KB
testcase_17 AC 222 ms
100,224 KB
testcase_18 AC 216 ms
100,352 KB
testcase_19 AC 218 ms
99,840 KB
testcase_20 AC 220 ms
100,272 KB
testcase_21 AC 222 ms
100,096 KB
testcase_22 AC 180 ms
100,224 KB
testcase_23 AC 147 ms
77,184 KB
testcase_24 AC 142 ms
77,696 KB
testcase_25 AC 166 ms
78,592 KB
testcase_26 AC 164 ms
78,464 KB
testcase_27 AC 214 ms
100,096 KB
testcase_28 AC 211 ms
100,608 KB
testcase_29 AC 226 ms
95,144 KB
testcase_30 AC 223 ms
94,416 KB
testcase_31 AC 222 ms
94,300 KB
testcase_32 AC 157 ms
77,568 KB
testcase_33 AC 159 ms
77,568 KB
testcase_34 AC 163 ms
77,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_right as br
K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]
ma = max(A)
L = []
i = 0
while i <= ma:
    p = i // K + 1
    i += p
    n = i // K + 1
    while n > p:
        i += n - p
        p = n
        n = i // K + 1
    L.append(i + 1)
for a in A:
    print(L[br(L, a)-1] if a > 1 else 1)
0