#include "dango3.h"
#include <vector>
#include <bits/stdc++.h>
#define pb push_back
#define ff first
#define ss second
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
void rec(vector<int> &v, int m){
if(m == 1){
Answer(v);
return;
}
vector<int> new_v;
int sz = v.size();
for(int i = 0; i < sz; i++){
new_v.pb(v[0]);
v.erase(v.begin());
int x = Query(v);
if(x < m/2){
v.pb(new_v.back());
new_v.pop_back();
}
}
rec(v, m/2);
rec(new_v, m - m/2);
}
void Solve(int n, int m) {
vector<int> a;
for(int i = 1; i <= n * m; i++) a.pb(i);
rec(a, m);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 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 |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
348 KB |
Output is correct |
2 |
Correct |
2 ms |
348 KB |
Output is correct |
3 |
Correct |
3 ms |
348 KB |
Output is correct |
4 |
Correct |
3 ms |
348 KB |
Output is correct |
5 |
Correct |
3 ms |
348 KB |
Output is correct |
6 |
Correct |
2 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
50 ms |
556 KB |
Output is correct |
2 |
Correct |
49 ms |
344 KB |
Output is correct |
3 |
Correct |
65 ms |
348 KB |
Output is correct |
4 |
Correct |
67 ms |
348 KB |
Output is correct |
5 |
Correct |
48 ms |
348 KB |
Output is correct |
6 |
Correct |
48 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
192 ms |
608 KB |
Output is correct |
2 |
Correct |
190 ms |
604 KB |
Output is correct |
3 |
Correct |
261 ms |
604 KB |
Output is correct |
4 |
Correct |
273 ms |
604 KB |
Output is correct |
5 |
Correct |
187 ms |
604 KB |
Output is correct |
6 |
Correct |
189 ms |
856 KB |
Output is correct |