Cod sursa(job #2206699)
Utilizator | Data | 23 mai 2018 15:01:49 | |
---|---|---|---|
Problema | Algoritmul lui Dijkstra | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.38 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("royfloyd.in");
ofstream g("dijkstra.out");
struct muchie{int b,c;muchie *n;}*a[50002],*p;
int n,m,o,d[50002];
bool k=1;
int main()
{
f>>n>>m;
for(i=1;i<=m;++i)
{
int A,B,x;
f>>A>>B>>x;
p=new muchie;
p.b=B;p.c=x;
p.n=a[A];
a[A]=p;
}
}