#include "dango3.h"
#include <bits/stdc++.h>
using namespace std;
mt19937 rnd(228);
void Solve(int n, int m) {
const int N = n * m;
vector<int> ord(N);
iota(ord.begin(), ord.end(), 1);
shuffle(ord.begin(), ord.end(), rnd);
set<int> st;
for (int x : ord) {
st.insert(x);
if (Query(vector(st.begin(), st.end())) == 1) {
vector<int> stick{x};
vector<int> consider(st.begin(), st.end());
consider.erase(find(consider.begin(), consider.end(), x));
set<int> save;
for (int y : consider) {
st.erase(y);
if (Query(vector(st.begin(), st.end())) == 0) {
stick.push_back(y);
st.insert(y);
} else {
save.insert(y);
}
}
Answer(stick);
swap(st, save);
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
304 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
308 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
1 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
17 ms |
424 KB |
Output is correct |
2 |
Correct |
16 ms |
424 KB |
Output is correct |
3 |
Correct |
16 ms |
460 KB |
Output is correct |
4 |
Correct |
18 ms |
416 KB |
Output is correct |
5 |
Correct |
22 ms |
340 KB |
Output is correct |
6 |
Correct |
22 ms |
312 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
494 ms |
512 KB |
Output is correct |
2 |
Correct |
556 ms |
520 KB |
Output is correct |
3 |
Correct |
475 ms |
516 KB |
Output is correct |
4 |
Correct |
481 ms |
592 KB |
Output is correct |
5 |
Correct |
450 ms |
516 KB |
Output is correct |
6 |
Correct |
434 ms |
624 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1666 ms |
740 KB |
Wrong Answer [3] |
2 |
Halted |
0 ms |
0 KB |
- |