# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
250097 | 2020-07-17T02:29:27 Z | dwsc | Minerals (JOI19_minerals) | C++14 | 40 ms | 3248 KB |
#include "minerals.h" #include <bits/stdc++.h> using namespace std; void solve(vector<int> v1,vector<int> v2){ if (v1.size() == 1){ Answer(v1[0],v2[0]); return; } //cout << v1.size() << " " << v2.size() << "\n"; int stop = v1.size()/2; vector<int> v1a,v1b,v2a,v2b; for (int i = 0; i < v1.size(); i++){ if (i < stop){ Query(v1[i]); v1a.push_back(v1[i]); } else{ v1b.push_back(v1[i]); } } int num = stop; for (int i = 0; i < v2.size(); i++){ if (Query(v2[i]) > num){ v2b.push_back(v2[i]); } else v2a.push_back(v2[i]); Query(v2[i]); } for (int i = 0; i < v1a.size(); i++) Query(v1a[i]); solve(v1a,v2a); solve(v1b,v2b); } void Solve(int N) { vector<int> v1,v2; int num = 0; for (int i = 1; i <= 2*N; i++){ int temp = Query(i); if (temp > num){ num++; v1.push_back(i); } else{ Query(i); v2.push_back(i); } } for (int i = 0; i < v1.size(); i++) Query(v1[i]); solve(v1,v2); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 384 KB | Output is correct |
2 | Correct | 0 ms | 384 KB | Output is correct |
3 | Correct | 0 ms | 384 KB | Output is correct |
4 | Correct | 1 ms | 384 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 384 KB | Output is correct |
2 | Correct | 3 ms | 512 KB | Output is correct |
3 | Correct | 6 ms | 640 KB | Output is correct |
4 | Correct | 11 ms | 896 KB | Output is correct |
5 | Correct | 21 ms | 1356 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 384 KB | Output is correct |
2 | Correct | 0 ms | 384 KB | Output is correct |
3 | Correct | 0 ms | 384 KB | Output is correct |
4 | Correct | 1 ms | 384 KB | Output is correct |
5 | Correct | 2 ms | 384 KB | Output is correct |
6 | Correct | 3 ms | 512 KB | Output is correct |
7 | Correct | 6 ms | 640 KB | Output is correct |
8 | Correct | 11 ms | 896 KB | Output is correct |
9 | Correct | 21 ms | 1356 KB | Output is correct |
10 | Correct | 2 ms | 384 KB | Output is correct |
11 | Correct | 15 ms | 1152 KB | Output is correct |
12 | Correct | 23 ms | 1452 KB | Output is correct |
13 | Correct | 19 ms | 1460 KB | Output is correct |
14 | Correct | 19 ms | 1324 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 384 KB | Output is correct |
2 | Correct | 0 ms | 384 KB | Output is correct |
3 | Correct | 0 ms | 384 KB | Output is correct |
4 | Correct | 1 ms | 384 KB | Output is correct |
5 | Correct | 2 ms | 384 KB | Output is correct |
6 | Correct | 3 ms | 512 KB | Output is correct |
7 | Correct | 6 ms | 640 KB | Output is correct |
8 | Correct | 11 ms | 896 KB | Output is correct |
9 | Correct | 21 ms | 1356 KB | Output is correct |
10 | Correct | 2 ms | 384 KB | Output is correct |
11 | Correct | 15 ms | 1152 KB | Output is correct |
12 | Correct | 23 ms | 1452 KB | Output is correct |
13 | Correct | 19 ms | 1460 KB | Output is correct |
14 | Correct | 19 ms | 1324 KB | Output is correct |
15 | Incorrect | 40 ms | 3248 KB | Wrong Answer [2] |
16 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 384 KB | Output is correct |
2 | Correct | 0 ms | 384 KB | Output is correct |
3 | Correct | 0 ms | 384 KB | Output is correct |
4 | Correct | 1 ms | 384 KB | Output is correct |
5 | Correct | 2 ms | 384 KB | Output is correct |
6 | Correct | 3 ms | 512 KB | Output is correct |
7 | Correct | 6 ms | 640 KB | Output is correct |
8 | Correct | 11 ms | 896 KB | Output is correct |
9 | Correct | 21 ms | 1356 KB | Output is correct |
10 | Correct | 2 ms | 384 KB | Output is correct |
11 | Correct | 15 ms | 1152 KB | Output is correct |
12 | Correct | 23 ms | 1452 KB | Output is correct |
13 | Correct | 19 ms | 1460 KB | Output is correct |
14 | Correct | 19 ms | 1324 KB | Output is correct |
15 | Incorrect | 40 ms | 3248 KB | Wrong Answer [2] |
16 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 384 KB | Output is correct |
2 | Correct | 0 ms | 384 KB | Output is correct |
3 | Correct | 0 ms | 384 KB | Output is correct |
4 | Correct | 1 ms | 384 KB | Output is correct |
5 | Correct | 2 ms | 384 KB | Output is correct |
6 | Correct | 3 ms | 512 KB | Output is correct |
7 | Correct | 6 ms | 640 KB | Output is correct |
8 | Correct | 11 ms | 896 KB | Output is correct |
9 | Correct | 21 ms | 1356 KB | Output is correct |
10 | Correct | 2 ms | 384 KB | Output is correct |
11 | Correct | 15 ms | 1152 KB | Output is correct |
12 | Correct | 23 ms | 1452 KB | Output is correct |
13 | Correct | 19 ms | 1460 KB | Output is correct |
14 | Correct | 19 ms | 1324 KB | Output is correct |
15 | Incorrect | 40 ms | 3248 KB | Wrong Answer [2] |
16 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 384 KB | Output is correct |
2 | Correct | 0 ms | 384 KB | Output is correct |
3 | Correct | 0 ms | 384 KB | Output is correct |
4 | Correct | 1 ms | 384 KB | Output is correct |
5 | Correct | 2 ms | 384 KB | Output is correct |
6 | Correct | 3 ms | 512 KB | Output is correct |
7 | Correct | 6 ms | 640 KB | Output is correct |
8 | Correct | 11 ms | 896 KB | Output is correct |
9 | Correct | 21 ms | 1356 KB | Output is correct |
10 | Correct | 2 ms | 384 KB | Output is correct |
11 | Correct | 15 ms | 1152 KB | Output is correct |
12 | Correct | 23 ms | 1452 KB | Output is correct |
13 | Correct | 19 ms | 1460 KB | Output is correct |
14 | Correct | 19 ms | 1324 KB | Output is correct |
15 | Incorrect | 40 ms | 3248 KB | Wrong Answer [2] |
16 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 384 KB | Output is correct |
2 | Correct | 0 ms | 384 KB | Output is correct |
3 | Correct | 0 ms | 384 KB | Output is correct |
4 | Correct | 1 ms | 384 KB | Output is correct |
5 | Correct | 2 ms | 384 KB | Output is correct |
6 | Correct | 3 ms | 512 KB | Output is correct |
7 | Correct | 6 ms | 640 KB | Output is correct |
8 | Correct | 11 ms | 896 KB | Output is correct |
9 | Correct | 21 ms | 1356 KB | Output is correct |
10 | Correct | 2 ms | 384 KB | Output is correct |
11 | Correct | 15 ms | 1152 KB | Output is correct |
12 | Correct | 23 ms | 1452 KB | Output is correct |
13 | Correct | 19 ms | 1460 KB | Output is correct |
14 | Correct | 19 ms | 1324 KB | Output is correct |
15 | Incorrect | 40 ms | 3248 KB | Wrong Answer [2] |
16 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 384 KB | Output is correct |
2 | Correct | 0 ms | 384 KB | Output is correct |
3 | Correct | 0 ms | 384 KB | Output is correct |
4 | Correct | 1 ms | 384 KB | Output is correct |
5 | Correct | 2 ms | 384 KB | Output is correct |
6 | Correct | 3 ms | 512 KB | Output is correct |
7 | Correct | 6 ms | 640 KB | Output is correct |
8 | Correct | 11 ms | 896 KB | Output is correct |
9 | Correct | 21 ms | 1356 KB | Output is correct |
10 | Correct | 2 ms | 384 KB | Output is correct |
11 | Correct | 15 ms | 1152 KB | Output is correct |
12 | Correct | 23 ms | 1452 KB | Output is correct |
13 | Correct | 19 ms | 1460 KB | Output is correct |
14 | Correct | 19 ms | 1324 KB | Output is correct |
15 | Incorrect | 40 ms | 3248 KB | Wrong Answer [2] |
16 | Halted | 0 ms | 0 KB | - |