이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Memory2_lib.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 100;
int T, N, ans[MAXN+10];
vector<int> t[MAXN+10];
void Solve(int _T, int _N)
{
    int i, j;
    T=_T; N=_N;
    srand(time(NULL));
    memset(ans, -1, sizeof(ans));
    int now;
    while(1)
    {
        for(i=0; i<N; i++) t[i].clear();
        now=rand()%(2*N);
        while(ans[now]!=-1) now=rand()%(2*N);
        for(i=0; i<2*N; i++)
        {
            if(i==now) continue;
            int p=Flip(i, now);
            t[p].push_back(i);
        }
        for(i=0; i<N; i++)
        {
            if(t[i].size()%2==0) for(auto it : t[i]) ans[it]=i;
            else ans[now]=i;
        }
        int cnt=0, pos;
        for(i=0; i<N*2; i++) if(ans[i]==-1) cnt++, pos=i;
        if(cnt==1) { ans[pos]=N-1; break; }
        //for(i=0; i<N*2; i++) printf("%d ", ans[i]); printf(" -> %d\n", now);
    }
    //for(i=0; i<N*2; i++) printf("%d ", ans[i]);
    for(i=0; i<N; i++)
    {
        vector<int> V;
        for(j=0; j<2*N; j++) if(ans[j]==i) V.push_back(j);
        //printf("%d %d : %d\n", V[0], V[1], i);
        Answer(V[0], V[1], i);
    }
}
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... |