# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
429904 | APROHACK | Counting Mushrooms (IOI20_mushrooms) | C++14 | 318 ms | 736 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 PB push_back
int count_mushrooms(int n) {
vector<int> rta, m;
int fin = 0;
rta.PB(0);
for(int i = 0 ; i < n-1 ; i++){
if(rta.back()==0)fin++;
int ans;
m.PB(i), m.PB(i+1);
ans = use_machine(m);
if(ans){
rta.PB(abs(rta.back()-1));
}else{
rta.PB(rta.back());
}
m.pop_back();
m.pop_back();
}
if(rta.back()==0)fin++;
return fin;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |