# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
156813 | 2019-10-07T14:45:53 Z | popovicirobert | Minerals (JOI19_minerals) | C++14 | 18 ms | 692 KB |
#include "minerals.h" #include <bits/stdc++.h> using namespace std; void Solve(int n) { vector <int> sol(2 * n); vector <bool> in(2 * n); int i; for(int bit = 0; (1 << bit) < 2 * n; bit++) { int ans; for(i = 0; i < 2 * n; i++) { if(i & (1 << bit)) { if(in[i]) continue; ans = Query(i + 1); in[i] = 1; } } for(i = 0; i < 2 * n; i++) { if(Query(i + 1) == ans) { sol[i] += (1 << bit); } Query(i + 1); } for(i = 0; i < 2 * n; i++) { if(i & (1 << bit)) { if(i & (1 << (bit + 1))) continue; Query(i + 1); in[i] = 0; } } } vector <bool> vis(2 * n); for(i = 0; i < 2 * n; i++) { if(vis[i] == 0) { vis[i] = vis[sol[i]] = 1; Answer(i + 1, sol[i] + 1); } } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 248 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 376 KB | Output is correct |
2 | Correct | 4 ms | 376 KB | Output is correct |
3 | Correct | 6 ms | 376 KB | Output is correct |
4 | Correct | 11 ms | 504 KB | Output is correct |
5 | Incorrect | 18 ms | 692 KB | Wrong Answer [2] |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 248 KB | Output is correct |
5 | Correct | 3 ms | 376 KB | Output is correct |
6 | Correct | 4 ms | 376 KB | Output is correct |
7 | Correct | 6 ms | 376 KB | Output is correct |
8 | Correct | 11 ms | 504 KB | Output is correct |
9 | Incorrect | 18 ms | 692 KB | Wrong Answer [2] |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 248 KB | Output is correct |
5 | Correct | 3 ms | 376 KB | Output is correct |
6 | Correct | 4 ms | 376 KB | Output is correct |
7 | Correct | 6 ms | 376 KB | Output is correct |
8 | Correct | 11 ms | 504 KB | Output is correct |
9 | Incorrect | 18 ms | 692 KB | Wrong Answer [2] |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 248 KB | Output is correct |
5 | Correct | 3 ms | 376 KB | Output is correct |
6 | Correct | 4 ms | 376 KB | Output is correct |
7 | Correct | 6 ms | 376 KB | Output is correct |
8 | Correct | 11 ms | 504 KB | Output is correct |
9 | Incorrect | 18 ms | 692 KB | Wrong Answer [2] |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 248 KB | Output is correct |
5 | Correct | 3 ms | 376 KB | Output is correct |
6 | Correct | 4 ms | 376 KB | Output is correct |
7 | Correct | 6 ms | 376 KB | Output is correct |
8 | Correct | 11 ms | 504 KB | Output is correct |
9 | Incorrect | 18 ms | 692 KB | Wrong Answer [2] |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 248 KB | Output is correct |
5 | Correct | 3 ms | 376 KB | Output is correct |
6 | Correct | 4 ms | 376 KB | Output is correct |
7 | Correct | 6 ms | 376 KB | Output is correct |
8 | Correct | 11 ms | 504 KB | Output is correct |
9 | Incorrect | 18 ms | 692 KB | Wrong Answer [2] |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 248 KB | Output is correct |
5 | Correct | 3 ms | 376 KB | Output is correct |
6 | Correct | 4 ms | 376 KB | Output is correct |
7 | Correct | 6 ms | 376 KB | Output is correct |
8 | Correct | 11 ms | 504 KB | Output is correct |
9 | Incorrect | 18 ms | 692 KB | Wrong Answer [2] |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 248 KB | Output is correct |
5 | Correct | 3 ms | 376 KB | Output is correct |
6 | Correct | 4 ms | 376 KB | Output is correct |
7 | Correct | 6 ms | 376 KB | Output is correct |
8 | Correct | 11 ms | 504 KB | Output is correct |
9 | Incorrect | 18 ms | 692 KB | Wrong Answer [2] |