Submission #856230

#TimeUsernameProblemLanguageResultExecution timeMemory
856230HakiersGame (IOI14_game)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e3 + 7;
bool edge[MAXN][MAXN];
int deg[MAXN];

int hasEdge(int u, int v){
	
	if(!edge[u][v]){
		if(min(deg[v], deg[u]) == 1)
			return 1;
		
			
		
		deg[u]--;
		deg[v]--;
		edge[u][v] = edge[v][u] = 1;
		return 0;
	}
	else{
		return 0;
	
}

void initg(int n){
	
	for(int i = 1; i <= n; i++)
		deg[i] = n-1;
		
}


void initialize(int n){
	initg(n);

}

Compilation message (stderr)

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:25:18: error: a function-definition is not allowed here before '{' token
   25 | void initg(int n){
      |                  ^
game.cpp:33:23: error: a function-definition is not allowed here before '{' token
   33 | void initialize(int n){
      |                       ^
game.cpp:36:1: error: expected '}' at end of input
   36 | }
      | ^
game.cpp:7:26: note: to match this '{'
    7 | int hasEdge(int u, int v){
      |                          ^