DottedCalculator's blog

By DottedCalculator, history, 18 months ago, In English

In the recent div 3 and div 4 rounds, I keep getting hacked.

  • Vote: I like it
  • +12
  • Vote: I do not like it

| Write comment?
»
18 months ago, # |
Rev. 3   Vote: I like it +33 Vote: I do not like it

Submitting your recent hacked solution adding in

import sys 
input = sys.stdin.readline

ACs in 326ms/2000 ms.

In problems with many testcases, calling print $$$T$$$ times, can be very slow, so it can be much faster to store all $$$T$$$ answers in an array out and call

print('\n'.join(map(str, out)))

once at the end of your programs.

»
18 months ago, # |
  Vote: I like it -16 Vote: I do not like it
The only possible way that guarantees that you will avoid being hacked
»
17 months ago, # |
Rev. 2   Vote: I like it +13 Vote: I do not like it

It happened again, this time in C++ :(

  • »
    »
    17 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    You can use the following code to speed up cin and cout.

    code
  • »
    »
    17 months ago, # ^ |
      Vote: I like it +30 Vote: I do not like it

    How ? I see you solved the 8 questions and global rank 4

»
17 months ago, # |
  Vote: I like it +19 Vote: I do not like it

Now, you've hacked the editorialist's solution itself.