Submission #713253

#TimeUsernameProblemLanguageResultExecution timeMemory
713253mseebacherGame (IOI14_game)C++17
Compilation error
0 ms0 KiB
#include "game.h"
 
//#include <bits/stdc++.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <functional>
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
 
#define mp make_pair
#define f first
#define s second
#define pb push_back
 
typedef long long ll;
typedef long double lld;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
 
const lld pi = 3.14159265358979323846;
 
vector<int> in(1505,0);
map<pair<int,int>,bool> m;
int x;
 
void initialize(int n){
	x = n;
}
 
bool hasEdge(int u,int v){
	if(in[u] >= n-1 || in[v] >= n-1) return true;
	if(m.find({u,v}) == m.end()){
		m.insert({{u,v},1});
		m.insert({{v,u},1});
		in[u]++;
	    in[v]++;
	}
	return false;
}

Compilation message (stderr)

game.cpp:48:6: error: ambiguating new declaration of 'bool hasEdge(int, int)'
   48 | bool hasEdge(int u,int v){
      |      ^~~~~~~
In file included from game.cpp:1:
game.h:5:5: note: old declaration 'int hasEdge(int, int)'
    5 | int hasEdge(int u, int v);
      |     ^~~~~~~
game.cpp: In function 'bool hasEdge(int, int)':
game.cpp:49:14: error: 'n' was not declared in this scope
   49 |  if(in[u] >= n-1 || in[v] >= n-1) return true;
      |              ^