# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
346021 | Ikkyu9541 | Counting Mushrooms (IOI20_mushrooms) | C++17 | 239 ms | 644 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 <vector>
using namespace std;
int count_mushrooms(int n) {
bool b[100005];
int ans = 1;
b[0] = 0;
vector<int> a;
a.push_back(0);
a.push_back(0);
for (int i = 1; i < n; i++){
a[0] = i-1; a[1] = i;
int u = use_machine(a);
if(u){
b[i] = !b[i-1];
}
else{
b[i] = b[i-1];
}
if(b[i] == 0) ans++;
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |