#include "insects.h"
#include<bits/stdc++.h>
using namespace std;
int min_cardinality(int n){
vector<int> v;
vector<int> s(n, 1);
for (int i=0; i<n; i++) v.push_back(i);
for (int i=0; i<n-1; i++){
move_inside(i);
for (int j=i+1; j<n; j++){
move_inside(j);
if (press_button() == 2){
s[v[j]]--;
s[v[i]]++;
v[j] = v[i];
}
move_outside(j);
}
move_outside(i);
}
int bsf = n;
for (int i=0; i<n; i++){
if (s[i] != 0) bsf = min(bsf, s[i]);
}
return bsf;
}
# |
결과 |
실행 시간 |
메모리 |
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 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
92 ms |
344 KB |
Output is correct |
7 |
Correct |
93 ms |
344 KB |
Output is correct |
8 |
Correct |
130 ms |
596 KB |
Output is correct |
9 |
Correct |
94 ms |
344 KB |
Output is correct |
10 |
Correct |
115 ms |
344 KB |
Output is correct |
11 |
Correct |
100 ms |
344 KB |
Output is correct |
12 |
Correct |
87 ms |
340 KB |
Output is correct |
13 |
Correct |
100 ms |
344 KB |
Output is correct |
14 |
Correct |
104 ms |
344 KB |
Output is correct |
15 |
Correct |
92 ms |
344 KB |
Output is correct |
16 |
Correct |
99 ms |
344 KB |
Output is correct |
17 |
Correct |
107 ms |
344 KB |
Output is correct |
18 |
Correct |
90 ms |
344 KB |
Output is correct |
19 |
Correct |
97 ms |
344 KB |
Output is correct |
20 |
Correct |
91 ms |
344 KB |
Output is correct |
21 |
Correct |
98 ms |
344 KB |
Output is correct |
22 |
Correct |
99 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
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 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
92 ms |
344 KB |
Output is correct |
7 |
Correct |
93 ms |
344 KB |
Output is correct |
8 |
Correct |
130 ms |
596 KB |
Output is correct |
9 |
Correct |
94 ms |
344 KB |
Output is correct |
10 |
Correct |
115 ms |
344 KB |
Output is correct |
11 |
Correct |
100 ms |
344 KB |
Output is correct |
12 |
Correct |
87 ms |
340 KB |
Output is correct |
13 |
Correct |
100 ms |
344 KB |
Output is correct |
14 |
Correct |
104 ms |
344 KB |
Output is correct |
15 |
Correct |
92 ms |
344 KB |
Output is correct |
16 |
Correct |
99 ms |
344 KB |
Output is correct |
17 |
Correct |
107 ms |
344 KB |
Output is correct |
18 |
Correct |
90 ms |
344 KB |
Output is correct |
19 |
Correct |
97 ms |
344 KB |
Output is correct |
20 |
Correct |
91 ms |
344 KB |
Output is correct |
21 |
Correct |
98 ms |
344 KB |
Output is correct |
22 |
Correct |
99 ms |
344 KB |
Output is correct |
23 |
Incorrect |
203 ms |
344 KB |
Too many queries. |
24 |
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 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Partially correct |
1 ms |
344 KB |
Output is partially correct |
6 |
Partially correct |
1 ms |
344 KB |
Output is partially correct |
7 |
Incorrect |
193 ms |
344 KB |
Too many queries. |
8 |
Halted |
0 ms |
0 KB |
- |