| SMU ICPC Selection Contest 2026 |
|---|
| Finished |
There are $$$n$$$ streets in a city, numbered from $$$1$$$ to $$$n$$$. For every $$$1\leq i \leq n-1$$$, street $$$i$$$ and $$$i+1$$$ are connected by a two-way road with travel time $$$t_i$$$ units.
There is also one police station on each street. The $$$i$$$-th station is located on street $$$i$$$, has a forwarding time delay of $$$f_i$$$ units, and a response time delay of $$$r_i$$$ units.
Station $$$s$$$ receives an emergency call reporting a crime at street $$$d$$$. The receiving station then chooses one of the following actions:
The city receives $$$q$$$ emergency calls of the form $$$(s,d)$$$. For each call, find the minimum total response time if station $$$s$$$ initially receives a call of a crime at street $$$d$$$.
$$$q$$$ lines. For each query $$$(s,d)$$$, output the minimum total response time if station $$$s$$$ first receives the call reporting a crime at street $$$d$$$.
5 54 7 10000 2 69 6 8 10000 12 3 10000 61 51 33 44 55 1
12 13 10007 3 10012
There are $$$5$$$ streets and police stations, and $$$5$$$ emergency calls.
Illustration of Sample Test Case For the first emergency call $$$(1,5)$$$, the call is initially received by station $$$1$$$ and the crime is at street $$$5$$$. There are 3 possible ways to respond to the call.
One possible sequence of events is as follows:
Another possible sequence of events is as follows:
Lastly, the only other sequence of events is as follows:
Therefore, the minimum total response time for the first call is $$$12$$$ units.
| Name |
|---|


