# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1079954 | Jawad_Akbar_JJ | Counting Mushrooms (IOI20_mushrooms) | C++17 | 0 ms | 596 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 <iostream>
#include <vector>
#include "mushrooms.h"
using namespace std;
int count_mushrooms(int n){
int A = 1;
vector<int> vec;
for (int i=1;i<n;i+=2){
if (i + 1 < n){
vec = {i, 0, i+1, 0};
int ans = use_machine(vec);
if (ans == 0)
A += 2;
else if (ans != 3)
A++;
}
else{
vec = {i, 0};
A += use_machine(vec) == 0;
}
}
return A;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |