getitright's blog

By getitright, history, 2 years ago, In English

Is there any codeforces test case scrapper available which can give me all the test cases of the problem? Also, how do I get to know the large test cases of the problem for which my solution failed?

Thanks.

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

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

No such thing around because the full text isn't even shown for long tests. Your best bet is to check if you can retrieve the test case via CF API. If you cannot, then you gotta ask admin for help. Other than that, it is only possible through a very stupid hack.

Just keep submitting your code and print the test case contents instead of the answer.

Anyway, I don't know how you are going to debug your code even if you get that large test. Small tests (checkable by humans) should be used to manually check for correctness.

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

    Your hack won't really work that smoothly either. Codeforces only shows about 600 bytes of the output as well. API doesn't have them as well.

    I wanted to write this scrapper and add it to my API wrapper but never got to doing it yet. In theory you will have to submit multiple times for the same test case to print the input 400 500 bytes at a time. The problem that I didn't really like thinking about was how when are you going to decide to output the correct answer to let your script or whatever get to the next test case (since codeforces terminates your thing on the first WA).

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

      In theory you will have to submit multiple times for the same test case to print the input 400 500 bytes at a time

      That was the intention of my hack. Just that I assumed this would be obvious to readers.

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

      The problem that I didn't really like thinking about was how when are you going to decide to output the correct answer to let your script or whatever get to the next test case (since codeforces terminates your thing on the first WA).

      Actually, that's pretty easy. Let's have a precursor that there is at least one AC solution for that problem. Then the person submitting that code has to do a comparison between his output and the AC code output, on the first difference, just print the test case.

      This trick is also applicable in cases where the correct answer is completely visible (e.g. "Yes", "No" output).