# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
836142 | 2023-08-24T07:56:22 Z | unnick | Minerals (JOI19_minerals) | C++14 | 13 ms | 1744 KB |
#include "minerals.h" #include <vector> using namespace std; void Solve(int N) { vector<int> fst; vector<int> snd; int prev = 0; for (int i = 1; i <= N*2; i++) { int tmp = Query(i); if (tmp > prev) fst.push_back(i); prev = tmp; } for (int i = 1; i <= N*2; i++) { int tmp = Query(i); if (tmp < prev) snd.push_back(i); prev = tmp; } int baseline; for (int i = 0; i < N; i++) { if (i&1) baseline = Query(fst[i]); } vector<int> ids(N, 0); for (int pd = 1; pd < N; pd <<= 1) { if (pd > 1) { for (int i = 0; i < N; i++) { if ((i&pd) ^ ((i<<1)&pd)) baseline = Query(fst[i]); } } for (int i = 0; i < N; i++) { int bit = !(Query(snd[i]) - baseline); ids[i] += bit * pd; Query(snd[i]); } } for (int i = 0; i < N; i++) { Answer(fst[ids[i]], snd[i]); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 208 KB | Output is correct |
2 | Correct | 0 ms | 208 KB | Output is correct |
3 | Correct | 1 ms | 260 KB | Output is correct |
4 | Correct | 0 ms | 208 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 336 KB | Output is correct |
2 | Correct | 1 ms | 336 KB | Output is correct |
3 | Correct | 2 ms | 464 KB | Output is correct |
4 | Correct | 4 ms | 592 KB | Output is correct |
5 | Correct | 6 ms | 848 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 208 KB | Output is correct |
2 | Correct | 0 ms | 208 KB | Output is correct |
3 | Correct | 1 ms | 260 KB | Output is correct |
4 | Correct | 0 ms | 208 KB | Output is correct |
5 | Correct | 1 ms | 336 KB | Output is correct |
6 | Correct | 1 ms | 336 KB | Output is correct |
7 | Correct | 2 ms | 464 KB | Output is correct |
8 | Correct | 4 ms | 592 KB | Output is correct |
9 | Correct | 6 ms | 848 KB | Output is correct |
10 | Correct | 1 ms | 336 KB | Output is correct |
11 | Correct | 4 ms | 720 KB | Output is correct |
12 | Correct | 7 ms | 840 KB | Output is correct |
13 | Correct | 5 ms | 848 KB | Output is correct |
14 | Correct | 5 ms | 848 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 208 KB | Output is correct |
2 | Correct | 0 ms | 208 KB | Output is correct |
3 | Correct | 1 ms | 260 KB | Output is correct |
4 | Correct | 0 ms | 208 KB | Output is correct |
5 | Correct | 1 ms | 336 KB | Output is correct |
6 | Correct | 1 ms | 336 KB | Output is correct |
7 | Correct | 2 ms | 464 KB | Output is correct |
8 | Correct | 4 ms | 592 KB | Output is correct |
9 | Correct | 6 ms | 848 KB | Output is correct |
10 | Correct | 1 ms | 336 KB | Output is correct |
11 | Correct | 4 ms | 720 KB | Output is correct |
12 | Correct | 7 ms | 840 KB | Output is correct |
13 | Correct | 5 ms | 848 KB | Output is correct |
14 | Correct | 5 ms | 848 KB | Output is correct |
15 | Incorrect | 13 ms | 1744 KB | Wrong Answer [2] |
16 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 208 KB | Output is correct |
2 | Correct | 0 ms | 208 KB | Output is correct |
3 | Correct | 1 ms | 260 KB | Output is correct |
4 | Correct | 0 ms | 208 KB | Output is correct |
5 | Correct | 1 ms | 336 KB | Output is correct |
6 | Correct | 1 ms | 336 KB | Output is correct |
7 | Correct | 2 ms | 464 KB | Output is correct |
8 | Correct | 4 ms | 592 KB | Output is correct |
9 | Correct | 6 ms | 848 KB | Output is correct |
10 | Correct | 1 ms | 336 KB | Output is correct |
11 | Correct | 4 ms | 720 KB | Output is correct |
12 | Correct | 7 ms | 840 KB | Output is correct |
13 | Correct | 5 ms | 848 KB | Output is correct |
14 | Correct | 5 ms | 848 KB | Output is correct |
15 | Incorrect | 13 ms | 1744 KB | Wrong Answer [2] |
16 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 208 KB | Output is correct |
2 | Correct | 0 ms | 208 KB | Output is correct |
3 | Correct | 1 ms | 260 KB | Output is correct |
4 | Correct | 0 ms | 208 KB | Output is correct |
5 | Correct | 1 ms | 336 KB | Output is correct |
6 | Correct | 1 ms | 336 KB | Output is correct |
7 | Correct | 2 ms | 464 KB | Output is correct |
8 | Correct | 4 ms | 592 KB | Output is correct |
9 | Correct | 6 ms | 848 KB | Output is correct |
10 | Correct | 1 ms | 336 KB | Output is correct |
11 | Correct | 4 ms | 720 KB | Output is correct |
12 | Correct | 7 ms | 840 KB | Output is correct |
13 | Correct | 5 ms | 848 KB | Output is correct |
14 | Correct | 5 ms | 848 KB | Output is correct |
15 | Incorrect | 13 ms | 1744 KB | Wrong Answer [2] |
16 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 208 KB | Output is correct |
2 | Correct | 0 ms | 208 KB | Output is correct |
3 | Correct | 1 ms | 260 KB | Output is correct |
4 | Correct | 0 ms | 208 KB | Output is correct |
5 | Correct | 1 ms | 336 KB | Output is correct |
6 | Correct | 1 ms | 336 KB | Output is correct |
7 | Correct | 2 ms | 464 KB | Output is correct |
8 | Correct | 4 ms | 592 KB | Output is correct |
9 | Correct | 6 ms | 848 KB | Output is correct |
10 | Correct | 1 ms | 336 KB | Output is correct |
11 | Correct | 4 ms | 720 KB | Output is correct |
12 | Correct | 7 ms | 840 KB | Output is correct |
13 | Correct | 5 ms | 848 KB | Output is correct |
14 | Correct | 5 ms | 848 KB | Output is correct |
15 | Incorrect | 13 ms | 1744 KB | Wrong Answer [2] |
16 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 208 KB | Output is correct |
2 | Correct | 0 ms | 208 KB | Output is correct |
3 | Correct | 1 ms | 260 KB | Output is correct |
4 | Correct | 0 ms | 208 KB | Output is correct |
5 | Correct | 1 ms | 336 KB | Output is correct |
6 | Correct | 1 ms | 336 KB | Output is correct |
7 | Correct | 2 ms | 464 KB | Output is correct |
8 | Correct | 4 ms | 592 KB | Output is correct |
9 | Correct | 6 ms | 848 KB | Output is correct |
10 | Correct | 1 ms | 336 KB | Output is correct |
11 | Correct | 4 ms | 720 KB | Output is correct |
12 | Correct | 7 ms | 840 KB | Output is correct |
13 | Correct | 5 ms | 848 KB | Output is correct |
14 | Correct | 5 ms | 848 KB | Output is correct |
15 | Incorrect | 13 ms | 1744 KB | Wrong Answer [2] |
16 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 208 KB | Output is correct |
2 | Correct | 0 ms | 208 KB | Output is correct |
3 | Correct | 1 ms | 260 KB | Output is correct |
4 | Correct | 0 ms | 208 KB | Output is correct |
5 | Correct | 1 ms | 336 KB | Output is correct |
6 | Correct | 1 ms | 336 KB | Output is correct |
7 | Correct | 2 ms | 464 KB | Output is correct |
8 | Correct | 4 ms | 592 KB | Output is correct |
9 | Correct | 6 ms | 848 KB | Output is correct |
10 | Correct | 1 ms | 336 KB | Output is correct |
11 | Correct | 4 ms | 720 KB | Output is correct |
12 | Correct | 7 ms | 840 KB | Output is correct |
13 | Correct | 5 ms | 848 KB | Output is correct |
14 | Correct | 5 ms | 848 KB | Output is correct |
15 | Incorrect | 13 ms | 1744 KB | Wrong Answer [2] |
16 | Halted | 0 ms | 0 KB | - |