#include <bits/stdc++.h>
#include "insects.h"
using namespace std;
using ll = long long;
bool ch[2020];
int min_cardinality(int n) {
int mn = n;
for (int i = 0;i < n;i++) {
if (ch[i]) continue;
ch[i] = 1;
int cnt = 1;
move_inside(i);
for (int j = i + 1;j < n;j++) {
if (ch[j]) continue;
move_inside(j);
if (press_button() == 2) {
cnt++;
ch[j] = 1;
}
move_outside(j);
}
mn = min(mn, cnt);
}
return mn;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
596 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
1 ms |
344 KB |
Output is correct |
7 |
Correct |
120 ms |
344 KB |
Output is correct |
8 |
Correct |
7 ms |
344 KB |
Output is correct |
9 |
Correct |
8 ms |
500 KB |
Output is correct |
10 |
Correct |
2 ms |
344 KB |
Output is correct |
11 |
Correct |
23 ms |
344 KB |
Output is correct |
12 |
Correct |
2 ms |
344 KB |
Output is correct |
13 |
Correct |
6 ms |
344 KB |
Output is correct |
14 |
Correct |
2 ms |
344 KB |
Output is correct |
15 |
Correct |
4 ms |
344 KB |
Output is correct |
16 |
Correct |
4 ms |
344 KB |
Output is correct |
17 |
Correct |
5 ms |
344 KB |
Output is correct |
18 |
Correct |
6 ms |
344 KB |
Output is correct |
19 |
Correct |
7 ms |
344 KB |
Output is correct |
20 |
Correct |
22 ms |
344 KB |
Output is correct |
21 |
Correct |
45 ms |
344 KB |
Output is correct |
22 |
Correct |
69 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
596 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
1 ms |
344 KB |
Output is correct |
7 |
Correct |
120 ms |
344 KB |
Output is correct |
8 |
Correct |
7 ms |
344 KB |
Output is correct |
9 |
Correct |
8 ms |
500 KB |
Output is correct |
10 |
Correct |
2 ms |
344 KB |
Output is correct |
11 |
Correct |
23 ms |
344 KB |
Output is correct |
12 |
Correct |
2 ms |
344 KB |
Output is correct |
13 |
Correct |
6 ms |
344 KB |
Output is correct |
14 |
Correct |
2 ms |
344 KB |
Output is correct |
15 |
Correct |
4 ms |
344 KB |
Output is correct |
16 |
Correct |
4 ms |
344 KB |
Output is correct |
17 |
Correct |
5 ms |
344 KB |
Output is correct |
18 |
Correct |
6 ms |
344 KB |
Output is correct |
19 |
Correct |
7 ms |
344 KB |
Output is correct |
20 |
Correct |
22 ms |
344 KB |
Output is correct |
21 |
Correct |
45 ms |
344 KB |
Output is correct |
22 |
Correct |
69 ms |
344 KB |
Output is correct |
23 |
Correct |
4 ms |
344 KB |
Output is correct |
24 |
Incorrect |
209 ms |
344 KB |
Too many queries. |
25 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
0 ms |
344 KB |
Output is correct |
7 |
Correct |
9 ms |
344 KB |
Output is correct |
8 |
Incorrect |
234 ms |
596 KB |
Too many queries. |
9 |
Halted |
0 ms |
0 KB |
- |