Submission #442860

#TimeUsernameProblemLanguageResultExecution timeMemory
442860ivandasfsGame (IOI14_game)C++14
Compilation error
0 ms0 KiB
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <map>
#include <set>
#include "game.h"

using namespace std;

#define mp make_pair
#define pb push_back
#define x first
#define y second

typedef long long ll;

const ll INF = 1e9+5;
const ll MOD = 1e9+7;

int cnt[1505];

void initialize(int n) {

}

int hasEdge(int u, int v) {
	if (u > v) swap(u, v);
	cnt[u]++;
	if (cnt[u] == n-u) return 1;
	else return 0;
}

Compilation message (stderr)

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:33:16: error: 'n' was not declared in this scope
   33 |  if (cnt[u] == n-u) return 1;
      |                ^
game.cpp:32:8: warning: control reaches end of non-void function [-Wreturn-type]
   32 |  cnt[u]++;
      |  ~~~~~~^~