제출 #432722

#제출 시각아이디문제언어결과실행 시간메모리
432722MOUF_MAHMALAT버섯 세기 (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;
}
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…