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.
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.
good idea for wa..but I Got TLE ... waht to do???
Well, you'll only get a verdict "Time limit exceeded" in your submissions, system won't show you mistake in your code :)
For example if your code gives a TLE verdict in this test case:
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 thisYou 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 writeif (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.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.
two problems:
1- if I want test 10 I need my program to pass first 9 test then do what you mentioned to test 10
2- when your program outputs wrong format the system will not show you your output.
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)
I know this is so old, but the result doesn't appear for me, gives wrong answer although my answer is right.
Hi for[ https://codeforces.me/problemset/problem/143/A ] what is the wrong here[ https://ideone.com/pk8VRQ ]
Hey, why don't you just give us the submission link on Codeforces?
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.
If the test input is quite large then what should I do?