Submission #1069341

# Submission time Handle Problem Language Result Execution time Memory
1069341 2024-08-21T19:48:17 Z mariaclara Rarest Insects (IOI22_insects) C++17
10 / 100
269 ms 344 KB
#include "insects.h"
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
#define mk make_pair
#define pb push_back
#define fr first
#define sc second

int min_cardinality(int N) {
    srand(12454);

    vector<int> ord(N), vis(N);
    for(int i = 0; i < N; i++) ord[i] = i;

    random_shuffle(all(ord));

    int ans = N;

    for(int i = 0; i < N; i++) {
        if(vis[i]) continue;
        move_inside(ord[i]);
        int at = 1;

        for(int j = i+1; j < N; j++) {
            if(vis[j]) continue;

            move_inside(ord[j]);
            if(press_button() == 2) at++, vis[j] = 1;
            move_outside(ord[j]);
        }

        move_outside(ord[i]);
        ans = min(ans, at);
        if(ans == 1) break;
    }

    return ans;
}
# Verdict Execution time Memory 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 Correct 0 ms 344 KB Output is correct
6 Correct 1 ms 344 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 11 ms 344 KB Output is correct
9 Correct 5 ms 344 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 1 ms 344 KB Output is correct
12 Correct 2 ms 344 KB Output is correct
13 Correct 7 ms 344 KB Output is correct
14 Correct 5 ms 344 KB Output is correct
15 Correct 6 ms 344 KB Output is correct
16 Correct 3 ms 344 KB Output is correct
17 Correct 6 ms 344 KB Output is correct
18 Correct 6 ms 344 KB Output is correct
19 Correct 8 ms 344 KB Output is correct
20 Correct 29 ms 344 KB Output is correct
21 Correct 5 ms 344 KB Output is correct
22 Correct 5 ms 344 KB Output is correct
# Verdict Execution time Memory 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 Correct 0 ms 344 KB Output is correct
6 Correct 1 ms 344 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 11 ms 344 KB Output is correct
9 Correct 5 ms 344 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 1 ms 344 KB Output is correct
12 Correct 2 ms 344 KB Output is correct
13 Correct 7 ms 344 KB Output is correct
14 Correct 5 ms 344 KB Output is correct
15 Correct 6 ms 344 KB Output is correct
16 Correct 3 ms 344 KB Output is correct
17 Correct 6 ms 344 KB Output is correct
18 Correct 6 ms 344 KB Output is correct
19 Correct 8 ms 344 KB Output is correct
20 Correct 29 ms 344 KB Output is correct
21 Correct 5 ms 344 KB Output is correct
22 Correct 5 ms 344 KB Output is correct
23 Correct 4 ms 344 KB Output is correct
24 Correct 7 ms 344 KB Output is correct
25 Correct 103 ms 344 KB Output is correct
26 Correct 93 ms 344 KB Output is correct
27 Correct 4 ms 344 KB Output is correct
28 Correct 6 ms 344 KB Output is correct
29 Correct 11 ms 344 KB Output is correct
30 Correct 115 ms 344 KB Output is correct
31 Correct 13 ms 344 KB Output is correct
32 Correct 26 ms 344 KB Output is correct
33 Correct 21 ms 344 KB Output is correct
34 Correct 34 ms 340 KB Output is correct
35 Correct 46 ms 344 KB Output is correct
36 Correct 66 ms 344 KB Output is correct
37 Correct 159 ms 344 KB Output is correct
38 Incorrect 250 ms 344 KB Too many queries.
39 Halted 0 ms 0 KB -
# 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 0 ms 344 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 8 ms 344 KB Output is correct
8 Correct 8 ms 344 KB Output is correct
9 Incorrect 269 ms 344 KB Too many queries.
10 Halted 0 ms 0 KB -