# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
499774 | Khizri | Counting Mushrooms (IOI20_mushrooms) | C++17 | 0 ms | 200 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
bool ask(int l,int r){
vector<int>vt;
for(int i=l;i<=r;i++){
vt.pb(i);
}
int x;
if(vt.size()>1){
x=use_machine(vt);
}
else{
x=0;
}
if(x==0){
return true;
}
return false;
}
int count_mushrooms(int n) {
int x=1;
int ans=1;
for(int i=1;i<n;i++){
if(use_machine({i,i-1})){
x=1-x;
}
ans++;
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |