답안 #875989

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
875989 2023-11-21T02:48:44 Z Darren0724 철로 (IOI14_rail) C++17
컴파일 오류
0 ms 0 KB
#include "rail.h"
#include "grader.cpp"
#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
void findLocation(int n, int first, int ans[], int type[]) {
    ans[0] = first;
    vector<int> a(n), b(n);
    type[0] = 1;
    ans[0] = first;
    pair<int, int> p = {INF, -1};
    for (int i = 1; i < n; i++) {
        a[i] = getDistance(0, i);
        p = min(p, {a[i], i});
    }
    int t = p.first;
    for (int i = 0; i < n; i++) {
        b[i] = getDistance(t, i);
    }
    int second = first + a[t];
    for (int i = 0; i < n; i++) {
        if (a[i] < b[i]) {
            type[i] = 1;
            ans[i] = first + a[i];
        } else {
            type[i] = 2;
            ans[i] = second - b[i];
        }
    }
}

Compilation message

/usr/bin/ld: /tmp/ccDTrpqh.o: in function `getDistance':
grader.cpp:(.text+0x0): multiple definition of `getDistance'; /tmp/ccWRrRpg.o:rail.cpp:(.text+0x0): first defined here
/usr/bin/ld: /tmp/ccDTrpqh.o:(.bss+0x0): multiple definition of `cnt'; /tmp/ccWRrRpg.o:(.bss+0x0): first defined here
/usr/bin/ld: /tmp/ccDTrpqh.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccWRrRpg.o:rail.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status