# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
831361 | Trumling | Counting Mushrooms (IOI20_mushrooms) | C++14 | 89 ms | 324 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "mushrooms.h"
#include<bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define all(x) x.begin(),x.end()
typedef long long ll;
#define pb push_back
#define INF 9999999999999999
int count_mushrooms(int n) {
vector<int> m(3,0);
ll c2=1;
for(int i=1;i<n-1;i+=2)
{
m[0]=i;
m[2]=i+1;
int c1 = use_machine(m);
c2+=2-c1;
}
if(n%2==0)
{
m.clear();
m.assign(2,0);
m[1]=n-1;
int c1 = use_machine(m);
if(!c1)
c2++;
}
return c2;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |