Please read the new rule regarding the restriction on the use of AI tools. ×

mjnovice's blog

By mjnovice, 11 years ago, In English

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 ?

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

»
11 years ago, # |
  Vote: I like it +12 Vote: I do not like it

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.