11284 - Shopping Trip
Moderator: Board moderators
11284 - Shopping Trip
i use floyd to calculate distance between each store
and build a new graph that contains only store node and home node
then I use a bit DP to find the max profit
is this algorithm wrong?
can someone give me some test data ?
btw, what is the range of the cost of road and money saved in stoer? could it be very large?
and build a new graph that contains only store node and home node
then I use a bit DP to find the max profit
is this algorithm wrong?
can someone give me some test data ?
btw, what is the range of the cost of road and money saved in stoer? could it be very large?
不鸣则已,一鸣惊人.
I am getting WA. My idea is almost similar and I am using only integers. Here are some cases..
Input:
Output:
Are these correct? Can anyone post some more cases? Thanks in advance.
Input:
Code: Select all
3
4 5
0 1 1
1 2 3.00
0 3 1.00
3 2 1.50
3 4 3.25
3
1 1.50
1 7.00
2 9.00
4 5
0 1 1
1 2 3.00
0 3 1.00
3 2 1.50
3 4 3.25
4
1 1.50
2 7.00
3 9.00
4 11.00
5 6
0 1 1
1 2 3.00
0 3 1.00
3 2 11.50
3 4 3.25
4 5 8
4
3 1.50
3 7.00
4 1.00
5 20
Code: Select all
Daniel can save $11.00
Daniel can save $15.50
Daniel can save $6.50
Ami ekhono shopno dekhi...
HomePage
HomePage
more datasets ....
More datasets is really appreciated.
Does the (sum of prices)*100 fit inside
a 32 bit integer? Are all prices positive?
Thanks.
Does the (sum of prices)*100 fit inside
a 32 bit integer? Are all prices positive?
Thanks.
-
- Experienced poster
- Posts: 161
- Joined: Tue Oct 25, 2005 8:38 pm
- Location: buet, dhaka, bangladesh
thanks for the hint , after getting too many wa in contest and online-judge, while reading the description again, i thought about multiple edges between two nodes. after checking that it got accepted. unfortuantely i assumed that there will be no multiple edgesDarko wrote: There is one more thing that might cause WA, it is a small implementation detail, read the problem statement carefully.

ishtiak zaman
----------------
the world is nothing but a good program, and we are all some instances of the program
----------------
the world is nothing but a good program, and we are all some instances of the program
Well, my code handles duplicate edges. And I have tried many cases, but couldnt find the error. So, I am posting my code.
Can anyone show where it fails? Thanks in advance.
Code: Select all
code removed by Darko
Ami ekhono shopno dekhi...
HomePage
HomePage
No no, I removed the freopen before submitting. But got WA. I submitted it and got WA again. Would you please submit it? Thanks. [If you dont have the code I will PM it, just inform me]
Ami ekhono shopno dekhi...
HomePage
HomePage
Edited.windows2k wrote:I get WA all the tiime.Jan wrote:What to do now? Should I report it in Bugs and suggestions?
And I passed the input/output above.
Could someone give more tricky input/output?
Thanks in advance
I found my error :
I forgot to add eps when I change all double to int. (*100)
studying @ ntu csie