# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
689839 | 2023-01-29T14:01:10 Z | NemanjaSo2005 | Rarest Insects (IOI22_insects) | C++17 | 69 ms | 448 KB |
#include "insects.h" #include<bits/stdc++.h> #define ll long long using namespace std; ll N,niz[2005]; mt19937_64 rng; int sp; vector<int> V,tmp; bool moguce(int kol){ for(int i=0;i<V.size();i++){ if(tmp.size()==kol*sp) break; move_inside(V[i]); if(press_button()==kol+1){ move_outside(V[i]); continue; } tmp.push_back(V[i]); swap(V[i],V[V.size()-1]); V.pop_back(); i--; } for(int i=0;i<tmp.size();i++) move_outside(tmp[i]); if(sp==-1) sp=tmp.size(); if(tmp.size()==kol*sp){ tmp.clear(); return true; } V=tmp; tmp.clear(); return false; } int min_cardinality(int n){ rng.seed(6333); N=n; for(int i=1;i<=N;i++) niz[i]=i-1; //for(int i=1;i<=5*N;i++) // swap(niz[rng()%N+1],niz[rng()%N+1]); tmp.clear(); for(int i=1;i<=N;i++) V.push_back(niz[i]); sp=-1; moguce(1); int br=1; int maks=V.size()/sp; int K=1; while(K<=maks) K*=2; K/=2; while(K){ if(moguce(K)) br+=K; K/=2; } return br; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 208 KB | Output is correct |
2 | Correct | 0 ms | 208 KB | Output is correct |
3 | Correct | 0 ms | 208 KB | Output is correct |
4 | Correct | 1 ms | 208 KB | Output is correct |
5 | Correct | 1 ms | 208 KB | Output is correct |
6 | Correct | 3 ms | 208 KB | Output is correct |
7 | Correct | 3 ms | 208 KB | Output is correct |
8 | Correct | 5 ms | 208 KB | Output is correct |
9 | Correct | 4 ms | 208 KB | Output is correct |
10 | Correct | 6 ms | 208 KB | Output is correct |
11 | Correct | 2 ms | 208 KB | Output is correct |
12 | Correct | 6 ms | 208 KB | Output is correct |
13 | Correct | 7 ms | 208 KB | Output is correct |
14 | Correct | 5 ms | 208 KB | Output is correct |
15 | Correct | 5 ms | 208 KB | Output is correct |
16 | Correct | 5 ms | 208 KB | Output is correct |
17 | Correct | 5 ms | 208 KB | Output is correct |
18 | Correct | 5 ms | 208 KB | Output is correct |
19 | Correct | 6 ms | 208 KB | Output is correct |
20 | Correct | 4 ms | 208 KB | Output is correct |
21 | Correct | 3 ms | 208 KB | Output is correct |
22 | Correct | 2 ms | 208 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 208 KB | Output is correct |
2 | Correct | 0 ms | 208 KB | Output is correct |
3 | Correct | 0 ms | 208 KB | Output is correct |
4 | Correct | 1 ms | 208 KB | Output is correct |
5 | Correct | 1 ms | 208 KB | Output is correct |
6 | Correct | 3 ms | 208 KB | Output is correct |
7 | Correct | 3 ms | 208 KB | Output is correct |
8 | Correct | 5 ms | 208 KB | Output is correct |
9 | Correct | 4 ms | 208 KB | Output is correct |
10 | Correct | 6 ms | 208 KB | Output is correct |
11 | Correct | 2 ms | 208 KB | Output is correct |
12 | Correct | 6 ms | 208 KB | Output is correct |
13 | Correct | 7 ms | 208 KB | Output is correct |
14 | Correct | 5 ms | 208 KB | Output is correct |
15 | Correct | 5 ms | 208 KB | Output is correct |
16 | Correct | 5 ms | 208 KB | Output is correct |
17 | Correct | 5 ms | 208 KB | Output is correct |
18 | Correct | 5 ms | 208 KB | Output is correct |
19 | Correct | 6 ms | 208 KB | Output is correct |
20 | Correct | 4 ms | 208 KB | Output is correct |
21 | Correct | 3 ms | 208 KB | Output is correct |
22 | Correct | 2 ms | 208 KB | Output is correct |
23 | Correct | 20 ms | 304 KB | Output is correct |
24 | Correct | 10 ms | 308 KB | Output is correct |
25 | Correct | 20 ms | 208 KB | Output is correct |
26 | Correct | 12 ms | 208 KB | Output is correct |
27 | Correct | 26 ms | 208 KB | Output is correct |
28 | Correct | 8 ms | 208 KB | Output is correct |
29 | Correct | 27 ms | 208 KB | Output is correct |
30 | Correct | 22 ms | 208 KB | Output is correct |
31 | Correct | 19 ms | 208 KB | Output is correct |
32 | Correct | 23 ms | 208 KB | Output is correct |
33 | Correct | 27 ms | 208 KB | Output is correct |
34 | Correct | 26 ms | 320 KB | Output is correct |
35 | Correct | 33 ms | 208 KB | Output is correct |
36 | Correct | 29 ms | 308 KB | Output is correct |
37 | Correct | 27 ms | 304 KB | Output is correct |
38 | Correct | 23 ms | 304 KB | Output is correct |
39 | Correct | 18 ms | 208 KB | Output is correct |
40 | Correct | 15 ms | 208 KB | Output is correct |
41 | Correct | 11 ms | 320 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 208 KB | Output is correct |
2 | Correct | 1 ms | 208 KB | Output is correct |
3 | Correct | 0 ms | 208 KB | Output is correct |
4 | Correct | 0 ms | 208 KB | Output is correct |
5 | Correct | 0 ms | 208 KB | Output is correct |
6 | Correct | 1 ms | 208 KB | Output is correct |
7 | Correct | 38 ms | 324 KB | Output is correct |
8 | Correct | 20 ms | 336 KB | Output is correct |
9 | Correct | 33 ms | 324 KB | Output is correct |
10 | Partially correct | 59 ms | 312 KB | Output is partially correct |
11 | Correct | 35 ms | 208 KB | Output is correct |
12 | Correct | 21 ms | 324 KB | Output is correct |
13 | Partially correct | 27 ms | 316 KB | Output is partially correct |
14 | Partially correct | 54 ms | 208 KB | Output is partially correct |
15 | Correct | 35 ms | 312 KB | Output is correct |
16 | Correct | 33 ms | 208 KB | Output is correct |
17 | Correct | 31 ms | 324 KB | Output is correct |
18 | Correct | 49 ms | 328 KB | Output is correct |
19 | Partially correct | 60 ms | 316 KB | Output is partially correct |
20 | Correct | 45 ms | 208 KB | Output is correct |
21 | Partially correct | 56 ms | 324 KB | Output is partially correct |
22 | Partially correct | 27 ms | 312 KB | Output is partially correct |
23 | Partially correct | 56 ms | 332 KB | Output is partially correct |
24 | Correct | 45 ms | 336 KB | Output is correct |
25 | Correct | 26 ms | 332 KB | Output is correct |
26 | Correct | 15 ms | 332 KB | Output is correct |
27 | Correct | 37 ms | 208 KB | Output is correct |
28 | Correct | 38 ms | 312 KB | Output is correct |
29 | Partially correct | 51 ms | 436 KB | Output is partially correct |
30 | Correct | 50 ms | 448 KB | Output is correct |
31 | Partially correct | 33 ms | 332 KB | Output is partially correct |
32 | Partially correct | 61 ms | 324 KB | Output is partially correct |
33 | Partially correct | 69 ms | 320 KB | Output is partially correct |
34 | Partially correct | 53 ms | 324 KB | Output is partially correct |
35 | Correct | 53 ms | 440 KB | Output is correct |
36 | Partially correct | 66 ms | 308 KB | Output is partially correct |
37 | Partially correct | 59 ms | 320 KB | Output is partially correct |
38 | Partially correct | 61 ms | 312 KB | Output is partially correct |
39 | Correct | 16 ms | 208 KB | Output is correct |
40 | Correct | 43 ms | 208 KB | Output is correct |
41 | Correct | 31 ms | 324 KB | Output is correct |
42 | Correct | 30 ms | 328 KB | Output is correct |
43 | Correct | 14 ms | 208 KB | Output is correct |
44 | Correct | 46 ms | 208 KB | Output is correct |
45 | Correct | 37 ms | 308 KB | Output is correct |
46 | Correct | 29 ms | 208 KB | Output is correct |
47 | Correct | 33 ms | 208 KB | Output is correct |
48 | Correct | 27 ms | 332 KB | Output is correct |