Submission #1160788

#TimeUsernameProblemLanguageResultExecution timeMemory
1160788hackstarWall (IOI14_wall)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;
void buildWall(int n, int k, vector<int> &op, vector<int> &left, vector<int> &right, vector<int> &height, vector<int> &finalHeight) {
    vector<int> a(n, 0);
    for (int i = 0; i < k; ++i) {
        int l = left[i] - 1, r = right[i] - 1;
        if (op[i] == 1) { 
            for (int j = l; j <= r; ++j) {
                a[j] = max(a[j], height[i]);
            }
        } else if (op[i] == 2) { 
            for (int j = l; j <= r; ++j) {
                a[j] = min(a[j], height[i]);
            }
        }
    }
    for (int i = 0; i < n; ++i) {
        finalHeight[i] = a[i];
    }
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccrW4FQ2.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