Submission #1328328

#TimeUsernameProblemLanguageResultExecution timeMemory
1328328orgiloogiiRail (IOI14_rail)C++20
Compilation error
0 ms0 KiB
#include "rail.h"
#include <bits/stdc++.h>
using namespace std;
#define int long long
//int getDistance(int i, int j);
void findLocation(int n, int first, int location[], int stype[]) {
    location[0] = first;
    stype[0] = 1;

    int dist[n] = {0};
    dist[0] = 0;
    int dist1[n] = {0};
    dist1[0] = 0;

    int mdx = 0;
    int mx = 0;
    for (int i = 1;i < n;i++) {
        dist[i] = getDistance(0, i);
        dist1[i] = getDistance(i, 0);
        if (dist[i] == dist1[i]) {
            stype[i] = 2;
            location[i] = first + dist[i];
            if (dist[i] > mx) {
                mx = dist[i];
                mdx = i;
            }
        }
        else {
            stype[i] = 1;
        }
    }
    for (int i = 1;i < n;i++) {
        if (stype[i] == 1) {
            location[i] = location[mdx] - getDistance(mdx, i);
        }
    }
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccbzXWPY.o: in function `main':
grader.cpp:(.text.startup+0x29c): undefined reference to `findLocation'
collect2: error: ld returned 1 exit status