제출 #420350

#제출 시각아이디문제언어결과실행 시간메모리
420350iulia13벽 (IOI14_wall)C++14
컴파일 에러
0 ms0 KiB
#include <iostream> #include "wall.h" using namespace std; const int N = 2e6 + 5; const int INF = 2e9; struct Node{ int minim, maxim; } seg[4 * N]; void op1(int nod, int val) { seg[nod].minim = min(seg[nod].minim, val); seg[nod].maxim = min(val, seg[nod].maxim); } void op2(int nod, int val) { seg[nod].maxim = max(seg[nod].maxim, val); seg[nod].minim = max(val, seg[nod].minim); } void push(int nod) { int ls = 2 * nod, rs = ls + 1; op1(ls, seg[nod].minim); op1(rs, seg[nod].minim); op2(ls, seg[nod].maxim); op2(rs, seg[nod].maxim); } void update(int nod, int l, int r, int ql, int qr, int val, int tip) { if (l > r || l > qr || r < ql) return; if (ql <= l && r <= qr) { if (tip == 2) op1(nod, val); else op2(nod, val); return; } int mid = (l + r) / 2, ls = 2 * nod, rs = ls + 1; push(nod); seg[nod].maxim = 0; seg[nod].minim = INF; update(ls, l, mid, ql, qr, val, tip); update(rs, mid + 1, r, ql, qr, val, tip); } int aa[N]; void query(int nod, int l, int r){ if(l == r) { aa[l] = min(seg[nod].maxim, seg[nod].minim); return; } int mid = (l + r) / 2, ls = 2 * nod, rs = ls + 1; push(nod); seg[nod].maxim = 0; seg[nod].minim = INF; query(ls, l, mid); query(rs, mid + 1, r); } void buildwall(int n, int k, int op[], int lft[], int rgt[], int height[], int ans[]) { int i; for (int h = 0; h < k; h++) { lft[h]++; rgt[h]++; update(1, 1, n, lft[h], rgt[h], height[h], op[h]); } query(1, 1, n); for (i = 0; i < n; i++) ans[i] = aa[i + 1]; }

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

/usr/bin/ld: /tmp/ccKvKq1F.o: in function `main':
grader.cpp:(.text.startup+0x133): undefined reference to `buildWall(int, int, int*, int*, int*, int*, int*)'
collect2: error: ld returned 1 exit status