Submission #693253

#TimeUsernameProblemLanguageResultExecution timeMemory
693253penguin133Super Dango Maker (JOI22_dango3)C++17
7 / 100
3434 ms1012 KiB
#include <bits/stdc++.h> using namespace std; #include "dango3.h" //im suffering from pain int vis[20005], n, m; int qry(vector <int> &v){ for(int i=1;i<=m*n;i++)vis[i] = 1; for(auto i : v)vis[i] = 0; vector <int> bru; for(int i=1;i<=n*m;i++)if(vis[i])bru.push_back(i); return Query(bru); } int ok[200005]; void Solve(int N, int M) { //pain. n = N, m = M; vector <int> x; for(int i=1;i<=n*m;i++){ x.push_back(i); ok[i] = Query(x); } vector < vector <int> > ans; for(int i=n*m;i>=1;i--){ if(ok[i] != ok[i-1]){ vector <int> hi = {i}; ans.push_back(hi); } else{ sort(ans.begin(), ans.end()); for(auto &j : ans){ vector <int> tmp = j; tmp.push_back(i); if(qry(tmp) == M - 1){ j.push_back(i); break; } } } } for(auto i : ans)Answer(i); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...