Submission #1079963

#TimeUsernameProblemLanguageResultExecution timeMemory
1079963Jawad_Akbar_JJCounting Mushrooms (IOI20_mushrooms)C++17
25 / 100
75 ms596 KiB
#include <iostream> #include <vector> #include "mushrooms.h" using namespace std; int count_mushrooms(int n){ int A = 1; vector<int> vec; for (int i=1;i<n;){ if (i + 1 < n and n > 4){ vec = {i, 0, i+1}; int ans = use_machine(vec); A += 2 - ans; i += 2; } else{ vec = {i, 0}; A += use_machine(vec) == 0; i++; } } return A; }
#Verdict Execution timeMemoryGrader output
Fetching results...