850 - Crypt Kicker II

All about problems in Volume VII. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Re: 850 - Crypt Kicker II

Postby brianfry713 » Fri Feb 17, 2012 9:54 pm

I ran your code with the sample input and didn't get any output.
http://ideone.com/U2yQy
brianfry713
Guru
 
Posts: 1771
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 850 - Crypt Kicker II

Postby Monty » Fri Feb 17, 2012 11:36 pm

I am not sure how that website works, but if you copy the code into a compiler like eclipse for example and run it, it will take input from the console and output.
Monty
New poster
 
Posts: 7
Joined: Fri Feb 17, 2012 10:24 am

Re: 850 - Crypt Kicker II

Postby brianfry713 » Tue Feb 21, 2012 9:14 am

I ran it with some inputs with more than one case and it's not giving all the outputs:
http://ideone.com/NCjwN
brianfry713
Guru
 
Posts: 1771
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 850 - Crypt Kicker II

Postby Monty » Mon Feb 27, 2012 2:50 am

The reason for that is because your input does not include a trailing new line. You need that in order to see if you are done with the input or typing a new line. Since we don't know how many lines there are for each input, I wait for the user to send a blank new line before terminating. Without that how else would you know? I wish it included the number of lines for each test case in it, that would simplify things. The input you tried didn't include that. The runtime error the website says is due to the system.exit I believe, because it still produces the proper output. Thanks

Edit: One of the things I just noticed was that I was trimming the input lines so I was losing leading spaces in the output. Even after fixing that I am still getting WA, hmm.
Monty
New poster
 
Posts: 7
Joined: Fri Feb 17, 2012 10:24 am

Re: 850 - Crypt Kicker II

Postby brianfry713 » Mon Feb 27, 2012 8:24 am

The problem description does not say that there will be an extra blank line at the end of the input. Check for end of file.
brianfry713
Guru
 
Posts: 1771
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 850 - Crypt Kicker II

Postby Monty » Mon Feb 27, 2012 12:03 pm

I didn't have trouble with that in previous problems, also I am following what they did here.

http://www.programming-challenges.com/p ... e=javainfo

What character should I be looking for, for EOF? I tired '\0', that didn't work. I just need to know when the last line is finished so I can process right there without waiting for a carriage return.
Monty
New poster
 
Posts: 7
Joined: Fri Feb 17, 2012 10:24 am

Re: 850 - Crypt Kicker II

Postby brianfry713 » Tue Feb 28, 2012 3:18 am

ReadLn will return null at end of file.
brianfry713
Guru
 
Posts: 1771
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Previous

Return to Volume VIII

Who is online

Users browsing this forum: No registered users and 1 guest