Submission #630638

#TimeUsernameProblemLanguageResultExecution timeMemory
630638uncriptedRarest Insects (IOI22_insects)C++17
0 / 100
0 ms208 KiB
#include "insects.h" #include<bits/stdc++.h> using namespace std; #define pb push_back vector<int> v; void cler(){ for(int i=0; i<v.size(); i++){ move_outside(v[i]); } } int min_cardinality(int N) { int n=0; for(int i=1; i<=n; i++){ move_inside(i); n++; if(press_button()>1){ move_outside(i); n--; }else{ v.pb(i); } } int l=1,r=2000; while(l<r){ cler(); int m=(l+r+1)/2; int siz=0; siz++; for(int i=1; i<=n; i++){ move_inside(i); if(press_button()>m){ move_outside(i); siz--; } } if(siz!=n*m){ r=m-1; }else{ l=m; } } return l; }

Compilation message (stderr)

insects.cpp: In function 'void cler()':
insects.cpp:8:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 |  for(int i=0; i<v.size(); i++){
      |               ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...