Submission #1222167

#TimeUsernameProblemLanguageResultExecution timeMemory
1222167kargneqComparing Plants (IOI20_plants)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

vector<int> r;
int n;

void init(int k, const int rr[]) {
    n = k;
    r.assign(rr, rr + n);
}

int compare_plants(int x, int y) {
    int n1 = (x + 1) % n;
    int n2 = (x + 2) % n;
    if (r[x] == 0 && (y == n1 || y == n2)) return 1;
    if (r[x] == 2 && (y == n1 || y == n2)) return -1;
    int yn1 = (y + 1) % n;
    int yn2 = (y + 2) % n;
    if (r[y] == 0 && (x == yn1 || x == yn2)) return -1;
    if (r[y] == 2 && (x == yn1 || x == yn2)) return 1;
    return 0;
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccP0LSLR.o: in function `main':
grader.cpp:(.text.startup+0x2e9): undefined reference to `init(int, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status