Submission #250687

# Submission time Handle Problem Language Result Execution time Memory
250687 2020-07-18T17:38:02 Z uacoder123 Wall (IOI14_wall) C++14
Compilation error
0 ms 0 KB
    wall

    #include <stdio.h>
    #include <stdlib.h>
    #include <assert.h>
    #include "wall.h"
     
    #include <bits/stdc++.h>
    using namespace std;
    #define F first
    #define S second
    #define FOR(i,a,b) for (auto i = (a); i <= (b); ++i)
    #define NFOR(i,a,b) for(auto i = (a); i >= (b); --i)
    #define all(x) (x).begin(), (x).end()
    #define sz(x) int(x.size())
    #define mp(i,a) make_pair(i,a)
    #define pb(a) push_back(a)
    #define bit(x,b) (x&(1LL<<b))
     
    typedef long long int lli;
    typedef pair <lli,lli> ii;
    typedef pair <lli,ii> iii;
    typedef vector <lli> vi;
     
    ii segt[8000001],lazy[8000001];
    int s,e,t,h;
    ii imp(ii o,ii n)
    {
      if(o==mp(8000001*1LL,0*1LL))
        return(n);
      else if(n==mp(8000001*1LL,0*1LL))
        return(o);
      if(o.S<=n.F)
        return(mp(n.F,n.F));
      if(o.S>=n.F&&o.F<=n.F&&n.S>=o.S)
        return(mp(n.F,o.S));
      if(n.F>=o.F&&n.S<=o.S)
        return(n);
      if(o.F>=n.F&&o.S<=n.S)
        return(o);
      if(o.F>=n.F&&o.S>=n.S&&n.S>=o.F)
        return(mp(o.F,n.S));
      if(o.F>=n.S)
        return(mp(n.S,n.S));
    }
    void up(int node,int l,int r)
    {
      if(lazy[node]!=mp(8000001*1LL,0*1LL))
      {
        segt[node]=imp(segt[node],lazy[node]);
        lazy[2*node+1]=imp(lazy[2*node+1],lazy[node]);
        lazy[2*node+2]=imp(lazy[2*node+2],lazy[node]);
        lazy[node]=mp(8000001*1LL,0*1LL);
      }
      if(l>e||r<s)
        return;
      if(l>=s&&r<=e)
      {
        segt[node]=imp(segt[node],(t==1)?(mp(h,1000000)):(mp(0,h)));
        lazy[2*node+1]=imp(lazy[2*node+1],(t==1)?(mp(h,1000000)):(mp(0,h)));
        lazy[2*node+2]=imp(lazy[2*node+2],(t==1)?(mp(h,1000000)):(mp(0,h)));
        return;
      }
      int m=(l+r)/2;
      up(2*node+1,l,m);
      up(2*node+2,m+1,r);
      segt[node]=mp(min(segt[2*node+1].F,segt[2*node+2].F),max(segt[2*node+1].S,segt[2*node+2].S));
    }
    ii qu(int node,int l,int r)
    {
    if(lazy[node]!=mp(8000001*1LL,0*1LL))
      {
        segt[node]=imp(segt[node],lazy[node]);
        lazy[2*node+1]=imp(lazy[2*node+1],lazy[node]);
        lazy[2*node+2]=imp(lazy[2*node+2],lazy[node]);
        lazy[node]=mp(8000001,0);
      }
      if(l>e||r<s)
        return(mp(8000001,0));
      if(l>=s&&r<=e)
      {
        return(segt[node]);
      }
      int m=(l+r)/2;
      ii q1=qu(2*node+1,l,m),q2=qu(2*node+2,m+1,r);
      return(mp(min(q1.F,q2.F),max(q1.S,q2.S)));
    }
    void buildWall(int n, int k, int op[], int left[], int right[], int height[], int finalHeight[])
    {
      for(int i=0;i<8000001;++i)
      {
        lazy[i]=mp(8000001,0);
        segt[i]=mp(8000001,0);
      }
      for(int i=0;i<k;++i)
      {
        t=op[i];s=left[i],e=right[i],h=height[i];
        up(0,0,n-1,op[i],left[i],right[i],height[i]);
      }
      for(int i=0;i<n;++i)
      {
        s=i;e=i;
        finalHeight[i]=(qu(0,0,n-1)).F;
        if(finalHeight[i]==8000001)
          finalHeight[i]=0;
      }
      return;
    }

Compilation message

wall.cpp:2:5: error: 'wall' does not name a type; did you mean 'all'?
     wall
     ^~~~
     all
In file included from /usr/include/endian.h:60:0,
                 from /usr/include/x86_64-linux-gnu/bits/waitstatus.h:64,
                 from /usr/include/stdlib.h:42,
                 from /usr/include/c++/7/cstdlib:75,
                 from /usr/include/c++/7/stdlib.h:36,
                 from wall.cpp:5:
/usr/include/x86_64-linux-gnu/bits/byteswap.h:108:17: error: '__uint64_t' does not name a type; did you mean '__uint128_t'?
 static __inline __uint64_t
                 ^~~~~~~~~~
                 __uint128_t
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from /usr/include/c++/7/stdlib.h:36,
                 from wall.cpp:5:
/usr/include/stdlib.h:139:8: error: 'size_t' does not name a type; did you mean '__size_t'?
 extern size_t __ctype_get_mb_cur_max (void) __THROW __wur;
        ^~~~~~
        __size_t
In file included from /usr/include/stdlib.h:314:0,
                 from /usr/include/c++/7/cstdlib:75,
                 from /usr/include/c++/7/stdlib.h:36,
                 from wall.cpp:5:
/usr/include/x86_64-linux-gnu/sys/types.h:33:9: error: '__u_char' does not name a type; did you mean '__gwchar_t'?
 typedef __u_char u_char;
         ^~~~~~~~
         __gwchar_t
/usr/include/x86_64-linux-gnu/sys/types.h:34:9: error: '__u_short' does not name a type; did you mean 'short'?
 typedef __u_short u_short;
         ^~~~~~~~~
         short
/usr/include/x86_64-linux-gnu/sys/types.h:35:9: error: '__u_int' does not name a type; did you mean 'si_int'?
 typedef __u_int u_int;
         ^~~~~~~
         si_int
/usr/include/x86_64-linux-gnu/sys/types.h:36:9: error: '__u_long' does not name a type; did you mean 'long'?
 typedef __u_long u_long;
         ^~~~~~~~
         long
/usr/include/x86_64-linux-gnu/sys/types.h:37:9: error: '__quad_t' does not name a type; did you mean '__muldc3'?
 typedef __quad_t quad_t;
         ^~~~~~~~
         __muldc3
/usr/include/x86_64-linux-gnu/sys/types.h:38:9: error: '__u_quad_t' does not name a type; did you mean '__u_intN_t'?
 typedef __u_quad_t u_quad_t;
         ^~~~~~~~~~
         __u_intN_t
/usr/include/x86_64-linux-gnu/sys/types.h:39:9: error: '__fsid_t' does not name a type; did you mean '__size_t'?
 typedef __fsid_t fsid_t;
         ^~~~~~~~
         __size_t
/usr/include/x86_64-linux-gnu/sys/types.h:44:9: error: '__loff_t' does not name a type; did you mean '_IO_off_t'?
 typedef __loff_t loff_t;
         ^~~~~~~~
         _IO_off_t
/usr/include/x86_64-linux-gnu/sys/types.h:48:9: error: '__ino_t' does not name a type; did you mean '__intN_t'?
 typedef __ino_t ino_t;
         ^~~~~~~
         __intN_t
/usr/include/x86_64-linux-gnu/sys/types.h:55:9: error: '__ino64_t' does not name a type; did you mean '__intN_t'?
 typedef __ino64_t ino64_t;
         ^~~~~~~~~
         __intN_t
/usr/include/x86_64-linux-gnu/sys/types.h:60:9: error: '__dev_t' does not name a type; did you mean 'lldiv_t'?
 typedef __dev_t dev_t;
         ^~~~~~~
         lldiv_t
/usr/include/x86_64-linux-gnu/sys/types.h:65:9: error: '__gid_t' does not name a type; did you mean '_IO_uid_t'?
 typedef __gid_t gid_t;
         ^~~~~~~
         _IO_uid_t
/usr/include/x86_64-linux-gnu/sys/types.h:70:9: error: '__mode_t' does not name a type; did you mean '__size_t'?
 typedef __mode_t mode_t;
         ^~~~~~~~
         __size_t
/usr/include/x86_64-linux-gnu/sys/types.h:75:9: error: '__nlink_t' does not name a type; did you mean '__linux'?
 typedef __nlink_t nlink_t;
         ^~~~~~~~~
         __linux
/usr/include/x86_64-linux-gnu/sys/types.h:80:9: error: '__uid_t' does not name a type; did you mean '_IO_uid_t'?
 typedef __uid_t uid_t;
         ^~~~~~~
         _IO_uid_t
/usr/include/x86_64-linux-gnu/sys/types.h:98:9: error: '__pid_t' does not name a type; did you mean '__ptr_t'?
 typedef __pid_t pid_t;
         ^~~~~~~
         __ptr_t
/usr/include/x86_64-linux-gnu/sys/types.h:104:9: error: '__id_t' does not name a type; did you mean 'ldiv_t'?
 typedef __id_t id_t;
         ^~~~~~
         ldiv_t
/usr/include/x86_64-linux-gnu/sys/types.h:115:9: error: '__daddr_t' does not name a type; did you mean '__ptr_t'?
 typedef __daddr_t daddr_t;
         ^~~~~~~~~
         __ptr_t
/usr/include/x86_64-linux-gnu/sys/types.h:116:9: error: '__caddr_t' does not name a type; did you mean '__ptr_t'?
 typedef __caddr_t caddr_t;
         ^~~~~~~~~
         __ptr_t
/usr/include/x86_64-linux-gnu/sys/types.h:122:9: error: '__key_t' does not name a type; did you mean '__ptr_t'?
 typedef __key_t key_t;
         ^~~~~~~
         __ptr_t
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:132:0,
                 from /usr/include/stdlib.h:314,
                 from /usr/include/c++/7/cstdlib:75,
                 from /usr/include/c++/7/stdlib.h:36,
                 from wall.cpp:5:
/usr/include/time.h:59:9: error: '__clock_t' does not name a type; did you mean '__locale_t'?
 typedef __clock_t clock_t;
         ^~~~~~~~~
         __locale_t
/usr/include/time.h:75:9: error: '__time_t' does not name a type; did you mean '__size_t'?
 typedef __time_t time_t;
         ^~~~~~~~
         __size_t
/usr/include/time.h:91:9: error: '__clockid_t' does not name a type; did you mean '__locale_t'?
 typedef __clockid_t clockid_t;
         ^~~~~~~~~~~
         __locale_t
/usr/include/time.h:103:9: error: '__timer_t' does not name a type; did you mean '__size_t'?
 typedef __timer_t timer_t;
         ^~~~~~~~~
         __size_t
In file included from /usr/include/stdlib.h:314:0,
                 from /usr/include/c++/7/cstdlib:75,
                 from /usr/include/c++/7/stdlib.h:36,
                 from wall.cpp:5:
/usr/include/x86_64-linux-gnu/sys/types.h:136:9: error: '__useconds_t' does not name a type; did you mean '__sigandset'?
 typedef __useconds_t useconds_t;
         ^~~~~~~~~~~~
         __sigandset
/usr/include/x86_64-linux-gnu/sys/types.h:140:9: error: '__suseconds_t' does not name a type; did you mean '__sigandset'?
 typedef __suseconds_t suseconds_t;
         ^~~~~~~~~~~~~
         __sigandset
In file included from /usr/include/x86_64-linux-gnu/sys/select.h:43:0,
                 from /usr/include/x86_64-linux-gnu/sys/types.h:219,
                 from /usr/include/stdlib.h:314,
                 from /usr/include/c++/7/cstdlib:75,
                 from /usr/include/c++/7/stdlib.h:36,
                 from wall.cpp:5:
/usr/include/time.h:122:5: error: '__time_t' does not name a type; did you mean '__size_t'?
     __time_t tv_sec;  /* Seconds.  */
     ^~~~~~~~
     __size_t
/usr/include/time.h:123:5: error: '__syscall_slong_t' does not name a type
     __syscall_slong_t tv_nsec; /* Nanoseconds.  */
     ^~~~~~~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/sys/select.h:45:0,
                 from /usr/include/x86_64-linux-gnu/sys/types.h:219,
                 from /usr/include/stdlib.h:314,
                 from /usr/include/c++/7/cstdlib:75,
                 from /usr/include/c++/7/stdlib.h:36,
                 from wall.cpp:5:
/usr/include/x86_64-linux-gnu/bits/time.h:32:5: error: '__time_t' does not name a type; did you mean '__size_t'?
     __time_t tv_sec;  /* Seconds.  */
     ^~~~~~~~
     __size_t
/usr/include/x86_64-linux-gnu/bits/time.h:33:5: error: '__suseconds_t' does not name a type; did you mean '__sigandset'?
     __suseconds_t tv_usec; /* Microseconds.  */
     ^~~~~~~~~~~~~
     __sigandset
In file included from /usr/include/stdlib.h:314:0,
                 from /usr/include/c++/7/cstdlib:75,
                 from /usr/include/c++/7/stdlib.h:36,
                 from wall.cpp:5:
/usr/include/x86_64-linux-gnu/sys/types.h:228:9: error: '__blksize_t' does not name a type; did you mean '__size_t'?
 typedef __blksize_t blksize_t;
         ^~~~~~~~~~~
         __size_t
/usr/include/x86_64-linux-gnu/sys/types.h:235:9: error: '__blkcnt_t' does not name a type; did you mean '__sigset_t'?
 typedef __blkcnt_t blkcnt_t;  /* Type to count number of disk blocks.  */
         ^~~~~~~~~~
         __sigset_t
/usr/include/x86_64-linux-gnu/sys/types.h:239:9: error: '__fsblkcnt_t' does not name a type; did you mean '__sigset_t'?
 typedef __fsblkcnt_t fsblkcnt_t; /* Type to count file system blocks.  */
         ^~~~~~~~~~~~
         __sigset_t
/usr/include/x86_64-linux-gnu/sys/types.h:243:9: error: '__fsfilcnt_t' does not name a type; did you mean '__sigset_t'?
 typedef __fsfilcnt_t fsfilcnt_t; /* Type to count file system inodes.  */
         ^~~~~~~~~~~~
         __sigset_t
/usr/include/x86_64-linux-gnu/sys/types.h:262:9: error: '__blkcnt64_t' does not name a type; did you mean 'u_int64_t'?
 typedef __blkcnt64_t blkcnt64_t;     /* Type to count number of disk blocks. */
         ^~~~~~~~~~~~
         u_int64_t
/usr/include/x86_64-linux-gnu/sys/types.h:263:9: error: '__fsblkcnt64_t' does not name a type; did you mean 'u_int64_t'?
 typedef __fsblkcnt64_t fsblkcnt64_t; /* Type to count file system blocks.  */
         ^~~~~~~~~~~~~~
         u_int64_t
/usr/include/x86_64-linux-gnu/sys/types.h:264:9: error: '__fsfilcnt64_t' does not name a type; did you mean 'u_int64_t'?
 typedef __fsfilcnt64_t fsfilcnt64_t; /* Type to count file system inodes.  */
         ^~~~~~~~~~~~~~
         u_int64_t
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from /usr/include/c++/7/stdlib.h:36,
                 from wall.cpp:5:
