Cash_carti_bitch's blog

By Cash_carti_bitch, history, 3 years ago, In English

Hello CF community, I am solving 339D - Xenia and Bit Operations and I get Time Limit on Test 7, Here is the submission 125178552. I have written the same solution in c++ and it is quick and got accepted, but I am new to Java 11 and I don't know why I get a time limit, please help me.

  • Vote: I like it
  • -3
  • Vote: I do not like it

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

Dude, this has been answered so many times. You're using the Java Scanner Class, which is notoriously slow. If you want a good reading class, check out https://medium.com/@ssrivastava990/a-java-template-for-competitive-coding-b810fbda77c9, otherwise check out https://www.geeksforgeeks.org/fast-io-in-java-in-competitive-programming/.