# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
306965 | baluteshih | Counting Mushrooms (IOI20_mushrooms) | C++14 | 10 ms | 580 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;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define X first
#define Y second
#define ALL(v) v.begin(),v.end()
#define pb push_back
#define SZ(a) ((int)a.size())
const int K=90;
int count_mushrooms(int n)
{
int ans=0;
if(n<=227)
{
++ans;
for(int i=1;i<n;++i)
ans+=(use_machine({0,i})==0);
return ans;
}
srand(time(NULL));
vector<int> num(n-1,0);
vector<int> a(1,0),b;
for(int i=0;i+1<n;++i)
num[i]=i+1;
random_shuffle(ALL(num));
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |