Submission #1219111

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

int count_mushrooms(int n) {
    int re = 1;
    for(int i=1;i<n-1;i+=2) {
        re += 2 - use_machine({i, 0, i+1});
    }
	return re + (n % 2 ? 0 : !use_machine({0, n-1}));
}
#Verdict Execution timeMemoryGrader output
Fetching results...