shubham_tripathi's blog

By shubham_tripathi, history, 8 years ago, In English

Hey guys,today i was solving the problem opponents and it kept giving me a null pointer exception. On the other hand when i ran the code on my pc it worked fine.Can anyone tell me about the possible erro i am having in my code I am also attaching the submission. http://codeforces.com/contest/688/submission/18835087

| Write comment?
»
8 years ago, # |
  Vote: I like it 0 Vote: I do not like it

It would seem that you are causing problems because you have to Input readers. When you use two separate Scanners or BufferedReaders at the same time you may run into problems. My recommendation is to get rid of your buffered reader. Then, whenever you do the "br.readLine()" call, just make it "sc.next()". This will solve your Runtime error. However, your code is still incorrect and will need more work to get AC. Hope this helps!