# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
432623 | Andyvanh1 | Counting Mushrooms (IOI20_mushrooms) | C++14 | 12 ms | 460 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 <bits/stdc++.h>
#include "mushrooms.h"
using namespace std;
#define vt vector
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define rep(i,x) for(int (i) = 0; (i) < (x); (i)++)
typedef long long ll;
typedef long double ld;
typedef vt<int> vi;
typedef pair<int,int> pii;
int naive(int n){
int ans = 1;
for(int i = 1; i < n; i++){
ans+=use_machine({0,i})^1;
}return ans;
}
int count_mushrooms(int n){
if(n<=100)return naive(n);
int h1;
int h2;
if(n==2){
return 2-use_machine({0,1});
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |