### Lusterdawn's blog

By Lusterdawn, history, 2 years ago,

When my solution fails on a larger testcase, I can only see the first few lines of the testcase and have to submit again and again to find out what's going wrong with my code. I think it would be much easier to debug if I can download the testdata. In this way I can test my solution locally.

I'm not sure if here is the right place to ask, but is there any way to download the testdata of the problems?

• +142

| Write comment?
 » 2 years ago, # | ← Rev. 2 →   +98 Idk why this has so many down votes. It's a good question, a feature that would be super nice, and you have an undertale-themed name; what's not to like?The short answer is: no, unfortunately there isn't. Or not to my knowledge at least.
•  » » 2 years ago, # ^ |   +3 Thank you for your reply. I know it is available in many other OJs and I thought it's also true for codeforces =(
 » 2 years ago, # |   0 Atcoder has a button to download the testdata
•  » » 2 years ago, # ^ |   0 I could not find it at Atcoder. Could you please suggest where is this option?? Thanks
•  » » » 2 years ago, # ^ |   +1 You can download from here
 » 2 years ago, # |   +9 Commenting for better reach since this is a much needed question. Hope you get what you were looking for.
 » 2 years ago, # |   +6 Hey! There is one method but sometimes it's very tedious.Analyze the test case. And find some things that are not in the previous test cases. Exampleif(n == 1000 and a[5] == 7 and a[0] == 0){ // print the data or do some operation with it here. } Sometimes it happens that there are many tests in one test case. In that case, you can check for the test case number and print the input. Exampleint t; cin >> t; for(int i = 1; i <= t; i++){ // input the data if(t == some_test_case){ // print it } } 
•  » » 7 months ago, # ^ |   0 Thanks! It worked.
 » 2 years ago, # |   +9 No, but there should be. I really cannot think of a reason to justify making a test case data partially accessible. When it is not hidden, it should be completely visible.
•  » » 2 years ago, # ^ |   +28 I can: if you have the complete test data, it's easy to steal problems: writing a checker is usually trivial.
•  » » » 2 years ago, # ^ |   +8 But is that really the reason why test cases are hidden?
•  » » » » 2 years ago, # ^ |   +8 I don't know for sure of course, you'd have to ask Mike, but Codeforces has at least at one point cared about that, so it's not a completely unreasonable assumption. Of course it could just be that it is hard to implement for some reason.
 » 2 years ago, # |   +19 well downloading the big test cases is like making a big test case, because if you download it, how do you want to debug it!? so if you want to find a test case and debug your solution, you can write another program which you are completely sure that is working (even if its complexity is too bad) then make a big test case(you can use random) and then check your solution with the other one. then you can find a smaller test which your program is giving WA. it works most of the time.
•  » » 2 years ago, # ^ |   +9 Normally this is what I do, but sometimes it is hard to generate strong tests. If I can download the testcase I can test my solution easily instead of submitting over and over again, waiting for the verdict
•  » » 19 months ago, # ^ |   -18 It is appalling that many high-rated coders don't know how to debug a program on a large test case.Hint: debugging has nothing to do with "Debug" button in your IDE.
 » 2 years ago, # |   0 Having a feature like CSES would be nice. You can press the eye and the whole test would pop up.
 » 19 months ago, # |   +16 It would be very useful to have this feature.Although some people say it's impossible to debug the program with an array of N=10,000 elements, I still find it useful, and I can provide an example.Recently, I have struggled with the problem which assumes a lot of if-branches in the solution. The structure of my solution was like this: if (...) return "NO" if (...) return "NO" if (...) return "NO" return "YES" When I checked out my submission status, I could see that my program returned NO when there should be YES.Of course, I wouldn't analyze the entire test case of size 10,000, but at least I could find out what branch led to NO answer.To that end, I had to manually extract the test case. I did 20 submissions in order to print the input data and concatenate it afterwards.Once I merged everything, I was able to run the test and find out the wrong branch. It was extremely helpful.I wish codeforces had an opportunity to download tests in order to avoid "manual extraction and concatenation" of test data through 20+ submissions.