Submission #973531

#TimeUsernameProblemLanguageResultExecution timeMemory
973531happy_nodeSuper Dango Maker (JOI22_dango3)C++17
7 / 100
1661 ms584 KiB
#include "dango3.h" #include <bits/stdc++.h> using namespace std; const int MX=400*25+5; bool used[MX], onstk[MX]; int N,M; int ask(int l, int r) { vector<int> qry; for(int i=l;i<=r;i++) { if(used[i]||onstk[i]) continue; qry.push_back(i); } for(int i=1;i<=N*M;i++) { if(onstk[i]) qry.push_back(i); } return Query(qry); } void Solve(int NN, int MM) { N=NN, M=MM; for(int i=1;i<=M;i++) { vector<int> v; int lst=N*M; for(int j=1;j<=N;j++) { int l=1,r=lst,res=0; while(l<=r) { int mid=(l+r)/2; if(ask(1,mid)>=1) { res=mid,r=mid-1; } else { l=mid+1; } } v.push_back(res); onstk[res]=true; lst=res-1; } Answer(v); for(auto x:v) { onstk[x]=false; used[x]=true; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...