### aram90's blog

By aram90, 9 years ago,

I have found a little trick recently that can help you to grab not big tests when solving tasks from problemset. A lot of people were complaining that when showing the test on which program gives a wrong answer, only some part of it is shown, so that complete test case couldn't be seen. If test case contains for example 100 lines, but system displays only first 20 lines of input, as well as 20 lines of the standard output of the program, then such strategy could be used: we add a check in the program — if the certain test case is given, it outputs lines 21 — 40 of the input file. In the next submission — output 41 — 60 lines, etc. So you can grab the input file part by part if it is not too big. Or if it is too big, you can just add the same check for certain input file, and use the output for debugging info (for example, output minimum from the numbers given, etc.). This method just helped me to find the bug in the program on which I got stuck about 3 hours.

• +22

 » 9 years ago, # |   +18 In my opinion, showing error output (may be only first 255 bytes) would be good idea. You can debug your program easily, like it works in TopCoder.
 » 9 years ago, # | ← Rev. 4 →   -21 it's better all input test case put on cloud(for example in box.com , 5G free and even 50G for android user...) and those link added to end of each test case , maybee it will be useful. :)
 » 8 years ago, # |   -11 good idea for wa..but I Got TLE ... waht to do???
•  » » 8 years ago, # ^ |   0 Well, you'll only get a verdict "Time limit exceeded" in your submissions, system won't show you mistake in your code :)
•  » » 8 years ago, # ^ | ← Rev. 5 →   -8 For example if your code gives a TLE verdict in this test case: 5 2658 13332 2223 312 2324 599 13332 2223 312 2324 599 . . . 13332 2223 312 2324 599 in your program you just write if (n == 5 && m == 2658) ... Just print from 1-20 lines of the input, and then from 21 — 40 and so on. But if there is another test case with same n and m, for examle this 5 2658 13332 2223 312 2324 499 13332 2223 312 2324 599 . . . 13332 2223 312 2324 599 You just have to find the difference between this two test cases (here it is a[0][4]) and if you need the first test case you write if (n == 5 && m == 2658 && a[0][4] == 599) if you need second you write if (n == 5 && m == 2658 && a[0][4] == 499). You just have to find the feature of needed test , which no other tests before it have.
 » 8 years ago, # |   +8 I suggest you not to see the test case and instead of that review your code and see if there is any problem with that.it helps you to code better and with fewer bugs in the future.i think seeing the test case makes your mind lazy and it becomes a "trial and error" procedure.you have WA you see the test case you fix the bug.you have another WA you see the next test case and you fix another bug.while this be done faster if you review your code completely.good luck.
 » 8 years ago, # |   +5 two problems:1- if I want test 10 I need my program to pass first 9 test then do what you mentioned to test 102- when your program outputs wrong format the system will not show you your output.
•  » » 8 years ago, # ^ |   +2 1) Mostly you'll need test 10 only if the verdict you have is Wrong answer on test 10, so your program is already correct for the first 9 tests.2) False: see 3196696 (you can see the output even though it is in wrong format)
•  » » » 6 years ago, # ^ |   0 I know this is so old, but the result doesn't appear for me, gives wrong answer although my answer is right.
 » 2 years ago, # |   0 Thank you so much! This helped a lot
 » 12 months ago, # |   -12 Hi for[ https://codeforces.com/problemset/problem/143/A ] what is the wrong here[ https://ideone.com/pk8VRQ ]
•  » » 12 months ago, # ^ |   +5 Hey, why don't you just give us the submission link on Codeforces?
•  » » » 12 months ago, # ^ |   0
•  » » » 12 months ago, # ^ |   0 I solved the error thanks bro.
•  » » 12 months ago, # ^ | ← Rev. 2 →   0 You skipped the last newline./* By the way, what is your point of using multiple accounts? I can guess your rated account. */ Sorry, I found some other probabilities. Now I'm not sure of that.
 » 8 months ago, # |   0 If the test input is quite large then what should I do?
 » 6 months ago, # |   0 Is this thread still on ? I didn't quite get the idea. I want to see inputs for test case 2 but if I modify my code to only generate output for special cases than I'll fail test case 1 and will not be able to access the desired input/output for the test case 2.