제출 #419334

#제출 시각아이디문제언어결과실행 시간메모리
419334Marceantasy게임 (IOI14_game)C++17
컴파일 에러
0 ms0 KiB
#include "game.h"

void initialize(int n) {
    int deg[n];
    for(int i = 0; i<n; ++i){
        deg[i] = n;
    }
}

int hasEdge(int u, int v) {
    deg[u]--;
    deg[v]--;
    if(!deg[u] || !deg[v]){
        return 1;
    }
    return 0;
}

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

game.cpp: In function 'void initialize(int)':
game.cpp:4:9: warning: variable 'deg' set but not used [-Wunused-but-set-variable]
    4 |     int deg[n];
      |         ^~~
game.cpp: In function 'int hasEdge(int, int)':
game.cpp:11:5: error: 'deg' was not declared in this scope
   11 |     deg[u]--;
      |     ^~~