結果
| 問題 |
No.1651 Removing Cards
|
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 17:06:49 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 517 bytes |
| コンパイル時間 | 294 ms |
| コンパイル使用メモリ | 82,344 KB |
| 実行使用メモリ | 92,320 KB |
| 最終ジャッジ日時 | 2025-06-12 17:06:57 |
| 合計ジャッジ時間 | 7,355 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 TLE * 1 -- * 19 |
ソースコード
import sys
def main():
input = sys.stdin.read
data = input().split()
idx = 0
K = int(data[idx])
idx += 1
Q = int(data[idx])
idx += 1
for _ in range(Q):
N = int(data[idx])
idx += 1
current_M = N
result = 1
while current_M > 1:
m_marked = (current_M - 1) // K + 1
current_M -= m_marked
s = (result - 1) // (K - 1)
result = 1 + result + s
print(result)
if __name__ == "__main__":
main()
gew1fw