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 "Memory2_lib.h"
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
void Solve(int T, int N){
N *= 2;
int pos[2] = {0, 1};
int pval = Flip(pos[0], pos[1]);
for(int i = 2; i < N; ++i){
int val[2] = {Flip(pos[0], i), Flip(pos[1], i)};
if(val[0] == val[1]){
continue;
}
if(pval == val[0]){
pos[0] = i; pval = val[1];
}
else{
pos[1] = i; pval = val[0];
}
}
int ans[104];
ans[pos[0]] = ans[pos[1]] = pval;
for(int i = 0; i < N; ++i){
if(i == pos[0] || i == pos[1]){
continue;
}
ans[i] = Flip(i, pos[0]);
}
for(int i = 0; i < N; ++i){
if(ans[i] == -1){
continue;
}
for(int j = i + 1; j < N; ++j){
if(ans[i] == ans[j]){
Answer(i, j, ans[i]);
ans[j] = -1;
break;
}
}
}
return;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |