Submission #830166

#TimeUsernameProblemLanguageResultExecution timeMemory
830166Edu175Counting Mushrooms (IOI20_mushrooms)C++17
25 / 100
95 ms208 KiB
#include "mushrooms.h" #include <bits/stdc++.h> #define pb push_back #define fst first #define snd second #define fore(i,a,b) for(ll i=a,ioi=b;i<ioi;i++) #define SZ(x) ((int)x.size()) #define ALL(x) x.begin(),x.end() #define mset(a,v) memset((a),(v),sizeof(a)) #define imp(v) for(auto dfh:v)cout<<dfh<<" ";cout<<"\n" using namespace std; typedef long long ll; typedef pair<ll,ll> ii; ll ask(vector<ll>a){ vector<int>ai; for(auto i:a)ai.pb(i); return use_machine(ai); } int count_mushrooms(int n){ ll res=1; for(ll i=1;i<n;i+=2){ if(i==n-1)res+=1-ask({0,i}); else res+=2-ask({i,0,i+1}); } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...