RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
ICPC00025

C. Surely You Congest

Unrated 레이팅 미적용
난이도
10s
시간 제한
1024MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

You are in charge of designing an advanced centralized traffic management system for smart cars. The goal is to use global information to instruct morning commuters, who must drive downtown from the suburbs, how best to get to the city center while avoiding traffic jams. Unfortunately, since commuters know the city and are selfish, you cannot simply tell them to travel routes that take longer than normal (otherwise they will just ignore your directions). You can only convince them to change to different routes that are equally fast. The city’s network of roads consists of intersections that are connected by bidirectional roads of various travel times. Each commuter starts at some intersection, which may vary from commuter to commuter. All commuters end their journeys at the same place, which is downtown at intersection 1. If two c\(om- mu\)ters attempt to start travelling along the same road in the same direction at the same time, there will be congestion; you must avoid this. However, it is fine if two commuters pass through the same intersection simultaneously or if they take the same road starting at different times. Determine the maximum number of commuters who can drive downtown without congestion, subject to all commuters starting their journeys at exactly the same time and without any of them taking a suboptimal route. Figure C.1: Illustration of Sample Input 2. In Figure C.1, cars are shown in their original locations. One car is already downtown. Of the cars at \(in- te\)rsection 4, one can go along the dotted route through intersection 3, and another along the dashed route through intersection 2. But the remaining two cars cannot reach downtown while avoiding congestion. So a maximum of 3 cars can reach downtown with no congestion.

제약
입력 형식

The input consists of a single test case. The first line contains three integers \(n\), \(m\), and \(c\), where \(n\) (\(1 \le n \le 25\,000\)) is the number of intersections, \(m\) (\(0 \le m \le 50\,000\)) is the number of roads, and \(c\) (\(0 \le c \le 1\,000\)) is the number of commuters. Each of the next \(m\) lines contains three integers \(xi\), \(yi\), and \(t_{i}\) describing one road, where \(x_{i}\) and \(y_{i}\) (\(1 \le x_{i}\), \(y_{i} \le n\)) are the distinct intersections the road connects, and \(t_{i}\) (\(1 \le t_{i} \le 10\,000\)) is the time it takes to travel along that road in either direction. You may assume that downtown is reachable from every intersection. The last line contains \(c\) integers listing the starting intersections of the commuters.

출력 형식

Display the maximum number of commuters who can reach downtown without congestion.

예제 1
입력
3 3 2
1 2 42
2 3 1
2 3 1
2 3
출력
2
예제 2
입력
4 4 5
1 2 5
1 3 4
4 2 5
4 3 6
4 4 4 4 1
출력
3
문제 정보

생성자가 기록되지 않았습니다.

출처 ICPC World Finals 2013

평가 및 의견

C. Surely You Congest

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

C. Surely You Congest

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8