제출 #972456

#제출 시각아이디문제언어결과실행 시간메모리
972456KebabuVaikis15Wall (IOI14_wall)C++14
컴파일 에러
0 ms0 KiB
#include "wall.h" class v { int k, d, kval, dval; v* kv; v* dv; }; int cur=0; vector<int> medis; v* konstruok(int k, int d) { dab=&medis[cur]; cur++; dab->k=k; dab->d=d; dab->kval=0; dab->dval=0; if (k==d) return; dab->kv=konstruok(k, (k+d)/2); dab->dv=konstruok((k+d)/2+1, d); } void rask(int k, int d) { } void keisk(int op, int k, int d) { } void buildWall(int n, int k, int op[], int left[], int right[], int height[], int finalHeight[]) { konstruot(1, n); return; }

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

wall.cpp:10:1: error: 'vector' does not name a type
   10 | vector<int> medis;
      | ^~~~~~
wall.cpp: In function 'v* konstruok(int, int)':
wall.cpp:14:5: error: 'dab' was not declared in this scope
   14 |     dab=&medis[cur];
      |     ^~~
wall.cpp:14:10: error: 'medis' was not declared in this scope
   14 |     dab=&medis[cur];
      |          ^~~~~
wall.cpp:21:9: error: return-statement with no value, in function returning 'v*' [-fpermissive]
   21 |         return;
      |         ^~~~~~
wall.cpp: In function 'void buildWall(int, int, int*, int*, int*, int*, int*)':
wall.cpp:38:5: error: 'konstruot' was not declared in this scope; did you mean 'konstruok'?
   38 |     konstruot(1, n);
      |     ^~~~~~~~~
      |     konstruok
wall.cpp: In function 'v* konstruok(int, int)':
wall.cpp:24:1: warning: control reaches end of non-void function [-Wreturn-type]
   24 | }
      | ^