#include <bits/stdc++.h>
#include "dango3.h"
using namespace std;
void dfs(vector<int> a, int m) {
if(m < 1) return;
if(m < 2) return Answer(a);
vector<int> L, R;
for(int i = size(a); i--; ) {
vector<int> q(L);
for(int j = i; j--; ) q.push_back(a[j]);
(Query(q) < m / 2 ? L : R).push_back(a[i]);
}
dfs(L, m / 2), dfs(R, m - m / 2);
}
void Solve(int N, int M) {
vector<int> a(N*M);
iota(begin(a), end(a), 1);
dfs(a, M);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
340 KB |
Output is correct |
2 |
Correct |
0 ms |
340 KB |
Output is correct |
3 |
Correct |
0 ms |
340 KB |
Output is correct |
4 |
Correct |
0 ms |
340 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
0 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
12 ms |
368 KB |
Output is correct |
2 |
Correct |
12 ms |
412 KB |
Output is correct |
3 |
Correct |
13 ms |
340 KB |
Output is correct |
4 |
Correct |
13 ms |
340 KB |
Output is correct |
5 |
Correct |
11 ms |
468 KB |
Output is correct |
6 |
Correct |
10 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
243 ms |
652 KB |
Output is correct |
2 |
Correct |
263 ms |
544 KB |
Output is correct |
3 |
Correct |
271 ms |
536 KB |
Output is correct |
4 |
Correct |
240 ms |
588 KB |
Output is correct |
5 |
Correct |
223 ms |
476 KB |
Output is correct |
6 |
Correct |
244 ms |
508 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
989 ms |
776 KB |
Output is correct |
2 |
Correct |
943 ms |
760 KB |
Output is correct |
3 |
Correct |
1066 ms |
760 KB |
Output is correct |
4 |
Correct |
1026 ms |
700 KB |
Output is correct |
5 |
Correct |
921 ms |
804 KB |
Output is correct |
6 |
Correct |
1002 ms |
568 KB |
Output is correct |