제출 #1258956

#제출 시각아이디문제언어결과실행 시간메모리
1258956notisora악어의 지하 도시 (IOI11_crocodile)C++20
컴파일 에러
0 ms0 KiB
///NotIsora ///This is my last dance #include<bits/stdc++.h> #define modulo 1000000007 #define fi first #define se second #define sq(x) (x)*(x) #define ll long long #define ld long double #define el '\n' #define pb push_back ///#define int long long using namespace std; const int N=1e5+2; vector<pair<int,int>>adj[N]; int n,m,k; ll d[2][N]; struct State{ int s; ll dis; bool operator < (const State&other) const{ return dis>other.dis; } }; priority_queue<State>pq; signed main(){ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); //freopen("i.INP","r",stdin); cin>>n>>m>>k; for(int i=1;i<=m;i++){ int a,b,w; cin>>a>>b>>w; adj[a].pb({b,w}); adj[b].pb({a,w}); } for(int i=0;i<n;i++){ d[0][i]=d[1][i]=1e15; } for(int i=1;i<=k;i++){ int s; cin>>s; pq.push({s,0LL}); d[0][s]=0; d[1][s]=0; } while(!pq.empty()){ ll dis=pq.top().dis; int s=pq.top().s; pq.pop(); if (dis>d[1][s]) continue; // cout<<el; for(int i=0;i<(int)adj[s].size();i++){ pair<int,int>&pr=adj[s][i]; int u=pr.fi; int w=pr.se; // if (u==2){ // cout<<d[0][u]<<" "<<d[1][u]<<" "<<s<<":"<<dis+w<<el; // } if (d[0][u]>dis+(ll)w){ if (d[1][u]>d[0][u]) pq.push({u,d[0][u]}); d[1][u]=d[0][u]; d[0][u]=(dis+(ll)w); } else if (d[1][u]>dis+(ll)w){ d[1][u]=(dis+(ll)w); pq.push({u,dis+(ll)w}); } } } cout<<d[1][0]; }

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

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