# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
859225 | 2023-10-10T01:58:48 Z | kim | Rarest Insects (IOI22_insects) | C++17 | 0 ms | 344 KB |
#include "insects.h" #include<bits/stdc++.h> using namespace std; #define in move_inside #define press press_button #define out move_outside vector<int> vec0; int p; int n; bool check(int k){ int cnt=0; for(int i=1;i<=n;++i){ in(i), ++cnt; if(press()>k) out(i),--cnt; } if(cnt==p*k) return 1; return 0; } int min_cardinality(int N){ n=N; for(int i=1;i<=n;++i){ in(i), vec0.push_back(i); if(press()>1) out(i),vec0.pop_back(); } p=vec0.size(); int l=1,r=n/p; while(l<r){ int mid=l+(r-l+1>>1); if(check(mid)) l=mid; else r=mid-1; } return l; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Integer 2 violates the range [0, 1] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Integer 2 violates the range [0, 1] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Integer 6 violates the range [0, 5] |
2 | Halted | 0 ms | 0 KB | - |