제출 #49348

#제출 시각아이디문제언어결과실행 시간메모리
49348MoNsTeR_CuBe게임 (IOI14_game)C++17
컴파일 에러
0 ms0 KiB
#include "game.h" #include <bits/stdc++.h> vector<int> ans(0); void initialize(int n) { ans.resize(n); ans[0] = 1; ans[1] = 0; ans[2] = 0; ans[3] = 0; ans[4] = 1; ans[5] = 1; } int counter = 0; int hasEdge(int u, int v) { counter++; return ans[counter-1]; }

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

game.cpp:3:1: error: 'vector' does not name a type; did you mean 'wctob'?
 vector<int> ans(0);
 ^~~~~~
 wctob
game.cpp: In function 'void initialize(int)':
game.cpp:6:2: error: 'ans' was not declared in this scope
  ans.resize(n);
  ^~~
game.cpp:6:2: note: suggested alternative: 'abs'
  ans.resize(n);
  ^~~
  abs
game.cpp: In function 'int hasEdge(int, int)':
game.cpp:19:12: error: 'ans' was not declared in this scope
     return ans[counter-1];
            ^~~
game.cpp:19:12: note: suggested alternative: 'abs'
     return ans[counter-1];
            ^~~
            abs