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 "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 |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |