Submission #859824

# Submission time Handle Problem Language Result Execution time Memory
859824 2023-10-10T18:19:50 Z vjudge1 Rarest Insects (IOI22_insects) C++17
57.78 / 100
86 ms 1780 KB
#include<bits/stdc++.h>
#include"insects.h"
using namespace std;
int min_cardinality(int N){
    vector<int> u;
    map<int, int> tipo;
    vector<int> v;
    for(int i=0; i<N; i++){
        move_inside(i);
        if(press_button()==1){
            u.push_back(i);
            tipo[i]=u.size()-1;
        }else{
            move_outside(i);
            v.push_back(i);
        }
    }
    for(int i: u) move_outside(i);
    int pot=1;
    int U = u.size();
    while(pot<=U){
        for(int i: u) if((tipo[i]&pot)!=0) move_inside(i);
        for(int i:v){
            move_inside(i);
            if(press_button()!=1){
                tipo[i]+=pot;
            }
            move_outside(i);
        }
        for(int i: u) if((tipo[i]&pot)!=0) move_outside(i);
        pot*=2;
    }
    map<int, int> m;
    for(int i=0; i<N; i++) m[tipo[i]]++;
    int minimo = N;
    for(auto l: m){
        minimo=min(minimo, l.second);
    }
    return minimo;
}
# Verdict Execution time Memory 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 1 ms 344 KB Output is correct
6 Correct 2 ms 600 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 5 ms 700 KB Output is correct
9 Correct 4 ms 860 KB Output is correct
10 Correct 3 ms 600 KB Output is correct
11 Correct 4 ms 856 KB Output is correct
12 Correct 3 ms 856 KB Output is correct
13 Correct 4 ms 600 KB Output is correct
14 Correct 3 ms 600 KB Output is correct
15 Correct 5 ms 696 KB Output is correct
16 Correct 6 ms 600 KB Output is correct
17 Correct 6 ms 856 KB Output is correct
18 Correct 6 ms 600 KB Output is correct
19 Correct 5 ms 856 KB Output is correct
20 Correct 4 ms 856 KB Output is correct
21 Correct 5 ms 600 KB Output is correct
22 Correct 3 ms 856 KB Output is correct
# Verdict Execution time Memory 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 1 ms 344 KB Output is correct
6 Correct 2 ms 600 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 5 ms 700 KB Output is correct
9 Correct 4 ms 860 KB Output is correct
10 Correct 3 ms 600 KB Output is correct
11 Correct 4 ms 856 KB Output is correct
12 Correct 3 ms 856 KB Output is correct
13 Correct 4 ms 600 KB Output is correct
14 Correct 3 ms 600 KB Output is correct
15 Correct 5 ms 696 KB Output is correct
16 Correct 6 ms 600 KB Output is correct
17 Correct 6 ms 856 KB Output is correct
18 Correct 6 ms 600 KB Output is correct
19 Correct 5 ms 856 KB Output is correct
20 Correct 4 ms 856 KB Output is correct
21 Correct 5 ms 600 KB Output is correct
22 Correct 3 ms 856 KB Output is correct
23 Correct 9 ms 600 KB Output is correct
24 Correct 7 ms 1368 KB Output is correct
25 Correct 30 ms 1108 KB Output is correct
26 Correct 26 ms 1200 KB Output is correct
27 Correct 12 ms 856 KB Output is correct
28 Correct 26 ms 876 KB Output is correct
29 Correct 18 ms 860 KB Output is correct
30 Correct 28 ms 1448 KB Output is correct
31 Correct 20 ms 1132 KB Output is correct
32 Correct 25 ms 964 KB Output is correct
33 Correct 32 ms 852 KB Output is correct
34 Correct 30 ms 624 KB Output is correct
35 Correct 23 ms 708 KB Output is correct
36 Correct 24 ms 860 KB Output is correct
37 Correct 30 ms 1184 KB Output is correct
38 Correct 36 ms 1200 KB Output is correct
39 Correct 35 ms 1116 KB Output is correct
40 Correct 30 ms 1224 KB Output is correct
41 Correct 21 ms 1112 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 1 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 0 ms 344 KB Output is correct
7 Correct 16 ms 1112 KB Output is correct
8 Partially correct 20 ms 1340 KB Output is partially correct
9 Partially correct 70 ms 780 KB Output is partially correct
10 Partially correct 65 ms 1248 KB Output is partially correct
11 Correct 43 ms 604 KB Output is correct
12 Partially correct 62 ms 1460 KB Output is partially correct
13 Partially correct 33 ms 1484 KB Output is partially correct
14 Partially correct 65 ms 980 KB Output is partially correct
15 Partially correct 41 ms 980 KB Output is partially correct
16 Partially correct 48 ms 1224 KB Output is partially correct
17 Partially correct 56 ms 1624 KB Output is partially correct
18 Partially correct 43 ms 1228 KB Output is partially correct
19 Partially correct 42 ms 996 KB Output is partially correct
20 Partially correct 55 ms 1200 KB Output is partially correct
21 Partially correct 70 ms 1016 KB Output is partially correct
22 Partially correct 68 ms 1448 KB Output is partially correct
23 Partially correct 83 ms 960 KB Output is partially correct
24 Partially correct 69 ms 1236 KB Output is partially correct
25 Partially correct 61 ms 1780 KB Output is partially correct
26 Partially correct 49 ms 1440 KB Output is partially correct
27 Partially correct 68 ms 1240 KB Output is partially correct
28 Partially correct 79 ms 980 KB Output is partially correct
29 Partially correct 54 ms 1112 KB Output is partially correct
30 Partially correct 62 ms 1172 KB Output is partially correct
31 Partially correct 65 ms 1712 KB Output is partially correct
32 Partially correct 64 ms 1240 KB Output is partially correct
33 Partially correct 86 ms 1220 KB Output is partially correct
34 Partially correct 75 ms 1636 KB Output is partially correct
35 Partially correct 74 ms 1372 KB Output is partially correct
36 Partially correct 77 ms 1004 KB Output is partially correct
37 Partially correct 73 ms 1260 KB Output is partially correct
38 Partially correct 54 ms 1228 KB Output is partially correct
39 Partially correct 81 ms 1132 KB Output is partially correct
40 Partially correct 68 ms 1512 KB Output is partially correct
41 Partially correct 67 ms 768 KB Output is partially correct
42 Partially correct 69 ms 1192 KB Output is partially correct
43 Partially correct 11 ms 692 KB Output is partially correct
44 Partially correct 54 ms 608 KB Output is partially correct
45 Correct 30 ms 1452 KB Output is correct
46 Partially correct 52 ms 1280 KB Output is partially correct
47 Partially correct 57 ms 1104 KB Output is partially correct
48 Partially correct 58 ms 968 KB Output is partially correct