Submission #290319

#TimeUsernameProblemLanguageResultExecution timeMemory
290319AaronNaiduGame (IOI14_game)C++14
15 / 100
1 ms384 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...