#include "dango3.h"
#include <bits/stdc++.h>
#define mp make_pair
#define pb emplace_back
#define fi first
#define se second
// #define int long long
#define inf 1e18
#define ick cout<<"ickbmi32.9\n"
using namespace std;
namespace {
int variable_example = 1;
} // namespace
vector<int> dk;
vector<int> pre;
int n, m;
vector<int> sure[35];
bool har[10005];
int ask(int k, int l, int r) {
// cerr << k << ' ' << l << ' ' << r << '\n';
vector<int> t;
for(int i = 1; i <= n * m; i++) har[i] = true;
for(int x = l; x <= r; x++) {
for(auto y: sure[x]) har[y] = false;
}
har[k] = false;
for(int i = 1; i <= n * m; i++) if(har[i]) t.pb(i);
return Query(t);
}
void Solve(int N, int M) {
n = N, m = M;
for(int i = 1; i <= n * m; i++) {
int l = 0, r = m - 1;
while(l < r) {
int mid = ((l + r) >> 1);
if(ask(i, l, mid) < m - (mid - l + 1)) l = mid + 1;
else r = mid;
}
sure[l].pb(i);
}
for(int i = 0; i < m; i++) Answer(sure[i]);
// return;
// sure[n - 1] = dk;
// vector<int> ans;
// for(int i = 0; i < m; i++) {
// ans.clear();
// for(int j = 0; j < n; j++) {
// ans.pb(sure[j][i]);
// }
// Answer(ans);
// }
return;
}
Compilation message
dango3.cpp:14:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
14 | int variable_example = 1;
| ^~~~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 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 |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
1 ms |
260 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
32 ms |
380 KB |
Output is correct |
2 |
Correct |
45 ms |
368 KB |
Output is correct |
3 |
Correct |
32 ms |
380 KB |
Output is correct |
4 |
Correct |
32 ms |
340 KB |
Output is correct |
5 |
Correct |
29 ms |
368 KB |
Output is correct |
6 |
Correct |
32 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1018 ms |
572 KB |
Output is correct |
2 |
Correct |
1025 ms |
576 KB |
Output is correct |
3 |
Correct |
965 ms |
588 KB |
Output is correct |
4 |
Correct |
974 ms |
556 KB |
Output is correct |
5 |
Correct |
969 ms |
568 KB |
Output is correct |
6 |
Correct |
965 ms |
444 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3890 ms |
632 KB |
Output is correct |
2 |
Correct |
3875 ms |
772 KB |
Output is correct |
3 |
Correct |
3827 ms |
616 KB |
Output is correct |
4 |
Correct |
3801 ms |
748 KB |
Output is correct |
5 |
Correct |
3673 ms |
780 KB |
Output is correct |
6 |
Correct |
3730 ms |
748 KB |
Output is correct |