rajiv_kale's blog

By rajiv_kale, history, 5 years ago, In English

I am using the following code to generate TC for hacks for question E of round 640 but the hacking verdict is generator crashed. What does it mean and where I am going wrong.

Link of the crash log https://imgur.com/alUVkUY

from random import randint as rd
print(10)
for i in range(10):
	print(800)
	for j in range(799):
		print(rd(700,799),end=' ')
	print(rd(700,799))
			
  • Vote: I like it
  • +11
  • Vote: I do not like it

»
5 years ago, # |
Rev. 2   Vote: I like it +10 Vote: I do not like it

"Generator crashed" means that your generator (the program you use to generate the test case)... crashed. You can test your code here or click on the underlined "Generator crashed" text to see what the error was.

  • »
    »
    5 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    It is running without crashing on custom invocation

    • »
      »
      »
      5 years ago, # ^ |
        Vote: I like it +10 Vote: I do not like it

      Weird. Can you look at/show me the error it gives you when you click on the text?

      • »
        »
        »
        »
        5 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        I have added the log as link

        • »
          »
          »
          »
          »
          5 years ago, # ^ |
          Rev. 2   Vote: I like it +13 Vote: I do not like it

          That means it doesn't want your generator to be random, as in, give different outputs for multiple runs. You can make it deterministic (not random) by seeding the random generator in Python (something like this). It will have to be a fixed seed every time.

  • »
    »
    5 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    galen_colin big fan of you

    • »
      »
      »
      5 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      What? There are so many better people to be a fan of, don't waste your time on me :(

      • »
        »
        »
        »
        5 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        no seriously your graph always motivates me

        huge fan of you coder

»
5 years ago, # |
Rev. 2   Vote: I like it +26 Vote: I do not like it

Dammit, now you're even taking help from masters to specifically hack my codes. Just kidding, but you did use this to hack my code. Thanks for the link galen_colin.

  • »
    »
    5 years ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    Sorry :(

    although to be fair, there were so many successful hacks, it probably would have failed during system testing