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

Username:   Password: 
 RegisterRegister   
 2009 Ccc S4
Index -> Contests
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
mseo




PostPosted: Sat Feb 20, 2010 12:56 pm   Post subject: 2009 Ccc S4

I realized when I was testing my program with the test data, there were some numbers that were out of bounds, and my

program threw array index out of bounds exception (I used Java and created array dynamically)

If it was a real contest, I probably could not have gotten any mark for this question.

So I have a question: does this mean that for every problem in CCC, do i have to error trap the input?
Sponsor
Sponsor
Sponsor
sponsor
USEC_OFFICER




PostPosted: Sat Feb 20, 2010 6:51 pm   Post subject: RE:2009 Ccc S4

If I understand what you're saying (Which I really don't) I believe that CCC intentually sends in numbers that are out of bounds, and it would therefore be a good idea to error trap the input. However I really don't understand what you are saying, though if you understand, you're welcome.
Zampano




PostPosted: Sat Feb 20, 2010 9:24 pm   Post subject: Re: 2009 Ccc S4

This is in fact the case; if you go to the mmhs solutions site
http://access.mmhs.ca/ccc/index.htm
you will see that the guy's program notes and accounts for this.

Also, if you read the problem statement very carefully, you'll see that no bounds for the cities are ever given.
The sneaky problem writers tried to screw us over. Bastards.
bbi5291




PostPosted: Sat Feb 20, 2010 11:29 pm   Post subject: Re: RE:2009 Ccc S4

USEC_OFFICER @ Sat Feb 20, 2010 6:51 pm wrote:
If I understand what you're saying (Which I really don't) I believe that CCC intentually sends in numbers that are out of bounds, and it would therefore be a good idea to error trap the input. However I really don't understand what you are saying, though if you understand, you're welcome.
No, they don't do anything of the sort. Whatever this erratum was, it was an isolated incident. Should this occur in the future, your proctor should be able to sort things out.

No algorithm contest that requires competitors to detect invalid input is worth writing.
Display posts from previous:   
   Index -> Contests
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: