제출 #349247

#제출 시각아이디문제언어결과실행 시간메모리
349247David_M게임 (IOI14_game)C++14
컴파일 에러
0 ms0 KiB
int a[1505]; queue <int> q[1505]; void initialize(int n){ for (int i=2; i<=n; i++)a[i]=1; } int hasEdge(int u, int v){ int e=0; if(a[u])swap(v, u); if(!a[u]){ a[v]--; if(!a[v]){ e=1; while(!q[v].empty()){ if(a[q[v].front()])a[q[v].front()]--; q[v].pop(); } } }else q[v].push(u),q[u].push(v); return e; }

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

game.cpp:2:1: error: 'queue' does not name a type
    2 | queue <int> q[1505];
      | ^~~~~
game.cpp: In function 'int hasEdge(int, int)':
game.cpp:8:10: error: 'swap' was not declared in this scope
    8 |  if(a[u])swap(v, u);
      |          ^~~~
game.cpp:13:11: error: 'q' was not declared in this scope
   13 |    while(!q[v].empty()){
      |           ^
game.cpp:18:8: error: 'q' was not declared in this scope
   18 |  }else q[v].push(u),q[u].push(v);
      |        ^