Now you can use test cases developed by
other users to test the correctness of your program
Test Case Generation
You can develop a variety of random test cases on your own to use as input for any program
Multiple Contributions
Now you can contribute solutions to many problems in one go. Just click on problem links displayed against your SPOJ username and upload the corresponding codes for the problems one by one. This version of SPOJ Toolkit also supports Java and Python codes.
How to test your code?
Enter the Problem Code in 'Test Your Code' SearchBox of Home Page.
If We have the Correct Solution of the Problem you asked for,a dropdown containing that problem appears.
Click on the problem link.
Enter your own test input or take a test input from the Available Test Cases for the problem.
Wait for the correct output to be generated in the Output Box.
Your Input format should be same as the SPOJ Input format for the given problem,
otherwise you may get random outputs (GARBAGE IN ,GARBAGE OUT).
You can generate as many test cases as you want by entering the number of test cases.
Auto Populate
Why take the pain of entering values in form fields??
Click "Auto Populate",it will automatically fill the form fields.
Editable Output Area
The textarea in which output is generated is editable. So you can easily edit or add any content to the
output generated thus creating an input test case according to your need.
Custom output
This textarea provides you with the advantage of amalgamating test cases generated by you seperately. Say you need an array followed by a graph.
First generate an array of the required size. The output is visible in the Current Output box. Append this output to the Custom Output Box.
Click on the Graph Tab and generate a graph. Again append the output generated to the Custom Output box.
The Custom Output box will now contain an array followed by a graph. Cheers!!!
Download Button
You can easily download the contents of the active output box(Current Output or Custom Output) by clicking on the download button.
Random Numbers
Enter the minimum and maximum value between which the numbers can lie and click on "Get Output" button
Random Arrays
Enter the size of array (N)
If you wish to have all distinct elements in an array, set Distinct Numbers to True.
Enter the maximum and minimum value which each number of array can attain
Random Array Of Pairs
Enter the number of pairs you wish to generate(N).
If you wish all the pairs to be distinct, set Distinct Pairs to True
Enter the maximum and minimum value(minA and maxA) which first number of each pair can attain.
Enter the maximum and minimum value(minB and maxB) which second number of each pair can attain.
Sometimes pairs with first number < second number are required. To generate such pairs,set A < B to True
Random Matrix
Enter the dimension of matrix (N,M)
If you wish to have all numbers in matrix distinct, set Distinct Numbers to True
Enter the maximum and minimum value which each number of array can attain
Random Strings
Enter the size of the String to be generated.
If you want to have all distinct characters in the String, set Distinct Characters to True.
The Generator takes a string(S) as input which contains all allowed characters in the string to be generated.
You can create S either by clicking buttons "A-Z","a-z","0-9" or by writing the allowed characters in box provided.
To allow any special characters in generated string, you need to append the characters to string in box.
Ex1:To generate random alphanumeric strings like "qwerty012hs678try", just click "a-z" and "0-9" button.
Ex2:To generate strings like "0363#7874", write the special characters in box and click on "0-9" button
It should be noted that the frequency of a character provided by you determines the probability of its occurrence. If a character is entered multiple times as in (aaaacbb), it will produce strings with frequency(a) > frequency(b) > frequency(c) in the proportion provided.
Random Character Matrix
Enter the dimensions of the Character Matrix
Enter the string of allowed characters as explained above.
Ex. To generate a 2x7 matrix of 0,1 and # , just write these characters in allowed characters box without spaces.
Output Row 1: 0101001
Output Row 2: 010#101
This can be helpful in generating graphs with 0,1 matrix.
If you have to generate a matrix with characters "#." with "." occurring a lot more than "#", you can enter ".....#" (in any proportion you want) in the Characters Allowed box.
Random Unweighted Tree
Enter the number of nodes in Tree.
Set node indexing to 0 if you wish the node numbering to start from 0.
Random Weighted Tree
Enter the number of nodes in Tree.
Set node indexing to 0 if you wish the node numbering to start from 0.
Enter the minimum and maximum weight which edges of tree can attain.
Random Unweighted Graph
Enter the number of nodes and edges in Graph.
Set node indexing to 0 if you wish the node numbering to start from 0.
Random Weighted Graph
Enter the number of nodes and Edges needed in Graph.
Set node indexing to 0 if you wish the node numbering to start from 0.
Enter the minimum and maximum weight which edges of graph can attain.
Why Contribute?
Your contribution will help other users test their codes
You will be listed as our Contributor in our Contributor's Page. Further, your username will be visible to all users testing the problem which you contributed.
How to Contribute?
On the Contribute Page, Enter your SPOJ Username and click on the "Go!" button.
This will display the list of those problems from your SPOJ account which are not present in our Database.
Select the problem you want to contribute
Choose the correct solution from the dialog box which opens.
Repeat the same procedure for other problems until you have contributed all the solutions you want. The middle section of the page will display the details of all your contributions. When you are finally done, click on the Done! button.
This will upload all your soutions to our server one by one.
Wait for few minutes. We will verify your solutions on SPOJ.
You can refresh the page to see the status of your submissions.
The solutions which are accepted on SPOJ are added to our database. The rest are rejected.
Facebook
Post your queries of our fb page . We will reply back as soon as possible.
Gmail
You can also mail your solutions/queries at spojtoolkit@gmail.com