Page 3 of 3

Re: 11284 - Shopping Trip

Posted: Fri Apr 25, 2014 11:21 pm
by brianfry713
Try running your code on the sample input.

Re: 11284 - Shopping Trip

Posted: Fri May 23, 2014 7:51 pm
by metaflow
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

Re: 11284 - Shopping Trip

Posted: Sat Dec 06, 2014 6:01 pm
by giusevtr
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