#include "dango3.h"
#include <bits/stdc++.h>
using namespace std;
namespace{
int asa = 1;
void solve (vector <int> v, int x){
if (x == 1){
Answer(v);
return;
}
int mijl = x / 2;
vector <int> rez;
for (int i = v.size(); -- i;){
swap (v[i], v.back());
int y = v.back();
v.pop_back();
if (Query(v) < mijl)
v.push_back(y);
else
rez.push_back(y);
}
solve (v, mijl);
solve(rez, x - mijl);
}
} // namespace
void Solve (int N, int M){
vector <int> v;
for (int i = 0; i < N * M; ++ i)
v.push_back(1 + i);
solve(v, M);
}
Compilation message
dango3.cpp:8:5: warning: '{anonymous}::asa' defined but not used [-Wunused-variable]
8 | int asa = 1;
| ^~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 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 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
436 KB |
Output is correct |
2 |
Correct |
3 ms |
348 KB |
Output is correct |
3 |
Correct |
3 ms |
348 KB |
Output is correct |
4 |
Correct |
3 ms |
440 KB |
Output is correct |
5 |
Correct |
3 ms |
348 KB |
Output is correct |
6 |
Correct |
3 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
55 ms |
604 KB |
Output is correct |
2 |
Correct |
47 ms |
600 KB |
Output is correct |
3 |
Correct |
65 ms |
848 KB |
Output is correct |
4 |
Correct |
70 ms |
580 KB |
Output is correct |
5 |
Correct |
51 ms |
600 KB |
Output is correct |
6 |
Correct |
50 ms |
600 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
183 ms |
692 KB |
Output is correct |
2 |
Correct |
182 ms |
716 KB |
Output is correct |
3 |
Correct |
268 ms |
660 KB |
Output is correct |
4 |
Correct |
257 ms |
952 KB |
Output is correct |
5 |
Correct |
196 ms |
692 KB |
Output is correct |
6 |
Correct |
182 ms |
904 KB |
Output is correct |