Submission #305372

# Submission time Handle Problem Language Result Execution time Memory
305372 2020-09-23T01:45:30 Z daniel920712 Counting Mushrooms (IOI20_mushrooms) C++14
0 / 100
1 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+1;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Incorrect 0 ms 256 KB Too small array for query.
3 Halted 0 ms 0 KB -