ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1881. Long problem statement

WA#5
Posted by gochapod 3 Aug 2013 15:41
I have a problem with 5 test case. Firs I had Runtime Error, when I add lines:

   if(nextWord == null)
      continue;

Runtime Error changed to WA.

I'm using Java and i read my input as follow:
    StreamTokenizer in = in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));

    private static int nextInt() throws IOException {
        in.nextToken();
        return (int) in.nval;
    }

    private static String nextString() throws IOException {
        in.nextToken();
        return in.sval;
    }