結果
問題 |
No.2828 Remainder Game
|
ユーザー |
|
提出日時 | 2024-08-02 21:26:15 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 531 bytes |
コンパイル時間 | 735 ms |
コンパイル使用メモリ | 69,928 KB |
実行使用メモリ | 25,452 KB |
平均クエリ数 | 219.80 |
最終ジャッジ日時 | 2024-08-02 21:26:19 |
合計ジャッジ時間 | 3,944 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 7 WA * 13 |
ソースコード
#include<iostream> #include<vector> #include<cassert> using namespace std; int solve(int L,int R,int cnt) { if(cnt==0)return 0; if(L+1==R)return L*cnt; int mid=(L+R)/2; vector<int>r; for(int k=L;k<mid;k++)r.push_back(k); cout<<10000<<" "<<r.size()<<"\n"; for(int i=0;i<r.size();i++)cout<<r[i]<<(i+1==r.size()?"":" "); cout<<endl; int c;cin>>c; return solve(L,mid,c)+solve(mid,R,cnt-c); } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N; cin>>N; int ans=solve(1,N+1,5); cout<<"0 1\n"<<ans<<endl; }