#include "dango3.h"
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
bool f[400*25 + 5];
vector <int> v[30];
void Solve(int N, int M) {
vector<int> x;
for (int i = 1; i <= N*M; i++){
int l = 1,r = M,res;
while (l <= r){
int mid = (l + r)>>1;
vector <int> f(N*M + 1,1);
for (int j = 1; j <= mid; j++){
for (int x: v[j]) {
f[x] = 0;
}
}
f[i] = 0;
vector <int> vec;
for (int j = 1; j <= N*M; j++)
if (f[j]) vec.pb(j);
int ans = Query(vec);
if (M - ans > mid) {
l = mid + 1;
}else{
r = mid - 1;
res = mid;
}
}
v[res].pb(i);
}
for (int j = 1; j <= M; j++){
Answer(v[j]);
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
0 ms |
340 KB |
Output is correct |
5 |
Correct |
1 ms |
300 KB |
Output is correct |
6 |
Correct |
1 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
18 ms |
468 KB |
Output is correct |
2 |
Correct |
16 ms |
376 KB |
Output is correct |
3 |
Correct |
16 ms |
384 KB |
Output is correct |
4 |
Correct |
17 ms |
384 KB |
Output is correct |
5 |
Correct |
15 ms |
304 KB |
Output is correct |
6 |
Correct |
16 ms |
380 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
499 ms |
472 KB |
Output is correct |
2 |
Correct |
499 ms |
468 KB |
Output is correct |
3 |
Correct |
558 ms |
512 KB |
Output is correct |
4 |
Correct |
559 ms |
488 KB |
Output is correct |
5 |
Correct |
493 ms |
464 KB |
Output is correct |
6 |
Correct |
496 ms |
468 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1976 ms |
596 KB |
Output is correct |
2 |
Correct |
1996 ms |
688 KB |
Output is correct |
3 |
Correct |
2200 ms |
720 KB |
Output is correct |
4 |
Correct |
2193 ms |
636 KB |
Output is correct |
5 |
Correct |
1930 ms |
588 KB |
Output is correct |
6 |
Correct |
1920 ms |
596 KB |
Output is correct |