Cod sursa(job #2297968)

Utilizator Data 6 decembrie 2018 21:14:54 Ubuntzei 15 cpp-64 done Arhiva de probleme 1.56 kb
``````#include <bits/stdc++.h>
#define pi pair< int, pair< int,int > >
#define mp make_pair
using namespace std;

ifstream fin("ubuntzei.in");
ofstream fout("ubuntzei.out");

int n, m, k;
bool l[2001];
vector <pair <int, int> > v[2001];
priority_queue <pi, vector<pi>, greater<pi> > pq;

{
int ct = 0;
for(int i = 1; i <= n; i++)
{
ct++;
}
return ct;
}

void Dijkstra()
{
pq.push(mp(0, mp(1, 0)));

while(!pq.empty())
{
int drum = pq.top().first;
int nod = pq.top().second.first;
pq.pop();

if(nod == n)
{
{
fout << drum;

return;
}
continue;
}
for(int i = 0; i < v[nod].size(); i++)
{
int next, cost;
next = v[nod][i].first;
cost = v[nod][i].second;
if(l[next])
{

}

}

}

}

int main()
{
fin >> n >> m;
fin >> k;
for(int i = 1; i <= k; i++)
{
int x;
fin >> x;
l[x] = 1;
}
for(int i = 1; i <= m; i++)
{
int a, b, c;
fin >> a >> b >> c;
v[a].push_back(mp(b, c));
v[b].push_back(mp(a, c));
}
Dijkstra();
return 0;
}
``````