답안 #438435

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
438435 2021-06-28T02:25:10 Z Deepesson 악어의 지하 도시 (IOI11_crocodile) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#define MAX 101000
typedef std::pair<int,int> pii;
std::vector<pii> con[MAX];
int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    std::cout.tie(0);
    int N,M,K;
    std::cin>>N>>M>>K;
    for(int i=0;i!=M;++i){
        int a,b,c;std::cin>>a>>b>>c;
        con[a].push_back({b,c});
        con[b].push_back({a,c});
    }
    std::priority_queue<pii,std::vector<pii>,std::greater<pii>> queue;
    int peso_min[N]={};
    int visitas[N]={};
    for(int i=0;i!=K;++i){
        int x;std::cin>>x;
        visitas[x]=1;queue.push({0,x});
    }
    while(queue.size()){
        auto _=queue.top();
        queue.pop();
        if(!visitas[_.second]){
            ++visitas[_.second];
        }else if(visitas[_.second]==1){
            ++visitas[_.second];
            peso_min[_.second]=_.first;
            for(auto&k:con[_.second]){
                queue.push({k.second+_.first,k.first});
            }
        }
    }
    std::cout<<peso_min[0]<<"\n";
}

Compilation message

/usr/bin/ld: /tmp/ccWvoG9u.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc5n6RIw.o:crocodile.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccWvoG9u.o: in function `main':
grader.cpp:(.text.startup+0x36): undefined reference to `travel_plan(int, int, int (*) [2], int*, int, int*)'
collect2: error: ld returned 1 exit status