2113 - It's time for change

Problems from Mid Atlantic North America regional contest

Moderator: Board moderators

2113 - It's time for change

Postby Wojciech Migda » Tue Aug 22, 2006 10:37 pm

hi,

it's weird, but.. I wrote a solution, which gives answers in line with what is given here: http://www.cut-the-knot.org/ctk/Generat ... tml#change

For every amount of money between 0.01 and 2.00 inclusive it gives an answer in unnoticeable time. And it terminates when the input is either 0, 0. , 0.00, negative or just EOF. Despite that I get TLE :o

Thus here come my questions:

1. is my TLE related to the amount of data which is fed to the submited solutions ? If so, then my solution needs better algorithm. But lookign at the timings achieved by AC solutions it doesn't seem so :/
2. Maybe the input data format is wrong, and my solution awaits for data which never comes - leading to TLE ?

I have compiled and tested my program under gcc 2.95.3 and 3.4.6

thanks in advance

Wojtek

PS: my test generating script:
Code: Select all
#!/usr/bin/php
<?php
for ($i = 0.01; $i <= 2.0; $i += 0.01)
    printf ("%.2f\n", $i);
printf ("0\n");
?>
Wojciech Migda
New poster
 
Posts: 17
Joined: Thu Jul 20, 2006 1:08 pm

Postby Wojciech Migda » Sun Aug 27, 2006 12:16 pm

wow. finally I got it - it seems that the input format may vary much more than it is shown in the problem description. For anyone trying to get AC for this one - be aware of the money being presented in any format, eg.:

#.##
.##
#
#.#

Then it should get AC.

regards,

Wojtek
Wojciech Migda
New poster
 
Posts: 17
Joined: Thu Jul 20, 2006 1:08 pm

Postby Disatoba » Mon Jan 21, 2008 6:29 pm

Hello,
I have serious problems with it, because i believe than my solution is good, but only i get W.A.
I have the next question:
In the statement's problem, it say; "For each input value, a line indicating `There are X ways to make $Y' where X is the number of ways, and Y is the input value.", this mean than when comming ".99" in the input, then should outputs: "There 252 ways to make $0.99" or "There 252 ways to make $.99"?
Thanks!
User avatar
Disatoba
New poster
 
Posts: 15
Joined: Thu Feb 02, 2006 2:32 pm
Location: Bogot

Postby helloneo » Tue Jan 22, 2008 4:43 pm

My AC code prints

Code: Select all
There are 252 ways to make $0.99



If you are sure about your solution, it might be a precision error..

:-)
helloneo
Experienced poster
 
Posts: 48
Joined: Mon Jul 04, 2005 5:30 am
Location: Seoul, Korea

Postby Disatoba » Tue Jan 22, 2008 6:17 pm

Thanks Helloneo,
But i can't find the mistake then post my code without the key process.
I don't use precision double. =)

Code: Select all
I got AC


http://acmicpc-live-archive.uva.es/nuevoportal/users.php?user=5809
User avatar
Disatoba
New poster
 
Posts: 15
Joined: Thu Feb 02, 2006 2:32 pm
Location: Bogot


Return to Mid Atlantic

Who is online

Users browsing this forum: No registered users and 0 guests

cron