Submission #1035188

#TimeUsernameProblemLanguageResultExecution timeMemory
1035188GrayCounting Mushrooms (IOI20_mushrooms)C++17
25 / 100
77 ms596 KiB
#include "mushrooms.h" #define ff first #define ss second #define ll long long #define ln "\n" using namespace std; int count_mushrooms(int n) { std::vector<int> query; int ans=1; for (ll i=1; i<n; i+=2){ if (i+1<n){ query = {int(i), 0, int(i+1)}; ans+=2-use_machine(query); }else{ query = {(int)i, 0}; ans+=1-use_machine(query); } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...