#include "insects.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define loop(x, i) for (int i = 0; i < x; i++)
#define rev(x, i) for (int i = (int)x - 1; i >= 0; i--)
#define ALL(x) begin(x), end(x)
#define sz(x) (int)x.size()
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<vi> vvi;
int min_cardinality(int N)
{
vi type(N);
vi occ(N);
loop(N, i) type[i] = i;
loop(N, i)
{
if (type[i] != i)
continue;
move_inside(i);
for (int j = i + 1; j < N; j++)
{
move_inside(j);
int res = press_button();
if (res == 2)
{
type[j] = type[i];
}
move_outside(j);
}
move_outside(i);
}
int res = 1;
loop(N, i)
{
occ[type[i]]++;
res = max(res, occ[type[i]]);
}
return res;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Incorrect |
0 ms |
344 KB |
Wrong answer. |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Incorrect |
0 ms |
344 KB |
Wrong answer. |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
404 KB |
Wrong answer. |
2 |
Halted |
0 ms |
0 KB |
- |