hiho week 25 register

Ended

Participants:726

Verdict:Accepted
Score:100 / 100
Submitted:2014-12-23 12:50:29

Lang:GCC

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <stdio.h>
#include <string.h>
#include <malloc.h>
typedef struct{
    char infi; //if distance to start node is infinity
    int dist; //distance to start node
    int p;    //precusor node
    int selected;
}Node;
typedef struct{
    int i;
    int j;
    int w;
}Edge;
//int **adj; //adjacent matrix
Edge *ed; //edges 
Node *nodes;
void initialize(int n, int m, int s);
int findMin(int n);
void relaxAll(int m, int u);
void relax(int u, int v, int w);
int main()
{
    int N,M,S,T;
    int i;
    scanf("%d%d%d%d", &N, &M, &S, &T);
    int sets[N];
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX