Submission #672035

#TimeUsernameProblemLanguageResultExecution timeMemory
672035Waratpp123Rarest Insects (IOI22_insects)C++17
0 / 100
0 ms208 KiB
#include "insects.h" #include<bits/stdc++.h> using namespace std; int cnt[2050],ch[2050],mi=2050; int min_cardinality(int N) { int i,j,now,s=-1,ans=1; while(1){ now=0; for(i=0;i<N;i++){ if(ch[i]==1) continue; move_inside(i); ch[i]=1; if(press_button()==ans) { now++; continue; } move_outside(i); ch[i]=0; } if(s==-1){ s=now; ans++; }else{ if(s==now) ans++,s=now; else return ans; } } return ans; }

Compilation message (stderr)

insects.cpp: In function 'int min_cardinality(int)':
insects.cpp:6:11: warning: unused variable 'j' [-Wunused-variable]
    6 |     int i,j,now,s=-1,ans=1;
      |           ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...