#include <bits/stdc++.h>
#include "chameleon.h"
#define MAXN 1007
using namespace std;
namespace {
int n;
vector<int> to[MAXN];
} // namespace
void Solve(int N) {
n=N;
for(int i=1;i<=2*n;i++){
for(int f=i+1;f<=2*n;f++){
if(Query({i,f})==1){
to[i].push_back(f);
to[f].push_back(i);
}
}
}
for(int i=1;i<=2*n;i++){
if(to[i].size()==1){
if(i<to[i][0])Answer(i,to[i][0]);
}else{
for(int f:to[to[i][0]]){
if(f==i and i<to[i][0])Answer(i,to[i][0]);
}
for(int f:to[to[i][1]]){
if(f==i and i<to[i][1])Answer(i,to[i][1]);
}
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
596 KB |
Output is correct |
3 |
Incorrect |
17 ms |
476 KB |
Wrong Answer [3] |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
344 KB |
Wrong Answer [6] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
344 KB |
Wrong Answer [6] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
344 KB |
Wrong Answer [6] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
596 KB |
Output is correct |
3 |
Incorrect |
17 ms |
476 KB |
Wrong Answer [3] |
4 |
Halted |
0 ms |
0 KB |
- |