# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
831592 | ALeonidou | Counting Mushrooms (IOI20_mushrooms) | C++17 | 91 ms | 256 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 ll int
#define F first
#define S second
#define sz(x) (ll)x.size()
#define MID ((l+r)/2)
#define pb push_back
#define dbg(x) cout<<#x<<": "<<x<<endl;
#define dbg2(x,y) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<endl;
#define dbg3(x,y,z) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<" "<<#z<<": "<<z<<endl;
#define dbg4(x,y,z,w) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<" "<<#z<<": "<<z<<" "<<#w<<": "<<w<<endl;
#define INF 1e9
typedef vector <ll> vi;
typedef pair<ll,ll> ii;
typedef vector <ii> vii;
void printVct(vi &v, string s =""){
if (sz(s) > 0) cout<<s<<": ";
for (ll i=0; i<sz(v); i++){
cout<<v[i]<<" ";
}
cout<<endl;
}
void tabb(ll n) {
for (ll i= 0; i<n; i++) cout<<"\t";
}
int count_mushrooms(int n) {
ll ans = 1;
ll u;
for (ll i=2; i<n; i+=2){
u = use_machine({i-1, 0, i});
ans += 2-u;
}
if (n%2 == 0){
u = use_machine({0, n-1});
ans += 1-u;
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |