xiaruize's blog

By xiaruize, history, 6 weeks ago, In English

I used random_device in order to generate a random number in this code.

On my own Windows, Ubuntu Virtual Machine and WSL, this code can generate different random numbers each time, but on Codeforces it generates the same number every time, so this gives people a way to hack your submission even if xor-hashing is in the formal editorial and the possibility of coincidence in hashing is nearly impossible.

I submitted the same code in C++20 and C++23, got Accepted. So I am wondering that is this problem only for C++17 or just nobody know the number of random_device in C++20 and C++23, so that they are not able to make a hack.

I suppose this problem should be fixed in order to avoid more solutions being hacked because of unawareness of a fixed 'random' number.

Or any other way to generate random numbers is suggested?

p.s. I tried $$$40000$$$ times on my PC and got all correct.

Full text and comments »

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

By xiaruize, history, 2 months ago, In English

Does anyone have the ranking site of IOI2024?

The old ranking page doesn't change

Full text and comments »

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