# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
704909 | 2023-03-03T06:40:03 Z | piOOE | Super Dango Maker (JOI22_dango3) | C++17 | 1351 ms | 928 KB |
#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; while (!ord.empty()) { 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 (stick.size() < n && Query(vector(st.begin(), st.end())) == 0) { stick.push_back(y); st.insert(y); } else { save.insert(y); } } Answer(stick); vector<int> nxt; for (int z : ord) { if (!st.count(z)) { nxt.push_back(z); } } swap(ord, nxt); shuffle(ord.begin(), ord.end(), rnd); st.clear(); break; } } } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 340 KB | Output is correct |
2 | Correct | 0 ms | 340 KB | Output is correct |
3 | Correct | 1 ms | 340 KB | Output is correct |
4 | Correct | 0 ms | 340 KB | Output is correct |
5 | Correct | 0 ms | 340 KB | Output is correct |
6 | Correct | 0 ms | 340 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 23 ms | 340 KB | Output is correct |
2 | Correct | 21 ms | 340 KB | Output is correct |
3 | Correct | 20 ms | 428 KB | Output is correct |
4 | Correct | 20 ms | 424 KB | Output is correct |
5 | Correct | 27 ms | 424 KB | Output is correct |
6 | Correct | 25 ms | 340 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 350 ms | 532 KB | Output is correct |
2 | Correct | 469 ms | 588 KB | Output is correct |
3 | Correct | 381 ms | 540 KB | Output is correct |
4 | Correct | 456 ms | 588 KB | Output is correct |
5 | Correct | 440 ms | 656 KB | Output is correct |
6 | Correct | 468 ms | 520 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1351 ms | 928 KB | Wrong Answer [3] |
2 | Halted | 0 ms | 0 KB | - |