# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
857880 | 2023-10-07T06:30:46 Z | firewater | Rarest Insects (IOI22_insects) | C++17 | 0 ms | 344 KB |
#include "insects.h" #include<bits/stdc++.h> #define N 2023 using namespace std; int n,l,r,num,p[N],pp[N]; vector<int>d; int check(int x) { for(int i=0;i<n;++i){ if(p[i]||pp[i])continue; move_inside(i); if(press_button()>x)move_outside(i); else{ p[i]=1; d.push_back(i); num++; } } return num; } int min_cardinality(int NN) { n=NN; for(int i=0;i<n;++i) move_inside(i); r=press_button(); for(int i=0;i<n;++i) move_outside(i); l=0; num=0; while(l<r){ int mid=l+r+1>>1; d.clear(); if(check(mid)>=mid*n)l=mid; else{ r=mid-1; for(int i=0;i<n;++i) if(!p[i])pp[i]=1; for(int i=0;i<d.size();++i) p[d[i]]=0; } } return l; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Wrong answer. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Wrong answer. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Incorrect | 0 ms | 344 KB | Wrong answer. |
3 | Halted | 0 ms | 0 KB | - |