Submission #346036

#TimeUsernameProblemLanguageResultExecution timeMemory
346036poom2904Counting Mushrooms (IOI20_mushrooms)C++14
0 / 100
0 ms364 KiB
#include "mushrooms.h" int count_mushrooms(int n) { std::vector<int> m; int ans=1; for (int i=1;i<n-1+(n&1);i+=2) { m={i,0,i+1}; ans+=2-use_machine(m); } if(n&1==0) { m={n-1,0}; ans+=1-use_machine(m); } return ans; }

Compilation message (stderr)

mushrooms.cpp: In function 'int count_mushrooms(int)':
mushrooms.cpp:11:11: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
   11 |     if(n&1==0)
      |          ~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...