結果
| 問題 |
No.2132 1 or X Game
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2022-11-30 02:14:47 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 252 bytes |
| コンパイル時間 | 284 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-10-07 09:07:09 |
| 合計ジャッジ時間 | 18,734 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 8 WA * 3 |
ソースコード
mod=998244353
T=int(input())
for tests in range(T):
N,X=map(int,input().split())
if X%2==1:
print(((N+1)//2)%mod)
else:
lo=(N+1)//(X+3)
ANS=lo*(X//2+2)
rest=N-lo*(X+3)
print((ANS+(rest+1)//2)%mod)
titia