Submission #998405

#TimeUsernameProblemLanguageResultExecution timeMemory
998405efishelSuper Dango Maker (JOI22_dango3)C++17
7 / 100
537 ms604 KiB
//Código de dango3 Saul #include "dango3.h" #include <vector> #include <bits/stdc++.h> #define rep(a,b,c) for(int a=b; a<c; a++) #define pb push_back using namespace std; void Solve(int N, int M) { vector<int> C[N], ans, pos, aux; rep(i,0,N*M) pos.pb(i+1); rep(i,0,N){ rep(j,0,M){ int l=0, r=pos.size(), mid; while(l<=r){ mid=(l+r)>>1; aux.clear(); rep(i,0,mid+1) aux.pb(pos[i]); rep(k,0,i) aux.pb(C[k].back()); if(Query(aux)) r=mid-1; else l=mid+1; } C[i].pb(pos[l]); pos.erase(pos.begin()+l); } } rep(i,0,M){ ans.clear(); rep(j,0,N) ans.pb({C[j][i]}); Answer(ans); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...