이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//Código de dango3 Saul
#include "dango3.h"
#include <vector>
#include <bits/stdc++.h>
#define rep(a,b,c) for(int a=b; a<c; a++)
#define pb push_back
using namespace std;
void Solve(int N, int M) {
vector<int> C[N], ans, pos, aux;
rep(i,0,N*M) pos.pb(i+1);
rep(i,0,N){
rep(j,0,M){
int l=0, r=pos.size(), mid;
while(l<=r){
mid=(l+r)>>1;
aux.clear();
rep(i,0,mid+1) aux.pb(pos[i]);
rep(k,0,i) aux.pb(C[k].back());
if(Query(aux)) r=mid-1;
else l=mid+1;
}
C[i].pb(pos[l]);
pos.erase(pos.begin()+l);
}
}
rep(i,0,M){
ans.clear();
rep(j,0,N) ans.pb({C[j][i]});
Answer(ans);
}
}
# | 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... |