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>
using namespace std;
int queriesDone;
bool lastTwo;
bool firstTwo[4];
int hasEdge(int u, int v) {
queriesDone++;
if (queriesDone == 0)
{
for (int i = 0; i < 4; i++)
{
if (i == u or i == v)
{
firstTwo[i] = true;
}
}
return 1;
}
if (!firstTwo[u] and !firstTwo[v])
{
lastTwo = true;
return 1;
}
if (queriesDone == 4)
{
if (lastTwo)
{
return 0;
}
return 1;
}
return 0;
}
void initialize(int n) {
queriesDone = -1;
lastTwo = false;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |