Submission #972456

# Submission time Handle Problem Language Result Execution time Memory
972456 2024-04-30T12:49:53 Z KebabuVaikis15 Wall (IOI14_wall) C++14
Compilation error
0 ms 0 KB
#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;
}

Compilation message

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 | }
      | ^