結果

問題 No.1651 Removing Cards
ユーザー Kiri8128Kiri8128
提出日時 2021-08-20 22:33:57
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 326 bytes
コンパイル時間 422 ms
コンパイル使用メモリ 82,320 KB
実行使用メモリ 100,456 KB
最終ジャッジ日時 2024-04-22 05:22:33
合計ジャッジ時間 8,630 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
51,968 KB
testcase_01 AC 38 ms
52,096 KB
testcase_02 AC 55 ms
65,408 KB
testcase_03 AC 41 ms
52,224 KB
testcase_04 AC 41 ms
52,352 KB
testcase_05 AC 39 ms
52,608 KB
testcase_06 AC 41 ms
52,736 KB
testcase_07 AC 40 ms
52,224 KB
testcase_08 AC 41 ms
52,480 KB
testcase_09 AC 155 ms
77,440 KB
testcase_10 AC 156 ms
77,376 KB
testcase_11 AC 158 ms
77,248 KB
testcase_12 AC 161 ms
77,428 KB
testcase_13 AC 160 ms
77,660 KB
testcase_14 AC 159 ms
77,184 KB
testcase_15 AC 221 ms
100,224 KB
testcase_16 AC 231 ms
100,224 KB
testcase_17 AC 236 ms
100,436 KB
testcase_18 AC 237 ms
100,096 KB
testcase_19 AC 224 ms
100,456 KB
testcase_20 AC 231 ms
100,224 KB
testcase_21 AC 231 ms
100,184 KB
testcase_22 AC 186 ms
99,824 KB
testcase_23 AC 156 ms
77,456 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 224 ms
100,224 KB
testcase_28 AC 227 ms
99,968 KB
testcase_29 AC 241 ms
94,608 KB
testcase_30 AC 238 ms
93,700 KB
testcase_31 AC 241 ms
94,016 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
権限があれば一括ダウンロードができます

ソースコード

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])
0