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;
map<int,int> cnt;
int res[105];
vector<int> have[55];
void Solve(int T, int N) {
// printf("SOLVE %d %d\n",T,N);
for(int i=0;i<2*N;i++) {
cnt.clear();
res[i] = N-1;
for(int j=0;j<2*N;j++) {
if(i==j) continue;
int x = Flip(i,j);
// printf("Flip %d %d : %d\n",i,j,x);
cnt[x]++;
}
for(auto x : cnt) if(x.second%2) res[i] = x.first;
// printf("res %d: %d\n",i,res[i]);
}
for(int i=0;i<2*N;i++) have[res[i]].push_back(i);
for(int i=0;i<N;i++) Answer(have[i][0], have[i][1], i);
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... |