Submission #306584

#TimeUsernameProblemLanguageResultExecution timeMemory
306584chubyxdxdCounting Mushrooms (IOI20_mushrooms)C++17
25 / 100
127 ms464 KiB
#include "mushrooms.h" #include <bits/stdc++.h> #define pb push_back using namespace std; int count_mushrooms(int n){ int ans=1; vector<int> m; m.push_back(0); m.push_back(n-1); int f=use_machine(m); if(f==0)ans++; for(int i=1;i<=n/2-1;i++){ m.clear(); m.pb(i); m.pb(0); m.pb(n-i-1); int f=use_machine(m); if(f==0)ans+=2; if(f==1)ans+=1; } if(n%2==1){ m.clear(); m.pb(0); m.pb(n/2); int f=use_machine(m); if(f==0)ans++; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...