# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
351878 | tengiz05 | Counting Mushrooms (IOI20_mushrooms) | C++17 | 312 ms | 512 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"
#ifndef EVAL
#include "stub.cpp"
#endif
#include <bits/stdc++.h>
using namespace std;
int count_mushrooms(int n) {
vector<int> a(n);
a[0] = 0;
for(int i=1;i<n;i++){
vector<int> v = {i-1, i};
int x = use_machine(v);
if(x == 1)a[i] = a[i-1]^1;
else a[i] = a[i-1];
}int ans =0 ;
for(int i=0;i<n;i++){
ans += a[i]^1;
}return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |