#include "bits/stdc++.h"
#include "minerals.h"
using namespace std;
void Solve(int N) {
srand(time(NULL));
vector <bool> taken(2*N+1);
vector <int> ord(2*N+1);
iota(ord.begin() ,ord.end() ,0);
random_shuffle(ord.begin()+1 ,ord.end());
for(int i=1; i<=2*N; i++) if(!taken[ord[i]]){
Query(ord[i]);
for(int j=i+1; j<=2*N; j++) if(!taken[ord[j]]){
int x = Query(ord[j]);
if(x == 1){
Answer(ord[i] ,ord[j]);
taken[ord[i]] = taken[ord[j]] = 1;
Query(ord[j]);
break;
}
Query(ord[j]);
}
Query(ord[i]);
}
}
# |
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 |
13 ms |
376 KB |
Output is correct |
2 |
Incorrect |
13 ms |
376 KB |
Wrong Answer [2] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
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 |
13 ms |
376 KB |
Output is correct |
6 |
Incorrect |
13 ms |
376 KB |
Wrong Answer [2] |
7 |
Halted |
0 ms |
0 KB |
- |
# |
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 |
13 ms |
376 KB |
Output is correct |
6 |
Incorrect |
13 ms |
376 KB |
Wrong Answer [2] |
7 |
Halted |
0 ms |
0 KB |
- |
# |
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 |
13 ms |
376 KB |
Output is correct |
6 |
Incorrect |
13 ms |
376 KB |
Wrong Answer [2] |
7 |
Halted |
0 ms |
0 KB |
- |
# |
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 |
13 ms |
376 KB |
Output is correct |
6 |
Incorrect |
13 ms |
376 KB |
Wrong Answer [2] |
7 |
Halted |
0 ms |
0 KB |
- |
# |
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 |
13 ms |
376 KB |
Output is correct |
6 |
Incorrect |
13 ms |
376 KB |
Wrong Answer [2] |
7 |
Halted |
0 ms |
0 KB |
- |
# |
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 |
13 ms |
376 KB |
Output is correct |
6 |
Incorrect |
13 ms |
376 KB |
Wrong Answer [2] |
7 |
Halted |
0 ms |
0 KB |
- |
# |
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 |
13 ms |
376 KB |
Output is correct |
6 |
Incorrect |
13 ms |
376 KB |
Wrong Answer [2] |
7 |
Halted |
0 ms |
0 KB |
- |