11284 - Shopping Trip

All about problems in Volume 112. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 11284 - Shopping Trip

Post by brianfry713 » Fri Apr 25, 2014 11:21 pm

Try running your code on the sample input.
Check input and AC output for thousands of problems on uDebug!

metaflow
New poster
Posts: 2
Joined: Fri May 23, 2014 7:47 pm

Re: 11284 - Shopping Trip

Post by metaflow » Fri May 23, 2014 7:51 pm

If you are like me - there is a cases with multiple roads between the same shops:

Code: Select all

1
1 2
0 1 1
1 0 2
1
1 3

User avatar
giusevtr
New poster
Posts: 2
Joined: Mon Nov 05, 2012 8:16 pm
Location: Miami

Re: 11284 - Shopping Trip

Post by giusevtr » Sat Dec 06, 2014 6:01 pm

I was having problems with precision around 0.

here is some IO.

input:

Code: Select all

11

1 1
0 1 1.00
1
1 3.00

1 1
0 1 1.00
1
1 2.00

3 3
0 1 1.00
0 2 1.00
0 3 1.00
3
1 2.20
2 1.80
3 2.30

1 2
0 1 1
1 0 2
1
1 3

2 3
0 1 1.00
0 2 1.00
2 3 10.00
2
1 2.01
2 2.01

3 3
0 1 1.00
0 2 1.00
0 3 1.00
3
1 2.01
2 2.01
3 2.01

2 6
0 1 1.00
0 1 2.00
1 2 4.00
2 1 1.00
0 2 1.00
2 2 3.00
2
1 2.00
2 3.00

5 5
0 1 1.00
1 2 1.00
2 3 1.00
3 4 1.00
4 5 1.00
3
1 2.00
3 4.00
5 8.00

1 1
0 1 0.13
1
1 0.26

5 5
0 1 1.00
1 2 1.00
2 3 1.00
3 4 1.00
4 5 1.00
3
1 0.10
3 0.20
5 20.00

6 6
0 1 0.03
1 2 0.03
2 3 0.03
3 4 0.03
4 5 0.03
5 6 0.03
3
1 0.00
3 0.00
6 0.36
AC Output:

Code: Select all

Daniel can save $1.00
Don't leave the house
Daniel can save $0.50
Daniel can save $1.00
Daniel can save $0.02
Daniel can save $0.03
Daniel can save $2.00
Daniel can save $4.00
Don't leave the house
Daniel can save $10.30
Don't leave the house

Post Reply

Return to “Volume 112 (11200-11299)”