제출 #581432

#제출 시각아이디문제언어결과실행 시간메모리
581432jasmin철로 (IOI14_rail)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h>
#include<rail.h>
using namespace std;

const int inf=1e18;

void findLocation(int n, int first, vector<int> location, vector<int> stype){
    location[0]=first;
    stype[0]=1;
    if(n==1) return;

    vector<int> d0(n);
    int b=-1; int mini=inf;
    for(int i=1; i<n; i++){
        d0[i]=getDistance(0, i);
        if(d0[i]<mini){
            b=i;
            mini=d0[i];
        }
    }
    location[b]=first+mini;

    for(int i=1; i<n; i++){
        if(i==b) continue;

        int db=getDistance(b, i);
        if(d0[i]<db){
            location[i]=first+d0[i];
            stype[i]=2;
        }
        else{
            location[i]=first+d0[b]-db;
            stype[i]=1;
        }
    }
}

/*signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int n;
    cin >> n;

}*/

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

rail.cpp:5:15: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
    5 | const int inf=1e18;
      |               ^~~~
/usr/bin/ld: /tmp/ccUsEfkQ.o: in function `main':
grader.cpp:(.text.startup+0x2d9): undefined reference to `findLocation'
collect2: error: ld returned 1 exit status