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 "game.h"
#include <vector>
using namespace std;
vector<int> counter;
int n, times = 0;
pair<int, int> start;
bool wasPair = false;
void initialize(int _n)
{
counter.resize(n + 1);
n = _n;
}
int hasEdge(int u, int v)
{
++times;
if (u > v) swap(u, v);
if (times == 1)
{
start = {u, v};
return 1;
}
if (times == 5)
{
if (wasPair) return 0;
return 1;
}
if (u != start.first && u != start.second && v != start.first && v != start.second)
{
wasPair = true;
return 1;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |