Submission #810997

# Submission time Handle Problem Language Result Execution time Memory
810997 2023-08-06T19:15:43 Z rainboy Nestabilnost (COI23_nestabilnost) C
Compilation error
0 ms 0 KB
=#include <stdio.h>
#include <stdlib.h>
 
#define N	300000
#define LN	19	/* LN = ceil(log2(N)) */
#define N_	(1 << LN)
#define N1	(N * ((LN + 1) * 2 + 4))
#define INF	0x3f3f3f3f3f3f3f3fLL
 
long long min(long long a, long long b) { return a < b ? a : b; }
long long max(long long a, long long b) { return a > b ? a : b; }
 
int n;
int aa[N], cc[N];
int *ej[N], eo[N];
 
void append(int i, int j) {
	int o = eo[i]++;
 
	if (o >= 2 && (o & o - 1) == 0)
		ej[i] = (int *) realloc(ej[i], o * 2 * sizeof *ej[i]);
	ej[i][o] = j;
}
 
int cc_[N_ * 2];
 
void build(int k, int l, int r) {
	int m;
 
	if (r - l == 1) {
		cc_[k] = cc[l];
		return;
	}
	m = (l + r) / 2;
	build(k << 1 | 0, l, m), build(k << 1 | 1, m, r);
	cc_[k] = min(cc_[k << 1 | 0], cc_[k << 1 | 1]);
}
 
int ll[N1], rr[N1]; long long xx1[N1], xx2[N1], yy[N1], lz1[N1], lz2[N1]; int cc1[N1];
 
int node(int k, long long x) {
	static int _ = 1;
 
	xx1[_] = x, xx2[_] = -INF, yy[_] = INF, cc1[_] = cc_[k];
	return _++;
}
 
void put1(int u, long long z) {
	xx1[u] += z;
	lz1[u] += z;
}
 
void put2(int u, long long z) {
	xx1[u] += z;
	if (xx2[u] != -INF)
		xx2[u] += z;
	if (yy[u] != INF)
		yy[u] += z;
	lz2[u] += z;
}
 
void pus(int u) {
	int l, r;
	long long z;
	
	l = ll[u], r = rr[u];
	if (z = lz1[u]) {
		if (xx1[l] > xx1[r])
			put1(l, z);
		else if (xx1[l] < xx1[r])
			put1(r, z);
		else
			put1(l, z), put1(r, z);
		lz1[u] = 0;
	}
	if (z = lz2[u]) {
		put2(l, z), put2(r, z);
		lz2[u] = 0;
	}
}
 
void pul(int u) {
	int l = ll[u], r = rr[u];
	
	if (xx1[l] > xx1[r]) {
		xx1[u] = xx1[l], xx2[u] = max(xx2[l], xx1[r]);
		yy[u] = min(yy[l], min(xx1[r] + cc1[r], yy[r]));
		cc1[u] = cc1[l];
	} else if (xx1[l] < xx1[r]) {
		xx1[u] = xx1[r], xx2[u] = max(xx1[l], xx2[r]);
		yy[u] = min(min(xx1[l] + cc1[l], yy[l]), yy[r]);
		cc1[u] = cc1[r];
	} else {
		xx1[u] = xx1[l], xx2[u] = max(xx2[l], xx2[r]);
		yy[u] = min(yy[l], yy[r]);
		cc1[u] = min(cc1[l], cc1[r]);
	}
	if (xx2[u] == -INF)
		ll[u] = rr[u] = 0;
}
 
int merge(int u, int v) {
	if (xx2[u] == -INF) {
		put2(v, xx1[u]);
		return v;
	} else if (xx2[v] == -INF) {
		put2(u, xx1[v]);
		return u;
	} else {
		pus(u), pus(v);
		ll[u] = merge(ll[u], ll[v]), rr[u] = merge(rr[u], rr[v]);
		pul(u);
		return u;
	}
}
 
int cut_(int k, int l, int r, int ql, int qr, long long x) {
	int u, m;
 
	if (ql <= l && r <= qr)
		return node(k, x);
	if (qr <= l || r <= ql)
		return node(k, INF);
	u = node(k, INF);
	m = (l + r) / 2;
	ll[u] = cut_(k << 1 | 0, l, m, ql, qr, x), rr[u] = cut_(k << 1 | 1, m, r, ql, qr, x);
	pul(u);
	return u;
}
 
int cut(int u, int k, int l, int r, int ql, int qr) {
	int m;
 
	if (ql <= l && r <= qr)
		return u;
	if (qr <= l || r <= ql)
		return node(k, INF);
	if (xx2[u] == -INF)
		return cut_(k, l, r, ql, qr, xx1[u]);
	m = (l + r) / 2;
	pus(u);
	ll[u] = cut(ll[u], k << 1 | 0, l, m, ql, qr), rr[u] = cut(rr[u], k << 1 | 1, m, r, ql, qr);
	pul(u);
	return u;
}
 
void update(int u, int l, int r, long long x) {
	int m;
 
	if (xx1[u] <= x)
		return;
	if (xx2[u] < x) {
		put1(u, x - xx1[u]);
		return;
	}
	m = (l + r) / 2;
	pus(u);
	update(ll[u], l, m, x), update(rr[u], m, r, x);
	pul(u);
}
 
int tt[N]; long long dp[N];
 
void dfs(int p, int i) {
	int o;
 
	tt[i] = node(1, 0);
	for (o = eo[i]; o--; ) {
		int j = ej[i][o];
 
		if (j != p) {
			dfs(i, j);
			tt[i] = merge(tt[i], tt[j]);
		}
	}
	tt[i] = cut(tt[i], 1, 0, n, aa[i], n);
	dp[i] = min(xx1[tt[i]] + cc1[tt[i]], yy[tt[i]]);
	if (p != -1 && aa[p] != aa[i] - 1) {
		if (aa[i] == 0)
			tt[i] = cut(tt[i], 1, 0, n, aa[p], aa[p] + 1);
		else
			tt[i] = node(1, INF);
	}
	update(tt[i], 0, n, dp[i]);
}
 
int main() {
	int h, i, j;
 
	scanf("%d", &n);
	for (i = 0; i < n; i++)
		scanf("%d", &aa[i]);
	for (i = 0; i < n; i++)
		scanf("%d", &cc[i]);
	build(1, 0, n);
	for (i = 0; i < n; i++)
		ej[i] = (int *) malloc(2 * sizeof *ej[i]);
	for (h = 0; h < n - 1; h++) {
		scanf("%d%d", &i, &j), i--, j--;
		append(i, j), append(j, i);
	}
	dfs(-1, 0);
	printf("%lld\n", dp[0]);
	return 0;
}

Compilation message

code1.c:1:1: error: expected identifier or '(' before '=' token
    1 | =#include <stdio.h>
      | ^
code1.c:1:2: error: stray '#' in program
    1 | =#include <stdio.h>
      |  ^
In file included from code1.c:2:
/usr/include/stdlib.h:97:8: error: unknown type name 'size_t'
   97 | extern size_t __ctype_get_mb_cur_max (void) __THROW __wur;
      |        ^~~~~~
In file included from code1.c:2:
/usr/include/stdlib.h:411:4: error: unknown type name 'size_t'
  411 |    size_t __statelen) __THROW __nonnull ((2));
      |    ^~~~~~
/usr/include/stdlib.h:395:1: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
  394 | # include <sys/types.h> /* we need int32_t... */
  +++ |+#include <stddef.h>
  395 | 
/usr/include/stdlib.h:441:4: error: unknown type name 'size_t'
  441 |    size_t __statelen,
      |    ^~~~~~
/usr/include/stdlib.h:441:4: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/stdlib.h:539:22: error: unknown type name 'size_t'
  539 | extern void *malloc (size_t __size) __THROW __attribute_malloc__
      |                      ^~~~~~
/usr/include/stdlib.h:539:22: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/stdlib.h:542:22: error: unknown type name 'size_t'
  542 | extern void *calloc (size_t __nmemb, size_t __size)
      |                      ^~~~~~
/usr/include/stdlib.h:542:22: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/stdlib.h:542:38: error: unknown type name 'size_t'
  542 | extern void *calloc (size_t __nmemb, size_t __size)
      |                                      ^~~~~~
/usr/include/stdlib.h:542:38: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/stdlib.h:550:36: error: unknown type name 'size_t'
  550 | extern void *realloc (void *__ptr, size_t __size)
      |                                    ^~~~~~
/usr/include/stdlib.h:550:36: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/stdlib.h:559:41: error: unknown type name 'size_t'
  559 | extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
      |                                         ^~~~~~
/usr/include/stdlib.h:559:41: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/stdlib.h:559:57: error: unknown type name 'size_t'
  559 | extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size)
      |                                                         ^~~~~~
/usr/include/stdlib.h:559:57: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
In file included from /usr/include/stdlib.h:568,
                 from code1.c:2:
/usr/include/alloca.h:32:22: error: unknown type name 'size_t'
   32 | extern void *alloca (size_t __size) __THROW;
      |                      ^~~~~~
/usr/include/alloca.h:25:1: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
   24 | #include <stddef.h>
  +++ |+#include <stddef.h>
   25 | 
In file included from code1.c:2:
/usr/include/stdlib.h:574:22: error: unknown type name 'size_t'
  574 | extern void *valloc (size_t __size) __THROW __attribute_malloc__
      |                      ^~~~~~
/usr/include/stdlib.h:574:22: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/stdlib.h:580:45: error: unknown type name 'size_t'
  580 | extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
      |                                             ^~~~~~
/usr/include/stdlib.h:580:45: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/stdlib.h:580:65: error: unknown type name 'size_t'
  580 | extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
      |                                                                 ^~~~~~
/usr/include/stdlib.h:580:65: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/stdlib.h:586:29: error: unknown type name 'size_t'
  586 | extern void *aligned_alloc (size_t __alignment, size_t __size)
      |                             ^~~~~~
/usr/include/stdlib.h:586:29: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/stdlib.h:586:49: error: unknown type name 'size_t'
  586 | extern void *aligned_alloc (size_t __alignment, size_t __size)
      |                                                 ^~~~~~
/usr/include/stdlib.h:586:49: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/stdlib.h:821:9: error: unknown type name 'size_t'
  821 |         size_t __nmemb, size_t __size, __compar_fn_t __compar)
      |         ^~~~~~
/usr/include/stdlib.h:821:9: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/stdlib.h:821:25: error: unknown type name 'size_t'
  821 |         size_t __nmemb, size_t __size, __compar_fn_t __compar)
      |                         ^~~~~~
/usr/include/stdlib.h:821:25: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
In file included from /usr/include/stdlib.h:825,
                 from code1.c:2:
/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:20:49: error: unknown type name 'size_t'
   20 | bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size,
      |                                                 ^~~~~~
/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:1:1: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
  +++ |+#include <stddef.h>
    1 | /* Perform binary search - inline version.
/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:20:65: error: unknown type name 'size_t'
   20 | 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: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
In file included from code1.c:2:
/usr/include/stdlib.h:830:34: error: unknown type name 'size_t'
  830 | extern void qsort (void *__base, size_t __nmemb, size_t __size,
      |                                  ^~~~~~
/usr/include/stdlib.h:830:34: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/stdlib.h:830:50: error: unknown type name 'size_t'
  830 | extern void qsort (void *__base, size_t __nmemb, size_t __size,
      |                                                  ^~~~~~
/usr/include/stdlib.h:830:50: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/stdlib.h:904:6: error: unknown type name 'size_t'
  904 |      size_t __len) __THROW __nonnull ((3, 4, 5));
      |      ^~~~~~
/usr/include/stdlib.h:904:6: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/stdlib.h:907:6: error: unknown type name 'size_t'
  907 |      size_t __len) __THROW __nonnull ((3, 4, 5));
      |      ^~~~~~
/usr/include/stdlib.h:907:6: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/stdlib.h:911:31: error: unknown type name 'size_t'
  911 |       char *__restrict __buf, size_t __len)
      |                               ^~~~~~
/usr/include/stdlib.h:911:31: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/stdlib.h:915:31: error: unknown type name 'size_t'
  915 |       char *__restrict __buf, size_t __len)
      |                               ^~~~~~
/usr/include/stdlib.h:915:31: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/stdlib.h:922:36: error: unknown type name 'size_t'
  922 | extern int mblen (const char *__s, size_t __n) __THROW;
      |                                    ^~~~~~
/usr/include/stdlib.h:922:36: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/stdlib.h:926:34: error: unknown type name 'size_t'
  926 |      const char *__restrict __s, size_t __n) __THROW;
      |                                  ^~~~~~
/usr/include/stdlib.h:926:34: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/stdlib.h:933:8: error: unknown type name 'size_t'
  933 | extern size_t mbstowcs (wchar_t *__restrict  __pwcs,
      |        ^~~~~~
/usr/include/stdlib.h:934:32: error: unknown type name 'size_t'
  934 |    const char *__restrict __s, size_t __n) __THROW;
      |                                ^~~~~~
/usr/include/stdlib.h:934:32: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/stdlib.h:936:8: error: unknown type name 'size_t'
  936 | extern size_t wcstombs (char *__restrict __s,
      |        ^~~~~~
/usr/include/stdlib.h:937:38: error: unknown type name 'size_t'
  937 |    const wchar_t *__restrict __pwcs, size_t __n)
      |                                      ^~~~~~
/usr/include/stdlib.h:937:38: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
In file included from /usr/include/stdlib.h:1017,
                 from code1.c:2:
/usr/include/x86_64-linux-gnu/bits/stdlib.h:25:9: error: unknown type name 'size_t'
   25 |         size_t __resolvedlen) __THROW __wur;
      |         ^~~~~~
/usr/include/x86_64-linux-gnu/bits/stdlib.h:1:1: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
  +++ |+#include <stddef.h>
    1 | /* Checking macros for stdlib functions.
In file included from /usr/include/features.h:461,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdlib.h:25,
                 from code1.c:2:
/usr/include/x86_64-linux-gnu/bits/stdlib.h:29:14: error: unknown type name 'size_t'
   29 | extern char *__REDIRECT_NTH (__realpath_chk_warn,
      |              ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/stdlib.h:29:14: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
In file included from /usr/include/stdlib.h:1017,
                 from code1.c:2:
/usr/include/x86_64-linux-gnu/bits/stdlib.h: In function 'realpath':
/usr/include/x86_64-linux-gnu/bits/stdlib.h:39:30: error: 'size_t' undeclared (first use in this function)
   39 |   if (__bos (__resolved) != (size_t) -1)
      |                              ^~~~~~
/usr/include/x86_64-linux-gnu/bits/stdlib.h:39:30: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/x86_64-linux-gnu/bits/stdlib.h:39:30: note: each undeclared identifier is reported only once for each function it appears in
/usr/include/x86_64-linux-gnu/bits/stdlib.h: At top level:
/usr/include/x86_64-linux-gnu/bits/stdlib.h:52:52: error: unknown type name 'size_t'
   52 | extern int __ptsname_r_chk (int __fd, char *__buf, size_t __buflen,
      |                                                    ^~~~~~
/usr/include/x86_64-linux-gnu/bits/stdlib.h:52:52: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/x86_64-linux-gnu/bits/stdlib.h:53:8: error: unknown type name 'size_t'
   53 |        size_t __nreal) __THROW __nonnull ((2));
      |        ^~~~~~
/usr/include/x86_64-linux-gnu/bits/stdlib.h:53:8: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
In file included from /usr/include/features.h:461,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdlib.h:25,
                 from code1.c:2:
/usr/include/x86_64-linux-gnu/bits/stdlib.h:54:12: error: unknown type name 'size_t'
   54 | extern int __REDIRECT_NTH (__ptsname_r_alias, (int __fd, char *__buf,
      |            ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/stdlib.h:54:12: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/x86_64-linux-gnu/bits/stdlib.h:57:12: error: unknown type name 'size_t'
   57 | extern int __REDIRECT_NTH (__ptsname_r_chk_warn,
      |            ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/stdlib.h:57:12: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/x86_64-linux-gnu/bits/stdlib.h:57:12: error: unknown type name 'size_t'
   57 | extern int __REDIRECT_NTH (__ptsname_r_chk_warn,
      |            ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/stdlib.h:57:12: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/x86_64-linux-gnu/bits/stdlib.h:64:1: error: unknown type name 'size_t'
   64 | __NTH (ptsname_r (int __fd, char *__buf, size_t __buflen))
      | ^~~~~
/usr/include/x86_64-linux-gnu/bits/stdlib.h:64:1: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
In file included from /usr/include/stdlib.h:1017,
                 from code1.c:2:
/usr/include/x86_64-linux-gnu/bits/stdlib.h:77:54: error: unknown type name 'size_t'
   77 | extern int __wctomb_chk (char *__s, wchar_t __wchar, size_t __buflen)
      |                                                      ^~~~~~
/usr/include/x86_64-linux-gnu/bits/stdlib.h:77:54: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/x86_64-linux-gnu/bits/stdlib.h: In function 'wctomb':
/usr/include/x86_64-linux-gnu/bits/stdlib.h:92:23: error: 'size_t' undeclared (first use in this function)
   92 |   if (__bos (__s) != (size_t) -1 && __STDLIB_MB_LEN_MAX > __bos (__s))
      |                       ^~~~~~
/usr/include/x86_64-linux-gnu/bits/stdlib.h:92:23: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/x86_64-linux-gnu/bits/stdlib.h: At top level:
/usr/include/x86_64-linux-gnu/bits/stdlib.h:98:8: error: unknown type name 'size_t'
   98 | extern size_t __mbstowcs_chk (wchar_t *__restrict __dst,
      |        ^~~~~~
/usr/include/x86_64-linux-gnu/bits/stdlib.h:100:10: error: unknown type name 'size_t'
  100 |          size_t __len, size_t __dstlen) __THROW;
      |          ^~~~~~
/usr/include/x86_64-linux-gnu/bits/stdlib.h:100:10: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/x86_64-linux-gnu/bits/stdlib.h:100:24: error: unknown type name 'size_t'
  100 |          size_t __len, size_t __dstlen) __THROW;
      |                        ^~~~~~
/usr/include/x86_64-linux-gnu/bits/stdlib.h:100:24: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/x86_64-linux-gnu/bits/stdlib.h:101:8: error: unknown type name 'size_t'
  101 | extern size_t __REDIRECT_NTH (__mbstowcs_alias,
      |        ^~~~~~
In file included from /usr/include/features.h:461,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdlib.h:25,
                 from code1.c:2:
/usr/include/x86_64-linux-gnu/bits/stdlib.h:101:15: error: unknown type name 'size_t'
  101 | extern size_t __REDIRECT_NTH (__mbstowcs_alias,
      |               ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/stdlib.h:101:15: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
In file included from /usr/include/stdlib.h:1017,
                 from code1.c:2:
/usr/include/x86_64-linux-gnu/bits/stdlib.h:105:8: error: unknown type name 'size_t'
  105 | extern size_t __REDIRECT_NTH (__mbstowcs_chk_warn,
      |        ^~~~~~
In file included from /usr/include/features.h:461,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdlib.h:25,
                 from code1.c:2:
/usr/include/x86_64-linux-gnu/bits/stdlib.h:105:15: error: unknown type name 'size_t'
  105 | extern size_t __REDIRECT_NTH (__mbstowcs_chk_warn,
      |               ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/stdlib.h:105:15: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/x86_64-linux-gnu/bits/stdlib.h:105:15: error: unknown type name 'size_t'
  105 | extern size_t __REDIRECT_NTH (__mbstowcs_chk_warn,
      |               ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/stdlib.h:105:15: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/x86_64-linux-gnu/bits/stdlib.h:113:1: error: expected ',' or ';' before 'mbstowcs'
  113 | __NTH (mbstowcs (wchar_t *__restrict __dst, const char *__restrict __src,
      | ^~~~~
In file included from /usr/include/stdlib.h:1017,
                 from code1.c:2:
/usr/include/x86_64-linux-gnu/bits/stdlib.h:130:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__wcstombs_chk'
  130 | extern size_t __wcstombs_chk (char *__restrict __dst,
      |               ^~~~~~~~~~~~~~
In file included from /usr/include/features.h:461,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdlib.h:25,
                 from code1.c:2:
/usr/include/x86_64-linux-gnu/bits/stdlib.h:133:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__wcstombs_alias'
  133 | extern size_t __REDIRECT_NTH (__wcstombs_alias,
      |               ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/stdlib.h:137:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__wcstombs_chk_warn'
  137 | extern size_t __REDIRECT_NTH (__wcstombs_chk_warn,
      |               ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/stdlib.h:144:1: error: expected ',' or ';' before 'wcstombs'
  144 | __NTH (wcstombs (char *__restrict __dst, const wchar_t *__restrict __src,
      | ^~~~~
code1.c: In function 'append':
code1.c:20:23: warning: suggest parentheses around '-' in operand of '&' [-Wparentheses]
   20 |  if (o >= 2 && (o & o - 1) == 0)
      |                     ~~^~~
code1.c:21:19: warning: implicit declaration of function 'realloc' [-Wimplicit-function-declaration]
   21 |   ej[i] = (int *) realloc(ej[i], o * 2 * sizeof *ej[i]);
      |                   ^~~~~~~
code1.c:21:19: warning: incompatible implicit declaration of built-in function 'realloc'
code1.c:3:1: note: include '<stdlib.h>' or provide a declaration of 'realloc'
    2 | #include <stdlib.h>
  +++ |+#include <stdlib.h>
    3 | 
code1.c: In function 'pus':
code1.c:67:6: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   67 |  if (z = lz1[u]) {
      |      ^
code1.c:76:6: warning: suggest