//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);
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
600 KB |
Output is correct |
2 |
Correct |
0 ms |
600 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
11 ms |
348 KB |
Output is correct |
2 |
Correct |
9 ms |
348 KB |
Output is correct |
3 |
Correct |
12 ms |
500 KB |
Output is correct |
4 |
Correct |
12 ms |
348 KB |
Output is correct |
5 |
Correct |
8 ms |
348 KB |
Output is correct |
6 |
Correct |
10 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
198 ms |
584 KB |
Wrong Answer [3] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
537 ms |
604 KB |
Wrong Answer [3] |
2 |
Halted |
0 ms |
0 KB |
- |