Submission #499775

#TimeUsernameProblemLanguageResultExecution timeMemory
499775KhizriCounting Mushrooms (IOI20_mushrooms)C++17
10 / 100
205 ms328 KiB
#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; } if(x){ ans++; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...