ENG  RUS Timus Online Judge
Online Judge
Problems
Authors
Online contests
Site news
Webboard
Problem set
Submit solution
Judge status
Guide
Register
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

## Discussion of Problem 1316. Electronic Auction

what is the correct answer for..
Posted by Romeo Tonca 15 May 2004 23:07
BID 0.01
BID 10000
BID 5000
BID 5000
SALE 7000 3
DEL 5000
SALE 3000 3
SALE 0.01 3
QUIT
----------
i use the following logic:
sum = 0.00
BID 0.01
BID 10000
BID 5000
BID 5000
SALE 7000 3
<=>
BID 0.01
BID 5000
BID 5000 sum = 0.01
+
DEL 5000
<=>
BID 0.01
BID 5000
+
SALE 3000 3
<=>
BID 0.01 sum = 0.02
+
SALE 0.01 3
<=> sum = 0.03
+
QUIT
sum = 0.03
Re: what is the correct answer for..
Posted by Илья Гофман (Ilya Gofman) 18 May 2004 16:31
Hey you've turned it all upside down!
Once a person said "BID X" it means he's not going to buy it for more! And.. where have you put BID 10000?
Here's the correct logic:

BID 0.01
BID 10000
BID 5000
BID 5000
SALE 7000 3//selling only 1 to person of 10000 <=> sum=0.01
DEL 5000
SALE 3000 3//selling 2 to 5000 and 10000 <=> sum=0.03
SALE 0.01 3//selling 3 to 0.01, 5000, 10000 <=> sum=0.06
QUIT

any more questions?:)