#include <bits/stdc++.h>
#include "dango3.h"
using namespace std;
#define ff first
#define ss second
#define pb push_back
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
//~ #define int long long
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector<pair<int,int> > vii;
/* __ __ __ */
/* ====== _ /| /| __ _ / | | /| | @ | | | | / /| |\ | / | | @ | / */
/* || |_| |_ / |/ | | | |_ |- | |--| /-| | | \ \ |==| |- /=| | \ | | |--| | |- */
/* || | | |_ / | |__| _| |_ \__ | | / | |__ | __| | | | \ / | | \| \__ | | | | \ */
/* */
vector<vi> ans;
void rec(vi v, int m){
if(m == 1){
ans.pb(v);
return;
}
vi a1, a2;
while(!v.empty()){
int res = v.back();
v.pop_back();
for(int i:a1)v.pb(i);
int x = Query(v);
int k = a1.size();
while(k--)v.pop_back();
if(x > m/2+(m&1)){
a2.pb(res);
}else{
a1.pb(res);
}
}
rec(a1, m/2+(m&1));
rec(a2, m/2);
}
void Solve(int N, int M) {
vi v;
for(int i = 0; i < N*M; i++){
v.pb(i);
}
rec(v, M);
for(auto i:ans){
Answer(i);
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Wrong Answer [1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Wrong Answer [1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Wrong Answer [1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
604 KB |
Wrong Answer [1] |
2 |
Halted |
0 ms |
0 KB |
- |