#include "Memory2_lib.h"
#include <bits/stdc++.h>
using namespace std;
namespace{
	
}
void Solve(int T, int N){
	vector<int> answer(2 * N);
	for(int i = 0; i < 2 * N; ++i){
		int mx = 0;
		for(int j = 0; j < 2 * N; ++j) if(i != j){
			mx = max(mx, Flip(i, j));
		}
		answer[i] = mx;
	}
	vector<pair<int, int>> position(N, make_pair(-1, -1));
	for(int i = 0; i < 2 * N; ++i){
		if(position[answer[i]].first == -1) position[answer[i]].first = i;
		else position[answer[i]].second = i;
	}
	for(int i = 0; i < N; ++i){
		Answer(position[i].first, position[i].second, 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... |