Submission #704903

#TimeUsernameProblemLanguageResultExecution timeMemory
704903piOOESuper Dango Maker (JOI22_dango3)C++17
22 / 100
1666 ms740 KiB
#include "dango3.h" #include <bits/stdc++.h> using namespace std; mt19937 rnd(228); void Solve(int n, int m) { const int N = n * m; vector<int> ord(N); iota(ord.begin(), ord.end(), 1); shuffle(ord.begin(), ord.end(), rnd); set<int> st; for (int x : ord) { st.insert(x); if (Query(vector(st.begin(), st.end())) == 1) { vector<int> stick{x}; vector<int> consider(st.begin(), st.end()); consider.erase(find(consider.begin(), consider.end(), x)); set<int> save; for (int y : consider) { st.erase(y); if (Query(vector(st.begin(), st.end())) == 0) { stick.push_back(y); st.insert(y); } else { save.insert(y); } } Answer(stick); swap(st, save); } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...