結果
問題 |
No.2132 1 or X Game
|
ユーザー |
|
提出日時 | 2022-11-25 22:51:58 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 345 bytes |
コンパイル時間 | 598 ms |
コンパイル使用メモリ | 66,048 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-02 05:25:12 |
合計ジャッジ時間 | 7,616 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | WA * 11 |
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main() | ^~~~
ソースコード
#include<iostream> #include<atcoder/modint> using namespace std; using mint=atcoder::modint998244353; long N,X; main() { int T;cin>>T; for(;T--;) { cin>>N>>X; N++; mint ans=0; if(X%2==0)ans=N/2; else { ans=(N/(X+3))*((X+4)/2); N%=X+3; if(N==X+2)N--; if(N==X+1)N--,ans++; ans+=N/2; } cout<<ans.val()<<"\n"; } }