제출 #380894

#제출 시각아이디문제언어결과실행 시간메모리
380894knightron0게임 (IOI14_game)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
// #include "game.h"
using namespace std;
int cnt[1503];
bool done[1506];
int N;

void initialize(int n){
	for(int i= 0;i<=n+1;i++){
		cnt[i] =0;
		done[i] = 0;
	}
	N = n;
}

int hasEdge(int u, int v){
	if((cnt[u] == N-1 && done[u] == 0) || (cnt[v] == n-1 && done[v] == 0)){
		cnt[u]++;
		cnt[v]++;
		done[u] = 1;
		done[v] = 1;
		return 1;
	}
	cnt[u]++;
	cnt[v]++;
	done[u] = 1;
	done[v] = 1;
	return 0;
}


// signed main() {
//     ios_base::sync_with_stdio(false);
//     cin.tie(NULL);
//     #ifdef LOCAL
//     freopen("input.txt", "r", stdin);
//     #endif
    
//     return 0;
// }



컴파일 시 표준 에러 (stderr) 메시지

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:17:51: error: 'n' was not declared in this scope
   17 |  if((cnt[u] == N-1 && done[u] == 0) || (cnt[v] == n-1 && done[v] == 0)){
      |                                                   ^