joker1569's blog

By joker1569, 12 years ago, In English

http://ideone.com/cfqTA0 Could anyone help me to fix this error. java.lang.NullPointerException at Main.Solve(Main.java:18) at Main.Run(Main.java:57) at Main.main(Main.java:12) I dont know why this code have this errors. It running normal and give correct answer on my computer, but when i submited on timus, it is non zero error. This problems in acm.timus.ru is 1297. Sorry for my bad english. Anyway, thanks you for reading.

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
12 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

But you submitted it at IdeOne without input data, so input string s is null and yields NPE on getting length.

If you input something (from the sample of Timus, for example) it works:

http://ideone.com/Tgi3fg