Submission #349250

# Submission time Handle Problem Language Result Execution time Memory
349250 2021-01-17T09:10:11 Z David_M Game (IOI14_game) C++14
Compilation error
0 ms 0 KB
#include "game.h"
#include <algorithm>
#include <queue> 
using namespace std;

int a[1505];
bool b[1501][1501];
void initialize(int n){ for (int i=2; i<=n; i++)a[i]=1; }
int hasEdge(int u, int v){
	int e=0;
	if(a[u])swap(v, u);
	if(!a[u]){
		a[v]--;
		if(!a[v]) for (int i=1; i<=n; i++)a[i]+=(!b[v][i]&&(i!=v));
	}else b[v][u]=b[u][v]=1;
	
	return e;
}

Compilation message

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:14:30: error: 'n' was not declared in this scope
   14 |   if(!a[v]) for (int i=1; i<=n; i++)a[i]+=(!b[v][i]&&(i!=v));
      |                              ^