#include "insects.h"
#include<bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define all(x) x.begin(),x.end()
typedef long long ll;
#define pb push_back
#define INF 99999999999999
int min_cardinality(int N)
{
ll n=N;
vector<bool>type;
type.assign(n,0);
ll ans=INF;
for(int i=0;i<N;i++)
{
ll curr=1;
if(type[i])
continue;
type[i]=1;
move_inside(i);
for(int j=0;j<N;j++)
if(!type[j])
{
move_inside(j);
ll now=press_button();
if(now-1)
{
curr++;
type[j]=1;
}
move_outside(j);
}
ans=min(ans,curr);
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Output is correct |
2 |
Correct |
0 ms |
208 KB |
Output is correct |
3 |
Correct |
0 ms |
208 KB |
Output is correct |
4 |
Correct |
1 ms |
208 KB |
Output is correct |
5 |
Correct |
0 ms |
208 KB |
Output is correct |
6 |
Correct |
1 ms |
208 KB |
Output is correct |
7 |
Correct |
71 ms |
208 KB |
Output is correct |
8 |
Correct |
13 ms |
208 KB |
Output is correct |
9 |
Correct |
12 ms |
208 KB |
Output is correct |
10 |
Correct |
3 ms |
208 KB |
Output is correct |
11 |
Correct |
37 ms |
208 KB |
Output is correct |
12 |
Correct |
4 ms |
208 KB |
Output is correct |
13 |
Correct |
10 ms |
208 KB |
Output is correct |
14 |
Correct |
6 ms |
208 KB |
Output is correct |
15 |
Correct |
5 ms |
208 KB |
Output is correct |
16 |
Correct |
5 ms |
208 KB |
Output is correct |
17 |
Correct |
8 ms |
208 KB |
Output is correct |
18 |
Correct |
11 ms |
208 KB |
Output is correct |
19 |
Correct |
10 ms |
208 KB |
Output is correct |
20 |
Correct |
26 ms |
208 KB |
Output is correct |
21 |
Correct |
51 ms |
208 KB |
Output is correct |
22 |
Correct |
79 ms |
208 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Output is correct |
2 |
Correct |
0 ms |
208 KB |
Output is correct |
3 |
Correct |
0 ms |
208 KB |
Output is correct |
4 |
Correct |
1 ms |
208 KB |
Output is correct |
5 |
Correct |
0 ms |
208 KB |
Output is correct |
6 |
Correct |
1 ms |
208 KB |
Output is correct |
7 |
Correct |
71 ms |
208 KB |
Output is correct |
8 |
Correct |
13 ms |
208 KB |
Output is correct |
9 |
Correct |
12 ms |
208 KB |
Output is correct |
10 |
Correct |
3 ms |
208 KB |
Output is correct |
11 |
Correct |
37 ms |
208 KB |
Output is correct |
12 |
Correct |
4 ms |
208 KB |
Output is correct |
13 |
Correct |
10 ms |
208 KB |
Output is correct |
14 |
Correct |
6 ms |
208 KB |
Output is correct |
15 |
Correct |
5 ms |
208 KB |
Output is correct |
16 |
Correct |
5 ms |
208 KB |
Output is correct |
17 |
Correct |
8 ms |
208 KB |
Output is correct |
18 |
Correct |
11 ms |
208 KB |
Output is correct |
19 |
Correct |
10 ms |
208 KB |
Output is correct |
20 |
Correct |
26 ms |
208 KB |
Output is correct |
21 |
Correct |
51 ms |
208 KB |
Output is correct |
22 |
Correct |
79 ms |
208 KB |
Output is correct |
23 |
Correct |
7 ms |
208 KB |
Output is correct |
24 |
Incorrect |
299 ms |
208 KB |
Too many queries. |
25 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Output is correct |
2 |
Correct |
0 ms |
208 KB |
Output is correct |
3 |
Correct |
0 ms |
208 KB |
Output is correct |
4 |
Correct |
0 ms |
208 KB |
Output is correct |
5 |
Correct |
0 ms |
208 KB |
Output is correct |
6 |
Correct |
1 ms |
208 KB |
Output is correct |
7 |
Correct |
12 ms |
208 KB |
Output is correct |
8 |
Incorrect |
273 ms |
208 KB |
Too many queries. |
9 |
Halted |
0 ms |
0 KB |
- |