Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
Register

## Re:裸的迪杰特斯拉

Posted by zuozhen at 2020-11-17 16:30:16 on Problem 2387
In Reply To:裸的迪杰特斯拉 Posted by:KatrineYang at 2016-08-21 09:27:55
```> #include <iostream>
> #include <stdio.h>
> using namespace std;
>
>
> int main() {
> 	int T, N;
> 	scanf("%d%d", &T, &N);
> 	for(int i = 0; i < T; i++){
> 		int f, t, d;
> 		scanf("%d%d%d", &f, &t, &d);
> 		if(f == t) continue;
> 	}
> 	int dist[1010];
> 	int Dist[1010];
> 	bool used[1010] = {0};
> 	used[1] = 1;
> 	dist[1] = 0;
> 	Dist[1] = 0;
> 	for(int i = 2; i <= N; i++) dist[i] = 2147483647;
> 	while(1){
> 			}
> 		}
> 		int mn = 2147483647;
> 		int arg = -1;
> 		for(int i = 2; i <= N; i++){
> 			if(!used[i] && dist[i] < mn){
> 				mn = dist[i];
> 				arg = i;
> 			}
> 		}
> 		used[arg] = 1;
> 		Dist[arg] = dist[arg];
> 		if(arg == N){
> 			break;
> 		}
> 	}
> 	printf("%d\n", Dist[N]);
> 	return 0;
> }
```

Followed by: