Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Блог пользователя adpq11

Автор adpq11, история, 20 месяцев назад, По-английски

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

https://codeforces.net/contest/688/submission/193494269

Теги bug
  • Проголосовать: нравится
  • +22
  • Проголосовать: не нравится

»
20 месяцев назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

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

»
20 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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

»
20 месяцев назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

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".