Submission #421348

#TimeUsernameProblemLanguageResultExecution timeMemory
421348dxz05버섯 세기 (IOI20_mushrooms)C++14
25 / 100
130 ms288 KiB
#include "mushrooms.h"
#include <bits/stdc++.h>

using namespace std;

int count_mushrooms(int n) {
	int ans = 1;
	for (int i = 1; i < n; i += 2){
        vector<int> v = {i, 0, i + 1};
        if (v.back() == n) v.pop_back();
        int x = use_machine(v);

        if (v.size() == 2){
            if (x == 0) ans++;
        } else {
            if (x == 0) ans += 2;
            if (x == 1) ans++;
        }

	}

/**
    AAA
    AAB
    BAA
    BAB
**/

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