# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
346075 | lLab_ | Counting Mushrooms (IOI20_mushrooms) | C++14 | 1 ms | 492 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;
set<int> A = {0};
set<int> B;
int N;
int cu = 1;
int recur(){
int ns = A.size()*2;
int nA = A.size();
//int S[min(nA*2,N-nA-cu+1)];
vector<int> S;
set<int>::iterator itr;
for(int i=1;i<=nA*2;++i){
if(i%2 == 1){
S.push_back(*itr);
itr++;
}
else{
S.push_back(cu);
cu++;
}
}
int ty = use_machine(S);
if(ty%2 == 1){
A.insert(ns-1);
}
return ns-((ty+1)/2)-nA;
}
int count_mushrooms(int n) {
N = n;
int sum = 1;
while(cu < n){
sum += recur();
}
return sum;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |