Is there some way to put our hand on good test data files to test our
programs? The problems provide some example but they are generally a few and they generally do not test for extreme, particular, or special
cases. I propose the following: every time we start solving a problem
we can request what we could call I/O data (IOdata) for the problem that we are
working on. People in the forum should provide their IOdata files of special,
extreme, and particular cases... also, the answers! Good IOdata without
answers worth nothing! When you request an IOfile make sure that the topic
includes the keyword "IOdata" followed by the problem number, keeping this
simple convention will make it easy to find all a good set of data to test your
solutions. i.e.:
If you do not know what this topic is all about, then read the topic "Where to find good test data file???" posted shortly before this one; or just go there directly http://online-judge.uva.es/board/viewtopic.php?t=7350
Thank you for your replay! that one look like a good particular case. Would you happen to have some cases close to the memory limits impose by the problem? 30 boxes with dimensionality 10 (a 30x10) . Or cases that test the range of the input types in the function signatures, meaning, when the value of the dimensions is really large and should be handled with the proper storage types:
int : 16-bits ---> the largest value for a box dimention can be 32'767
unsigned: 16-bits ---> the largest value for a box dimention can be 65'535
unsigned long: 32-bits ---> the largest value for a box dimention can be 4'294'967'295
By the way, do not post your IOdata here! Post them under the topic "Requesting: IOdata # 103" located at http://online-judge.uva.es/board/viewtopic.php?t=7354 ; in that way every body should be able to find them through the topic.
If you submit via the OJ www interface, you'll have the exact error message delivered to your email. Anyway, try to remove <ostream.h> as you seem not to use it at all, maybe that will help.
My program s produced the correct answers to all the sample inputs, but got a wa. Plz help!!!!!!!!!!
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int k,n;
int box[30][12];
int cmp1(const void *p,const void *q){
const int *a=p,*b=q;
int i,s1,s2;
The first and obvious problem with this code is that it's WAY too long, thus complicated, thus bug prone. I did not read it, my guess is an array limit exceeded because of a "special" test case. However, there is a better way: look around for previous topics on 103 and look at those algorithms. I remember seeing one that must have been about 25 lines long, and EASY!
Best regards,
Understanding a problem in a natural way will lead to a natural solution
I'm sorry, I confused the prob with ecological bins(102) . My first observation stands though, plus you should consider not using malloc, especially for n, which is given (1 to 10), and for k 100 should suffice.
I get WA on this one though the test cases I've seen on forum work with my code. I've combined them: