This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "chameleon.h"
using namespace std;
using ll = long long;
#define MAXN (1000005)
void Solve(int N) {
vector<pair<ll,ll> > v;
bool done[2 * N];
memset(done,0,sizeof(done));
for(ll i = 0;i < 2*N;i++){
if(done[i]) continue;
for(ll j = i + 1;j < 2*N;j++){
if(done[i]) break;
if(done[j]) continue;
vector<int> p(2);
p[0] = i + 1;
p[1] = j + 1;
ll colours = Query(p);
if(colours == 1){
v.push_back({i,j});
done[i] = 1;
done[j] = 1;
break;
}
}
}
for(ll i = 0;i < N;i++){
Answer(v[i].first + 1,v[i].second + 1);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |