pvcodes's blog

By pvcodes, history, 14 months ago, In English

Hello peeps! So I all started when solving a C problem, I got the logic but for some TCs it was failing and I wasn't able to see those TCs. So I searched a bit on the web "How to get the testcases of any problem CF?" but found out there are no simple ways to get them. From there I got the idea to make something that turned down to this CF-TESTCASES using some web scrapping technique and CF's own API.

[TL/DR] I wasn't able to get the TCs of the problems. So this CF-TESTCASES gets the job done!!

REPO LINK

Have a look at it and give your valuable feedback!!

Happy Coding!!

PEACE OUT!

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

| Write comment?
»
14 months ago, # |
  Vote: I like it 0 Vote: I do not like it

So this does give the testcases even for large cases (I was too lazy to try it on my own)? Because normally you cant see them. If so you did a great job and this is the best thing ever

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

    That's something I've not tried till now, but I'm pretty confident that it would work just fine. And if still, it fails please raise an issue on the repo with relevant info. We'll look into it.

    If you are talking about hidden test cases, then yes they'll will be fetched 100%

    At first, I thought you were talking about large testcases which are over an away in a number of testcases

    • »
      »
      »
      14 months ago, # ^ |
        Vote: I like it +9 Vote: I do not like it

      I haven't installed the tool, but I may know what the problem is. From skimming your code, it looks like your tool goes to the webpage of an AC submission and downloads the test cases from the corresponding text boxes. However, this does not work for test cases over a certain size. Consider test case 4 at this link, for example: after printing a certain number of characters, the input is truncated.

      My understanding is that Codeforces does not make full test cases available to reduce problem theft.

»
14 months ago, # |
  Vote: I like it +1 Vote: I do not like it

It seems that this tool has been having some problems fetching very large test cases due to Codeforces truncating tests. A really slow solution (that may be against Codeforces rules) would be to implement a hacky way of getting test cases. Since the program output is included in the submissions page, you could, in theory, submit code that prints out the first 50 lines of input, then the next 50, and so on. This would require significantly more work to implement, but it could likely be done (albeit, very slowly).

»
14 months ago, # |
  Vote: I like it +11 Vote: I do not like it

(I assume) The tool fetches the submission HTML page and then extracts the embedded test case. As the response page truncates the test input but only show first N characters of each test, I don't see how magically the tool works around it and likely it does not. To get test input with O(1000) numbers, people can throw exception in the code to show a chunk of such numbers and do it in O(20) submissions, which is rather tedious and not feasible for larger input.

The real solution would be for CF to provide a download link for compressed test inputs. Maybe the concern was additional network traffic and server load. It will be a nice feature to have.

»
14 months ago, # |
  Vote: I like it 0 Vote: I do not like it

This is pretty cool TBH, but I kinda like the fact that we can't really see the testcases. I think that's intended, you know

»
6 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Did You find any way out for this. I am also facing the issue of ... after certain length