# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
901971 | Faisal_Saqib | Game (IOI14_game) | C++17 | 1 ms | 348 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.
// #pragma once
#include <map>
#include "game.h"
using namespace std;
const int N=100;
int deg[N];
map<pair<int,int>,int> done;
int l=0;
void initialize(int n)
{
l=(n*(n-1))/2;
done.clear();
for(int i=0;i<=n;i++)
deg[i]=n-1;
}
int hasEdge(int u, int v)
{
l--;
if(l==0)
return 0;
if(done.find({u,v})==done.end())
{
deg[u]--;
deg[v]--;
if(deg[u]==0 or deg[v]==0)
{
done[{u,v}]=done[{v,u}]=1;
}
else
{
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |