# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
250107 | 2020-07-17T03:09:25 Z | dwsc | Minerals (JOI19_minerals) | C++14 | 1 ms | 384 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; } random_shuffle(v1.begin(),v1.end()); random_shuffle(v2.begin(),v2.end()); int stop = v1.size()/2; vector<int> v1a,v1b,v2a,v2b; int num; for (int i = 0; i < v1.size(); i++){ if (i < stop){ v1a.push_back(v1[i]); } else{ num = Query(v1[i]); v1b.push_back(v1[i]); } } for (int i = 0; i < v2.size(); i++){ if (v2a.size() == stop){ v2b.push_back(v2[i]); continue; } if (v2b.size() == v2.size()-stop){ v2a.push_back(v2[i]); continue; } if (Query(v2[i]) == num){ v2a.push_back(v2[i]); } else { num--; v2b.push_back(v2[i]); } } for (int i = 0; i < v1a.size(); i++) Query(v2a[i]); for (int i = 0; i < v1b.size(); i++){ Query(v1b[i]); Query(v2b[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{ v2.push_back(i); } } solve(v1,v2); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 384 KB | Output is correct |
2 | Incorrect | 0 ms | 384 KB | Wrong Answer [5] |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 384 KB | Wrong Answer [5] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 384 KB | Output is correct |
2 | Incorrect | 0 ms | 384 KB | Wrong Answer [5] |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 384 KB | Output is correct |
2 | Incorrect | 0 ms | 384 KB | Wrong Answer [5] |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 384 KB | Output is correct |
2 | Incorrect | 0 ms | 384 KB | Wrong Answer [5] |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 384 KB | Output is correct |
2 | Incorrect | 0 ms | 384 KB | Wrong Answer [5] |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 384 KB | Output is correct |
2 | Incorrect | 0 ms | 384 KB | Wrong Answer [5] |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 384 KB | Output is correct |
2 | Incorrect | 0 ms | 384 KB | Wrong Answer [5] |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 384 KB | Output is correct |
2 | Incorrect | 0 ms | 384 KB | Wrong Answer [5] |
3 | Halted | 0 ms | 0 KB | - |