# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
600558 | kig9981 | Counting Mushrooms (IOI20_mushrooms) | C++17 | 10 ms | 464 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>
#ifdef NON_SUBMIT
#define TEST(n) (n)
#define tout cerr
#else
#define TEST(n) ((void)0)
#define tout cin
#endif
using namespace std;
vector<int> A, B, Q;
int D[3];
void query1()
{
int a=Q.back(), b, r; Q.pop_back();
b=Q.back(); Q.pop_back();
if(A.size()>1) {
r=use_machine({A[0],a,A[1],b});
if(r&1) B.push_back(b);
else A.push_back(b);
if(r>1) B.push_back(a);
else A.push_back(a);
}
else {
r=use_machine({B[0],a,B[1],b});
if(r&1) A.push_back(b);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |