#include "insects.h"
#include <bits/stdc++.h>
using namespace std;
int min_cardinality(int N){
vector<pair<int,int>> current;
vector<vector<int>> types;
for(int i=0;i<N;i++) {
move_inside(i);
if(press_button()==1) {
current.emplace_back(i,types.size());
types.emplace_back();
types.back().emplace_back(i);
continue;
}
for(auto&[x,y]:current) {
move_outside(x);
if(press_button()==1) {
types[y].emplace_back(i);
}
move_inside(x);
}
}
int siz = N;
for(auto&i:types)siz=min(siz,(int)i.size());
return siz;
}
# |
결과 |
실행 시간 |
메모리 |
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 |
Incorrect |
0 ms |
344 KB |
Wrong answer. |
5 |
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 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Incorrect |
0 ms |
344 KB |
Wrong answer. |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 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 |
Incorrect |
0 ms |
344 KB |
Wrong answer. |
6 |
Halted |
0 ms |
0 KB |
- |