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

Автор mjnovice, 11 лет назад, По-английски

I am just curious that how do the problem setters create the strong test cases for problems, say which involve strings of size 10^6. I dont think they type a string of length 10^6. Can anyone enlighten my mind on this ?

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

»
11 лет назад, # |
  Проголосовать: нравится +12 Проголосовать: не нравится

You can write a code that generates an input. Using a random number generator, you can create random test cases. Then you need large worst cases where some slow approaches (which are fast on random tests) would TLE; those cases usually satisfy some conditions using which you can generate them. Just special cases are made by hand.