# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
346105 | poom2904 | Counting Mushrooms (IOI20_mushrooms) | C++17 | 2 ms | 384 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;
int cnt_A = 1,cnt_B = 0;
vector<int> A = {0},B;
int count_mushrooms(int n) {
int i=1;
if(n<=227)
{
while(i<n)
{
vector<int> vec = {0,i};
if(use_machine(vec))cnt_B++;
else cnt_A++;
i++;
}
return cnt_A;
}
/*while(max(cnt_A,cnt_B)<2)
{
vector<int> vec = {0,i};
if(use_machine(vec))
{
cnt_B++;
B.push_back(i);
}
else
{
cnt_A++;
A.push_back(i);
}
i++;
}
while(min(cnt_A,cnt_B)<2 && max(cnt_A,cnt_B)<3)
{
bool is_swapped = false;
if(cnt_A<2)
{
swap(cnt_A,cnt_B);
swap(A,B);
is_swapped = true;
}
vector<int> vec = {i,A[0],i+1,A[1]};
int res = use_machine(vec);
}*/
return cnt_A;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |