Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Dwite 2009-2010
Index -> CompSci.ca, Contests -> DWITE
Goto page Previous  1, 2, 3, 4
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Insectoid




PostPosted: Wed Oct 21, 2009 6:03 pm   Post subject: RE:Dwite 2009-2010

Saltpro, what I did for Q1 was :

numCopies=1000 *( Math.ceil((numCopies/1000)));

Math.ceil always rounds up, so we divided by a thousand, rounded up, and multiplied by 1000.

We took more time on this question than any other trying to do the rounding right. First, we just used Math.round() instead of Math.ceil(), but that rounds to the closest integer. We wanted it to always round UP. So then we tried casting it to integer. Until we realized that casting, which cuts off the decimal, rounds down. Then we found the Math.Ceil command, which was awesome.

Oh hey Dan, I can't find where I can download the test cases and my program output. I want to know why one of my programs got only 4/5 and why another got 3/5.
Sponsor
Sponsor
Sponsor
sponsor
Zampano




PostPosted: Wed Oct 21, 2009 6:10 pm   Post subject: Re: Dwite 2009-2010

I don't know about specific program output, insectoid, but test cases can be gotten from:
http://dwite.org/home/contest/19
which can be gotten to through the "Past Contests" tab.
Dan




PostPosted: Wed Oct 21, 2009 6:24 pm   Post subject: RE:Dwite 2009-2010

We don't keep the program's output any more as it was adbused in the past. However i would like to add a version that is only viewable after the contest in the future.

I recomend testing your program aginsted the test cases Zampano linked to, but with out looking at your program at all it is likey an issue with the divsion of numCopies/1000 not aucatly giving a whole number when you think it would. Floating point math can be a bit odd and if the divsion resulted in somthing like 2.0000001 when you are expecting that it would be 2.0, ceil would make the 2.0000001 a 3 welll 2.0 would be 2.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Insectoid




PostPosted: Wed Oct 21, 2009 6:42 pm   Post subject: RE:Dwite 2009-2010

Oh, I got 5/5 on that one, questions 3 and 4 I didn't.
A.J




PostPosted: Wed Oct 21, 2009 6:50 pm   Post subject: RE:Dwite 2009-2010

I got 5/5 on everything but #5.......wow, I fail
saltpro15




PostPosted: Wed Oct 21, 2009 7:20 pm   Post subject: RE:Dwite 2009-2010

I have a suggestion that I feel would add to DWITE. It would be nice if we could upload a profile picture on our account, as most of the people who finish around the top will be at the other contests (ECOO, CCC Stage 2, etc.) and it would be nice to know who they are Very Happy
Zampano




PostPosted: Wed Oct 21, 2009 7:25 pm   Post subject: Re: Dwite 2009-2010

I decided to check the problem that lost me one test case in problem 1. My output?

code:
2000
2000
3000
1000
1.444e+006


A mistake only a fool would make and not bother to check for until the contest was over.

Yet others didn't deactivate the scientific format flags and got the last case. I'm quite an amateur!
theDotz




PostPosted: Wed Oct 21, 2009 9:23 pm   Post subject: RE:Dwite 2009-2010

Those were awesome questions. We just started doing DWITE for the first time. Too bad I quickly thought of the easy way to do question three 2 minutes before the contest was over. But then again we were learning all the input/output to file things while doing it. Can't wait for round 2 : )
Sponsor
Sponsor
Sponsor
sponsor
chopperdudes




PostPosted: Wed Oct 21, 2009 11:48 pm   Post subject: RE:Dwite 2009-2010

wow i failed epically on #5... i first coded it with dfs... 30mins later... it gets marked and got a 0... said it timed out. so i coded it with bfs... and it timed out again...

until i got to see the test cases... and reread the question.. where it says the first node will HAVE A PATH to the cycle... and not BE PART OF THE CYCLE as i've mistakenly somehow thought.

i did not know why i didn't just floyd-warshall'ed it like brian did...
Display posts from previous:   
   Index -> CompSci.ca, Contests -> DWITE
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 4 of 4  [ 54 Posts ]
Goto page Previous  1, 2, 3, 4
Jump to:   


Style:  
Search: