# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
346208 | SecretK | Counting Mushrooms (IOI20_mushrooms) | C++14 | 1 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"
int count_mushrooms(int n) {
std::vector<int> m;
int a = 0,t;
int ans = 1;
for (int i = 1; i < n-1; i+=3){
m = {i-1};
for(int j = i;j < i+2;j++){
m.push_back(j);
}
t = use_machine(m);
if(t == 0){
if(!a) ans += 3;
}
if(t == 2){
if(a){
ans++;
a = (a+1)%2;
}
else {
ans += 2;
a = (a+1)%2;
}
}
if(t == 1){
t = use_machine({i-1,i});
if(t && a) ans++;
if(t && !a) ans += 2;
if(!t && a) ans++;
if(!t && !a) ans += 2;
a = (a+1)%2;
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |