Submission #420549

#TimeUsernameProblemLanguageResultExecution timeMemory
420549ioiCounting Mushrooms (IOI20_mushrooms)C++14
25 / 100
132 ms320 KiB
#include "mushrooms.h" #include<bits/stdc++.h> using namespace std ; int count_mushrooms(int n) { int ans = 1 ; for(int i = 1 ; i + 1 < n ; i += 2){ vector<int> m = {i , 0 , i + 1}; int a = use_machine(m); if(a == 0)ans += 2 ; if(a == 1)ans ++ ; } if(n % 2 == 0){ if(!use_machine({0 , n - 1}))ans ++ ; } return ans ; }
#Verdict Execution timeMemoryGrader output
Fetching results...