답안 #754873

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
754873 2023-06-08T19:22:59 Z alexander707070 Roller Coaster Railroad (IOI16_railroad) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
 
using namespace std;
 
int n;
pair<int,int> a[200007];
 
bool cmp(pair<int,int> fr,pair<int,int> sc){
    return max(fr.second-sc.first,0) < max(sc.second-fr.first,0);
}
 
long long plan_roller_coaster(int N,vector<int> s,vector<int> t){

    n=N;
    for(int i=1;i<=n;i++){
        a[i]={s[i-1],t[i-1]};
    }

    sort(a+1,a+n+1,cmp);

    for(int i=1;i<=n-1;i++){
        if(a[i].second>a[i+1].first)return 1;
    }
    
    return 0;
}

int main(){

}

Compilation message

/usr/bin/ld: /tmp/ccY0hqyV.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cclBhu1V.o:railroad.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccY0hqyV.o: in function `main':
grader.cpp:(.text.startup+0xf4): undefined reference to `plan_roller_coaster(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status