#include "dango3.h"
//Emmanuel B
//dango
#include <bits/stdc++.h>
using namespace std;
using lli=int;
#define pb push_back
#define deb(x) cout<<#x<<": "<<x<<endl;
#define deb2(x,y) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<endl;
void Solve(int N, int M) {
vector<bool> visited (N*M+5,0);
vector<vector<lli>> ans;
for(lli xd=1; xd<=N*M; ++xd){
if(visited[xd]) continue;
ans.pb({xd});
lli last=xd;
for(lli i=1; i<=N*M; ++i){
if(visited[i]) continue;
vector<int> x;
for(int j=1; j<=N*M; ++j){
if(j==last || j==i) continue;
x.pb(j);
}
int a=Query(x);
if(a!=M-1){
ans[ans.size()-1].pb(i);
visited[i]=true;
}
}
}
for(lli i=0; i<M; ++i){
vector<lli> x;
for(lli j=0; j<N; ++j){
x.pb(ans[j][i]);
}
Answer(x);
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
149 ms |
504 KB |
Wrong Answer [3] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1140 ms |
568 KB |
Wrong Answer [3] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2413 ms |
604 KB |
Wrong Answer [3] |
2 |
Halted |
0 ms |
0 KB |
- |