adpq11's blog

By adpq11, history, 22 months ago, In English

Can anyone please see this the attached screenshot? And help me here?

https://mirror.codeforces.com/contest/688/submission/193494269

Tags bug
  • Vote: I like it
  • +22
  • Vote: I do not like it

| Write comment?
»
22 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

I would suggest try compiling it with codeforces compiler which is there under custom invocation tab. Check whether that gives any error.

»
22 months ago, # |
  Vote: I like it 0 Vote: I do not like it

I played around with your code and found it was a problem with your reader. Somehow messed up the reference data. Your code using BufferedReader instead: 193524061. Just stick with BufferedReader and PrintWriter for now. You don’t need any fancy readers on problems like these. If you want a good fast reader for java you can look at this guide: https://usaco.guide/general/fast-io?lang=java

»
22 months ago, # |
  Vote: I like it +1 Vote: I do not like it

If you log the chars the program reads at the readLine() function, you will get '1', '\r', '\n' (and it returns "1\r"). Therefore, your program prints "1\r\r1".