#include<bits/stdc++.h>
#include "dango3.h"
using namespace std;
vector<int> ans, v2, x;
bool mark[100005];
vector<int> dango[100];
void Solve(int n, int m) {
for (int i = 1; i <= n * m; i++) {
int l = -1, r = m - 1, mid;
while(l + 1 != r) {
mid = (l + r) / 2;
for (int j = 1; j <= n * m; j++) mark[j] = true;
for (int i = 0; i <= mid; i++) {
for (int j: dango[i]) mark[j] = false;
}
mark[i] = false;
x.clear();
for (int j = 1; j <= n * m; j++) if(mark[j]) x.push_back(j);
int dm = Query(x);
if(dm == m - mid - 2) l = mid;
else r = mid;
}
dango[r].push_back(i);
}
for (int i = 0; i < m; i++) Answer(dango[i]);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
14 ms |
344 KB |
Output is correct |
2 |
Correct |
14 ms |
348 KB |
Output is correct |
3 |
Correct |
14 ms |
344 KB |
Output is correct |
4 |
Correct |
14 ms |
344 KB |
Output is correct |
5 |
Correct |
13 ms |
348 KB |
Output is correct |
6 |
Correct |
14 ms |
504 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
431 ms |
348 KB |
Output is correct |
2 |
Correct |
432 ms |
548 KB |
Output is correct |
3 |
Correct |
499 ms |
548 KB |
Output is correct |
4 |
Correct |
494 ms |
568 KB |
Output is correct |
5 |
Correct |
423 ms |
552 KB |
Output is correct |
6 |
Correct |
421 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1725 ms |
640 KB |
Output is correct |
2 |
Correct |
1720 ms |
640 KB |
Output is correct |
3 |
Correct |
1942 ms |
884 KB |
Output is correct |
4 |
Correct |
1943 ms |
612 KB |
Output is correct |
5 |
Correct |
1682 ms |
624 KB |
Output is correct |
6 |
Correct |
1680 ms |
624 KB |
Output is correct |