/usr/include/stdlib.h:331:4: error: 'size_t' has not been declared
    size_t __statelen) __THROW __nonnull ((2));
    ^~~~~~
/usr/include/stdlib.h:361:4: error: 'size_t' has not been declared
    size_t __statelen,
    ^~~~~~
/usr/include/stdlib.h:466:22: error: 'size_t' was not declared in this scope
 extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
                      ^~~~~~
/usr/include/stdlib.h:466:22: note: suggested alternative:
In file included from /usr/include/c++/7/cstdlib:41:0,
                 from /usr/include/c++/7/stdlib.h:36,
                 from wall.cpp:5:
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   'std::size_t'
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from /usr/include/c++/7/stdlib.h:36,
                 from wall.cpp:5:
/usr/include/stdlib.h:468:22: error: 'size_t' was not declared in this scope
 extern void *calloc (size_t __nmemb, size_t __size)
                      ^~~~~~
/usr/include/stdlib.h:468:22: note: suggested alternative:
In file included from /usr/include/c++/7/cstdlib:41:0,
                 from /usr/include/c++/7/stdlib.h:36,
                 from wall.cpp:5:
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   'std::size_t'
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from /usr/include/c++/7/stdlib.h:36,
                 from wall.cpp:5:
/usr/include/stdlib.h:468:38: error: 'size_t' was not declared in this scope
 extern void *calloc (size_t __nmemb, size_t __size)
                                      ^~~~~~
/usr/include/stdlib.h:468:38: note: suggested alternative:
In file included from /usr/include/c++/7/cstdlib:41:0,
                 from /usr/include/c++/7/stdlib.h:36,
                 from wall.cpp:5:
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   'std::size_t'
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from /usr/include/c++/7/stdlib.h:36,
                 from wall.cpp:5:
/usr/include/stdlib.h:468:51: error: expression list treated as compound expression in initializer [-fpermissive]
 extern void *calloc (size_t __nmemb, size_t __size)
                                                   ^
/usr/include/stdlib.h:480:36: error: 'size_t' has not been declared
 extern void *realloc (void *__ptr, size_t __size)
                                    ^~~~~~
In file included from /usr/include/stdlib.h:492:0,
                 from /usr/include/c++/7/cstdlib:75,
                 from /usr/include/c++/7/stdlib.h:36,
                 from wall.cpp:5:
/usr/include/alloca.h:32:22: error: 'size_t' was not declared in this scope
 extern void *alloca (size_t __size) __THROW;
                      ^~~~~~
/usr/include/alloca.h:32:22: note: suggested alternative:
In file included from /usr/include/c++/7/cstdlib:41:0,
                 from /usr/include/c++/7/stdlib.h:36,
                 from wall.cpp:5:
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   'std::size_t'
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from /usr/include/c++/7/stdlib.h:36,
                 from wall.cpp:5:
/usr/include/stdlib.h:498:22: error: 'size_t' was not declared in this scope
 extern void *valloc (size_t __size) __THROW __attribute_malloc__ __wur;
                      ^~~~~~
/usr/include/stdlib.h:498:22: note: suggested alternative:
In file included from /usr/include/c++/7/cstdlib:41:0,
                 from /usr/include/c++/7/stdlib.h:36,
                 from wall.cpp:5:
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   'std::size_t'
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from /usr/include/c++/7/stdlib.h:36,
                 from wall.cpp:5:
/usr/include/stdlib.h:503:45: error: 'size_t' has not been declared
 extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
                                             ^~~~~~
/usr/include/stdlib.h:503:65: error: 'size_t' has not been declared
 extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
                                                                 ^~~~~~
/usr/include/stdlib.h:509:29: error: 'size_t' was not declared in this scope
 extern void *aligned_alloc (size_t __alignment, size_t __size)
                             ^~~~~~
/usr/include/stdlib.h:509:29: note: suggested alternative:
In file included from /usr/include/c++/7/cstdlib:41:0,
                 from /usr/include/c++/7/stdlib.h:36,
                 from wall.cpp:5:
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   'std::size_t'
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from /usr/include/c++/7/stdlib.h:36,
                 from wall.cpp:5:
