#include<bits/stdc++.h>
#include "insects.h"
using namespace std;
int n;
const int mx=2e7+10;
long long dp[mx];
int min_cardinality(int N){
int arr[N+1];
for(int i=0;i<N;i++){
arr[i]=-1;
}
map<int,int>mp;
for(int i=0;i<n;i++){
move_inside(i);
if(arr[i]==-1){
arr[i]=i;
}
for(int j=i+1;j<n;j++){
move_inside(j);
int z= press_button();
if(z==2){
arr[j]=arr[i];
}
move_outside(j);
}
}
for(int i=0;i<n;i++){
mp[arr[i]]++;
}
int ans=n;
for(int i=0;i<n;i++){
ans=min(ans,mp[arr[i]]);
}
return ans;
}
/*
int main(){
cout<<min_cardinality(9);
}*/
# |
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 |
Incorrect |
0 ms |
344 KB |
Wrong answer. |
2 |
Halted |
0 ms |
0 KB |
- |