#include "insects.h"
#include <bits/stdc++.h>
using namespace std;
int min_cardinality(int N) {
vector<bool> used(N);
int types = 0;
for (int i = 0; i < N; i++) {
move_inside(i);
if (press_button() > 1) {
move_outside(i);
continue;
}
types++;
used[i] = true;
}
for (int num = 2; num <= N; num++) {
int added = 0;
for (int i = 0; i < N; i++) {
if (used[i]) continue;
move_inside(i);
if (press_button() > num) {
move_outside(i);
continue;
}
added++;
used[i] = true;
}
if (added != types) {
return num-1;
}
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Wrong answer. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Wrong answer. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
1 ms |
344 KB |
Wrong answer. |
3 |
Halted |
0 ms |
0 KB |
- |