/usr/include/stdlib.h:509:49: error: 'size_t' was not declared in this scope
 extern void *aligned_alloc (size_t __alignment, size_t __size)
                                                 ^~~~~~
/usr/include/stdlib.h:509:49: note: suggested alternative:
In file included from /usr/include/c++/7/cstdlib:41:0,
                 from /usr/include/c++/7/stdlib.h:36,
                 from wall.cpp:5:
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   'std::size_t'
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from /usr/include/c++/7/stdlib.h:36,
                 from wall.cpp:5:
/usr/include/stdlib.h:509:62: error: expression list treated as compound expression in initializer [-fpermissive]
 extern void *aligned_alloc (size_t __alignment, size_t __size)
                                                              ^
/usr/include/stdlib.h:755:9: error: 'size_t' has not been declared
         size_t __nmemb, size_t __size, __compar_fn_t __compar)
         ^~~~~~
/usr/include/stdlib.h:755:25: error: 'size_t' has not been declared
         size_t __nmemb, size_t __size, __compar_fn_t __compar)
                         ^~~~~~
In file included from /usr/include/stdlib.h:759:0,
                 from /usr/include/c++/7/cstdlib:75,
                 from /usr/include/c++/7/stdlib.h:36,
                 from wall.cpp:5:
/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:20:49: error: 'size_t' has not been declared
 bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size,
                                                 ^~~~~~
/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:20:65: error: 'size_t' has not been declared
 bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size,
                                                                 ^~~~~~
/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h: In function 'void* bsearch(const void*, const void*, int, int, __compar_fn_t)':
/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:23:3: error: 'size_t' was not declared in this scope
   size_t __l, __u, __idx;
   ^~~~~~
/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:23:3: note: suggested alternative:
In file included from /usr/include/c++/7/cstdlib:41:0,
                 from /usr/include/c++/7/stdlib.h:36,
                 from wall.cpp:5:
/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:231:26: note:   'std::size_t'
   typedef __SIZE_TYPE__  size_t;
                          ^~~~~~
In file included from /usr/include/stdlib.h:759:0,
                 from /usr/include/c++/7/cstdlib:75,
                 from /usr/include/c++/7/stdlib.h:36,
                 from wall.cpp:5:
/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:27:3: error: '__l' was not declared in this scope
   __l = 0;
   ^~~
/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:27:3: note: suggested alternative: '__p'
   __l = 0;
   ^~~
   __p
/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:28:3: error: '__u' was not declared in this scope
   __u = __nmemb;
   ^~~
/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:28:3: note: suggested alternative: '__p'
   __u = __nmemb;
   ^~~
   __p
/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:31:7: error: '__idx' was not declared in this scope
       __idx = (__l + __u) / 2;
       ^~~~~
In file included from /usr/include/c++/7/cstdlib:75:0,
                 from /usr/include/c++/7/stdlib.h:36,
                 from wall.cpp:5:
/usr/include/stdlib.h: At global scope:
/usr/include/stdlib.h:764:34: error: 'size_t' has not been declared
 extern void qsort (void *__base, size_t __nmemb, size_t __size,
                                  ^~~~~~
/usr/include/stdlib.h:764:50: error: 'size_t' has not been declared
 extern void qsort (void *__base, size_t __nmemb, size_t __size,
                                                  ^~~~~~
/usr/include/stdlib.h:767:36: error: 'size_t' has not been declared
 extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
                                    ^~~~~~
/usr/include/stdlib.h:767:52: error: 'size_t' has not been declared
 extern void qsort_r (void *__base, size_t __nmemb, size_t __size,
                                                    ^~~~~~
/usr/include/stdlib.h:843:6: error: 'size_t' has not been declared
      size_t __len) __THROW __nonnull ((3, 4, 5));
      ^~~~~~
/usr/include/stdlib.h:846:6: error: 'siz