#include "Memory2_lib.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void Solve(int T, int N){
vector <vector<ll>> num(N);
vector <vector<ll>> d(N*2,vector<ll>(N*2));
vector <bool> visited(N*2,false);
for (int x=0;x<N*2;x++){
for (int next=0;next<N*2;next++){
if (x == next) continue;
d[x][next] = Flip(x,next);
}
}
for (int i=N-1;i>-1;i--){
vector <ll> arr;
bool ok = true;
for (int z=0;z<N*2 && ok;z++){
if (visited[z]) continue;
for (int x=0;x<N*2 && ok;x++){
if (visited[x]) continue;
if (z == x) continue;
if (d[z][x] == i){
arr.push_back(z);
arr.push_back(x);
visited[z] = true;
visited[x] = true;
ok = false;
}
}
}
Answer(arr[0],arr[1],i);
}
return;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
384 KB |
Output is correct |
2 |
Correct |
3 ms |
384 KB |
Output is correct |
3 |
Correct |
4 ms |
384 KB |
Output is correct |
4 |
Correct |
2 ms |
384 KB |
Output is correct |
5 |
Correct |
2 ms |
384 KB |
Output is correct |
6 |
Correct |
2 ms |
384 KB |
Output is correct |
7 |
Correct |
3 ms |
432 KB |
Output is correct |
8 |
Correct |
3 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
384 KB |
Wrong Answer[2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
Wrong Answer[2] |
2 |
Halted |
0 ms |
0 KB |
- |