# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
520072 | 2022-01-28T09:42:23 Z | drkarlicio2107 | Minerals (JOI19_minerals) | C++14 | 1 ms | 584 KB |
#include <bits/stdc++.h> #include "minerals.h" using namespace std; vector <int> a, b; int cnt=0; int diff (int x){ int a=Query (x); if (a!=cnt){ cnt=a; return 1; } else{ cnt=a; return 0; } } int solve (vector <int> a, vector <int> b, int x){ random_shuffle (a.begin(), a.end()); random_shuffle (b.begin(), b.end()); if (a.size()==1){ Answer (a[0], b[0]); return 0; } int mid=a.size()/2; vector <int> a1, a2, b1, b2; for(int i=0; i<a.size(); i++){ if(i<mid) a1.push_back(a[i]); else a2.push_back(a[i]); if((i>=mid)^x) diff(a[i]); } for (int i=0; i<b.size(); i++){ if (b1.size()==a1.size()) b2.push_back(b[i]); else if (b2.size()==a2.size()) b1.push_back(b[i]); else if (diff (b[i])) b1.push_back(b[i]); else b2.push_back(b[i]); } solve (a1, b1, 0); solve (a2, b2, 1); } void Solve(int n){ for (int i=1; i<2*n+1; i++){ if (diff (i)) b.push_back(i); else a.push_back(i); } solve (a,b,1); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 456 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 584 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 456 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 456 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 456 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 456 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 456 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 456 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 456 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |