답안 #1017028

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1017028 2024-07-08T18:06:51 Z Kodik 악어의 지하 도시 (IOI11_crocodile) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
#define ss second
#define ff first
typedef long long ll;
#define int ll
int mod = 1e9+7;
int inf = 1e18;

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    // ifstream cin ("shortcut.in");
    // ofstream cout ("shortcut.out");
    int n, m, k;
    cin >> n >> m >> k;
    vector<vector<pair<int,int>>> adj(n);
    for(int i = 0; i < m; ++i){
        int a,b,c;
        cin >> a >> b >> c;
        adj[a].push_back({b,c});
        adj[b].push_back({a,c});
    }
    set<int> exit;
    for(int i = 0; i < k; ++i){
        int x;
        cin >> x;
        exit.insert(x);
    }
    priority_queue<pair<int,int>, vector<pair<int,int>>, greater<pair<int,int>>> pq;
    vector<int> dis(n, 1e10);
    int ans = 1e10;
    dis[0] = 0;
    pq.push({0,0});
    bool pass = 0;
    while(!pq.empty()){
        pair<int,int> a = pq.top(); pq.pop();
        if(dis[a.ss]!=a.ff){
            continue;
        }
        if(exit.find(a.ss)!=exit.end()){
            ans = min(ans, a.ff);
        }
        pass = false;
        for(auto &[nxt, w] : adj[a.ss]){
            if(a.ff+w<nxt&&pass){
                pq.push({a.ff+w,nxt});
            }else if(a.ff+w>=nxt){
                continue;
            }
            pass = true;
        }        
    }
    cout << ans << '\n';
    return 0;   
}

Compilation message

/usr/bin/ld: /tmp/cc3NK3hX.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccNE3BuU.o:crocodile.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/cc3NK3hX.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