# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1029072 | 2024-07-20T11:58:59 Z | 42kangaroo | Rarest Insects (IOI22_insects) | C++17 | 44 ms | 1028 KB |
#include "insects.h" #include "bits/stdc++.h" using namespace std; int min_cardinality(int N) { set<int> inside, outside; for (int i = 0; i < N; ++i) { move_inside(i); if (press_button() > 1) { outside.insert(i); move_outside(i); } else { inside.insert(i); } } int k = inside.size(); int l = 1, r = N/k + 1; while (l + 1 < r) { int m = (l + r + 1)/2; set<int> nIn, nOut; for (auto e: outside) { move_inside(e); if (press_button() > m) { nOut.insert(e); move_outside(e); } else nIn.insert(e); } if ((inside.size() + nIn.size()) == m*k) { l = m; outside = nOut; inside.insert(nIn.begin(), nIn.end()); } else { r = m; for (auto e: nIn) { move_outside(e); } outside = nIn; } } return l; }
Compilation message
# | 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 | 1 ms | 344 KB | Output is correct |
5 | Correct | 0 ms | 344 KB | Output is correct |
6 | Correct | 3 ms | 344 KB | Output is correct |
7 | Correct | 1 ms | 344 KB | Output is correct |
8 | Correct | 2 ms | 344 KB | Output is correct |
9 | Correct | 3 ms | 344 KB | Output is correct |
10 | Correct | 2 ms | 448 KB | Output is correct |
11 | Correct | 1 ms | 600 KB | Output is correct |
12 | Correct | 3 ms | 344 KB | Output is correct |
13 | Correct | 3 ms | 448 KB | Output is correct |
14 | Correct | 3 ms | 340 KB | Output is correct |
15 | Correct | 3 ms | 344 KB | Output is correct |
16 | Correct | 3 ms | 344 KB | Output is correct |
17 | Correct | 3 ms | 344 KB | Output is correct |
18 | Correct | 3 ms | 344 KB | Output is correct |
19 | Correct | 4 ms | 344 KB | Output is correct |
20 | Correct | 3 ms | 344 KB | Output is correct |
21 | Correct | 2 ms | 344 KB | Output is correct |
22 | Correct | 1 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 | 1 ms | 344 KB | Output is correct |
5 | Correct | 0 ms | 344 KB | Output is correct |
6 | Correct | 3 ms | 344 KB | Output is correct |
7 | Correct | 1 ms | 344 KB | Output is correct |
8 | Correct | 2 ms | 344 KB | Output is correct |
9 | Correct | 3 ms | 344 KB | Output is correct |
10 | Correct | 2 ms | 448 KB | Output is correct |
11 | Correct | 1 ms | 600 KB | Output is correct |
12 | Correct | 3 ms | 344 KB | Output is correct |
13 | Correct | 3 ms | 448 KB | Output is correct |
14 | Correct | 3 ms | 340 KB | Output is correct |
15 | Correct | 3 ms | 344 KB | Output is correct |
16 | Correct | 3 ms | 344 KB | Output is correct |
17 | Correct | 3 ms | 344 KB | Output is correct |
18 | Correct | 3 ms | 344 KB | Output is correct |
19 | Correct | 4 ms | 344 KB | Output is correct |
20 | Correct | 3 ms | 344 KB | Output is correct |
21 | Correct | 2 ms | 344 KB | Output is correct |
22 | Correct | 1 ms | 344 KB | Output is correct |
23 | Correct | 14 ms | 684 KB | Output is correct |
24 | Correct | 4 ms | 344 KB | Output is correct |
25 | Correct | 12 ms | 344 KB | Output is correct |
26 | Correct | 19 ms | 860 KB | Output is correct |
27 | Correct | 10 ms | 344 KB | Output is correct |
28 | Correct | 7 ms | 340 KB | Output is correct |
29 | Correct | 9 ms | 344 KB | Output is correct |
30 | Correct | 9 ms | 344 KB | Output is correct |
31 | Correct | 16 ms | 344 KB | Output is correct |
32 | Correct | 14 ms | 600 KB | Output is correct |
33 | Correct | 14 ms | 856 KB | Output is correct |
34 | Correct | 16 ms | 608 KB | Output is correct |
35 | Correct | 24 ms | 592 KB | Output is correct |
36 | Correct | 13 ms | 500 KB | Output is correct |
37 | Correct | 14 ms | 344 KB | Output is correct |
38 | Correct | 14 ms | 344 KB | Output is correct |
39 | Correct | 24 ms | 344 KB | Output is correct |
40 | Correct | 7 ms | 344 KB | Output is correct |
41 | Correct | 7 ms | 692 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 | 30 ms | 600 KB | Output is correct |
8 | Correct | 15 ms | 344 KB | Output is correct |
9 | Correct | 29 ms | 600 KB | Output is correct |
10 | Correct | 27 ms | 592 KB | Output is correct |
11 | Correct | 30 ms | 1028 KB | Output is correct |
12 | Correct | 15 ms | 744 KB | Output is correct |
13 | Correct | 29 ms | 592 KB | Output is correct |
14 | Correct | 27 ms | 528 KB | Output is correct |
15 | Correct | 32 ms | 796 KB | Output is correct |
16 | Correct | 33 ms | 600 KB | Output is correct |
17 | Correct | 29 ms | 844 KB | Output is correct |
18 | Correct | 33 ms | 776 KB | Output is correct |
19 | Correct | 27 ms | 944 KB | Output is correct |
20 | Correct | 41 ms | 824 KB | Output is correct |
21 | Correct | 32 ms | 708 KB | Output is correct |
22 | Correct | 24 ms | 592 KB | Output is correct |
23 | Correct | 39 ms | 600 KB | Output is correct |
24 | Correct | 21 ms | 592 KB | Output is correct |
25 | Correct | 15 ms | 344 KB | Output is correct |
26 | Correct | 8 ms | 344 KB | Output is correct |
27 | Correct | 24 ms | 740 KB | Output is correct |
28 | Correct | 28 ms | 840 KB | Output is correct |
29 | Correct | 24 ms | 700 KB | Output is correct |
30 | Correct | 44 ms | 592 KB | Output is correct |
31 | Correct | 26 ms | 820 KB | Output is correct |
32 | Correct | 30 ms | 756 KB | Output is correct |
33 | Partially correct | 34 ms | 344 KB | Output is partially correct |
34 | Partially correct | 35 ms | 736 KB | Output is partially correct |
35 | Correct | 29 ms | 736 KB | Output is correct |
36 | Correct | 27 ms | 808 KB | Output is correct |
37 | Correct | 35 ms | 600 KB | Output is correct |
38 | Correct | 27 ms | 780 KB | Output is correct |
39 | Correct | 27 ms | 516 KB | Output is correct |
40 | Correct | 36 ms | 788 KB | Output is correct |
41 | Correct | 33 ms | 848 KB | Output is correct |
42 | Correct | 27 ms | 716 KB | Output is correct |
43 | Correct | 8 ms | 600 KB | Output is correct |
44 | Correct | 22 ms | 840 KB | Output is correct |
45 | Correct | 33 ms | 644 KB | Output is correct |
46 | Correct | 15 ms | 484 KB | Output is correct |
47 | Correct | 24 ms | 600 KB | Output is correct |
48 | Correct | 13 ms | 628 KB | Output is correct |