Submission #1230627

#TimeUsernameProblemLanguageResultExecution timeMemory
1230627VMaksimoski008Counting Mushrooms (IOI20_mushrooms)C++20
25 / 100
26 ms420 KiB
#include "mushrooms.h"
#include <bits/stdc++.h>
using namespace std;

int count_mushrooms(int n) {
	int ans = 1;
    int p = 1 + (n % 2 == 0);
    
    if(n % 2 == 0)
        ans += 1 - use_machine({ 0, 1 });
    for(int i=p; i+1<n; i+=2)
        ans += 2 - use_machine({ i, 0, i+1 });

    return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...