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 1098. Questions

Stuck at WA#3
Posted by begi 30 Nov 2014 18:39
Can someone provide more tests?
I am using scanner.nextLine() to read
line.charAt(pos) == '?' to compare in java and also Josephus allgorithm:
jos[1] = 1;
for (int i = 2; i < max_n; i++) {
    jos[i] = (jos[i - 1] + 1998) % i + 1;
}
My code is so small that I don't even know where is the bug
Re: Stuck at WA#3
Posted by begi 8 Dec 2014 20:13
Ok, the thing is I misunderstood the problem.

You read ALL the input ignoring new lines, and then do the 'process'.
I was reading line by line and doing 'process' for each line.
Hope it will help the others.