# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
346096 | lLab_ | Counting Mushrooms (IOI20_mushrooms) | C++14 | 0 ms | 364 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;
vector<int> A = {0};
int count_mushrooms(int n) {
int sum = 1;
int p = 0;
for(int i=1;i<n/10;i++){
int d = use_machine({0,i});
if(d == 0){
A.push_back(i);
sum++;
}
if(sum == 5){
p = i;
break;
}
}
for(int i=p+1;i<n;i+=3){
vector<int> S;
for(int j=i;j<i+3;++j){
S.push_back(A[j-i]);
S.push_back(j);
}
int d = use_machine(S);
sum += A.size()-(d+1)/2;
}
return sum;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |