Submission #299467

#TimeUsernameProblemLanguageResultExecution timeMemory
299467dCodingGame (IOI14_game)C++17
0 / 100
1 ms384 KiB
#include <bits/stdc++.h>
#include "game.h"
using namespace std;

int called[1505];
int done[1505];
int n;

void initialize(int _n) {
	n = _n;
}
int hasEdge(int u, int v) {
	++called[u]; ++called[v];
	if(done[u] == 0 && called[u] == n-1) {
		++done[u]; ++done[v];
		return 1;
	}
	if(done[v] == 0 && called[v] == n-1) {
		++done[u]; ++done[v];
		return 1;
	}
	if(called[u] == n-1 && done[u] == n-2) return 0;
	if(called[v] == n-1 && done[v] == n-2) return 0;
}

Compilation message (stderr)

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:24:1: warning: control reaches end of non-void function [-Wreturn-type]
   24 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...