제출 #1181266

#제출 시각아이디문제언어결과실행 시간메모리
1181266KhoaDuy은하철도 (APIO24_train)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
int GetRand(int l,int r){
    return (rng()%(r-l+1)+l);
}
signed main(){
    int n=GetRand(2,1e3);
    int m=GetRand(0,min((int)1e3,n*(n-1)/2));
    int w=GetRand(0,1e3);
    cout << n << ' ' << m << ' ' << w << endl;
    for(int i=0;i<n;i++){
        int t=GetRand(1,1e3);
        cout << t << ' ';
    }
    cout << endl;
    for(int i=0;i<m;i++){
        int x=GetRand(0,n-1),y=GetRand(0,n-1);
        if(x==y){
            y=(y+1)%n;
        }
        int a=GetRand(1,1e3),b=GetRand(1,1e3),c=GetRand(1,1e3);
        if(a>b){
            swap(a,b);
        }
        if(a==b){
            b++;
        }
        cout << x << ' ' << y << ' ' << a << ' ' << b << ' ' << c << endl;
    }
    for(int i=0;i<w;i++){
        int l=GetRand(1,1e3),r=GetRand(1,1e3);
        if(l>r){
            swap(l,r);
        }
        cout << l << ' ' << r << endl;
    }
}

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

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