Submission #432722

#TimeUsernameProblemLanguageResultExecution timeMemory
432722MOUF_MAHMALATCounting Mushrooms (IOI20_mushrooms)C++14
25 / 100
118 ms200 KiB
#include "mushrooms.h"
#include<bits/stdc++.h>
using namespace std;
typedef int ll;
ll ans=1,x;
int count_mushrooms(int n)
{
    for(ll i=2; i<n; i+=2)
    {
        x=use_machine({i,0,i-1});
        if(x==0)
            ans+=2;
        else if(x==1)
            ans++;
    }
    if(n%2==0)
        ans+=1^use_machine({0,n-1});
    return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...