Submission #305371

# Submission time Handle Problem Language Result Execution time Memory
305371 2020-09-23T01:44:29 Z daniel920712 Counting Mushrooms (IOI20_mushrooms) C++14
0 / 100
0 ms 256 KB
#include "mushrooms.h"
#include <vector>
using namespace std;
int count_mushrooms(int n)
{
    int ans=0,t;
	vector<int> m;
	vector<int> fin;
	for (int i=1; i<n;i+=2)
    {
        m.clear();
        m.push_back(0);
        m.push_back(i);
        if(i+1==n) ans+=use_machine(m);
        else
        {
            m.push_back(i+1);
            t=use_machine(m);
            if(t==2) ans++;
            else if(t==1)
            {
                fin.push_back(i);
                fin.push_back(i+1);
            }
        }
    }
    ans+=(use_machine(fin)+1)/2;
	return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Answer is not correct.
2 Halted 0 ms 0 KB -