제출 #420549

#제출 시각아이디문제언어결과실행 시간메모리
420549ioi버섯 세기 (IOI20_mushrooms)C++14
25 / 100
132 ms320 KiB
#include "mushrooms.h"

#include<bits/stdc++.h>

using namespace std ;

int count_mushrooms(int n) {
    int ans = 1 ;
    for(int i = 1 ; i + 1 < n ; i += 2){

        vector<int> m = {i , 0 , i + 1};

        int a = use_machine(m);

        if(a == 0)ans += 2 ;
        if(a == 1)ans ++ ;
    }

    if(n % 2 == 0){
        if(!use_machine({0 , n - 1}))ans ++ ;

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