結果
| 問題 | No.1651 Removing Cards |
| コンテスト | |
| ユーザー |
hir355
|
| 提出日時 | 2021-08-20 22:32:55 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 244 ms / 2,000 ms |
| + 363µs | |
| コード長 | 229 bytes |
| 記録 | |
| コンパイル時間 | 65 ms |
| コンパイル使用メモリ | 80,892 KB |
| 実行使用メモリ | 105,344 KB |
| 最終ジャッジ日時 | 2026-09-16 05:17:30 |
| 合計ジャッジ時間 | 10,558 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 |
ソースコード
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])
hir355