제출 #764546

#제출 시각아이디문제언어결과실행 시간메모리
764546Penaldo07게임 (IOI14_game)C++17
컴파일 에러
0 ms0 KiB
#include<game.h> #include<bits/stdc++.h> using namespace std; void initialize(int n){ for(int i = 0;i < n; i++) deg[i] = n - (i + 1); } void hasEdge(int u,int v){ if(u > v) swap(u, v); if(deg[u] > 0) deg[u]--; if(deg[u] == 0) return 0; return 1; }

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

game.cpp: In function 'void initialize(int)':
game.cpp:6:30: error: 'deg' was not declared in this scope
    6 |    for(int i = 0;i < n; i++) deg[i] = n - (i + 1);
      |                              ^~~
game.cpp: At global scope:
game.cpp:9:6: error: ambiguating new declaration of 'void hasEdge(int, int)'
    9 | void 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 'void hasEdge(int, int)':
game.cpp:11:7: error: 'deg' was not declared in this scope
   11 |    if(deg[u] > 0) deg[u]--;
      |       ^~~
game.cpp:12:7: error: 'deg' was not declared in this scope
   12 |    if(deg[u] == 0) return 0;
      |       ^~~
game.cpp:12:27: error: return-statement with a value, in function returning 'void' [-fpermissive]
   12 |    if(deg[u] == 0) return 0;
      |                           ^
game.cpp:13:11: error: return-statement with a value, in function returning 'void' [-fpermissive]
   13 |    return 1;
      |           ^