# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
781113 | 2023-07-12T18:06:26 Z | aZvezda | Super Dango Maker (JOI22_dango3) | C++17 | 683 ms | 528 KB |
#include "dango3.h" #include <bits/stdc++.h> using namespace std; namespace { int variable_example = 1; } // namespace void Solve(int n, int m) { vector<int> lft = {}; for(int i = 1; i <= n * m; i ++) { lft.push_back(i); } random_shuffle(lft.begin(), lft.end()); for(int i = 0; i < m; i ++) { vector<int> now = {}; for(int j = 0; j < lft.size(); j ++) now.push_back(lft[j]); const auto rem = [&](const auto x) { for(int j = 0; j < now.size(); j ++) { if(now[j] == x) { swap(now[j], now[now.size() - 1]); now.pop_back(); return; } } }; int ptrbad = i * n; for(int j = i * n; ptrbad < (i + 1) * n; j ++) { int old = lft[j]; rem(old); int ans = Query(now); if(ans == m - 1) { swap(lft[j], lft[ptrbad]); ptrbad ++; } else { now.push_back(old); } } } for(int i = 0; i < m; i ++) { vector<int> group = {}; for(int j = 0; j < n; j ++) { group.push_back(lft[i * n + j]); } Answer(group); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 340 KB | Output is correct |
2 | Correct | 0 ms | 340 KB | Output is correct |
3 | Correct | 0 ms | 340 KB | Output is correct |
4 | Correct | 1 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 | 5 ms | 368 KB | Output is correct |
2 | Correct | 5 ms | 340 KB | Output is correct |
3 | Correct | 5 ms | 364 KB | Output is correct |
4 | Correct | 5 ms | 340 KB | Output is correct |
5 | Correct | 13 ms | 368 KB | Output is correct |
6 | Correct | 8 ms | 340 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 170 ms | 432 KB | Output is correct |
2 | Correct | 185 ms | 428 KB | Output is correct |
3 | Correct | 189 ms | 340 KB | Output is correct |
4 | Correct | 184 ms | 428 KB | Output is correct |
5 | Correct | 188 ms | 340 KB | Output is correct |
6 | Correct | 194 ms | 436 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 683 ms | 528 KB | Wrong Answer [3] |
2 | Halted | 0 ms | 0 KB | - |