# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
830166 | Edu175 | Counting Mushrooms (IOI20_mushrooms) | C++17 | 95 ms | 208 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>
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |