| Language | Version | Time limit (in seconds) |
Memory limit (in MB) |
Notes |
|---|---|---|---|---|
| C | gcc 4.6.1, C99 Mode | 3 | 256 | Math library included (-lm) |
| C++ | g++ 4.6.1, C++0x Mode | 3 | 256 | Math library included (-lm) |
| C# | Mono 2.10.5, C# 4 | 5 | 256 | Name your class Solution |
| Python | Python 2.7.2+ | 16 | 256 | |
| Java | Sun Java 1.6 | 5 | 256 | Name your class Solution |
| PHP | PHP 5.3.6 | 16 | 256 | |
| Perl | Perl 5.12.4 | 16 | 256 | |
| Ruby | Ruby 1.8.7 | 16 | 256 | |
| Haskell | GHC 7.0.3 | 5 | 256 | |
| Clojure | clojure 1.2 | 5 | 256 | Name your namespace solution with :gen-class attribute |
| Scala | scala 2.8.2 | 5 | 256 | Have your entry point inside an object named Solution |
These run on quad core Xeon machines running 32-bit Ubuntu. You should, however, write your programs in a portable manner and not assume that it will always be run on a 32 bit architecture.
Your score depends primarily on the number of test cases your code passes. If you've solved the same problem multiple times, the solution with the highest score would be considered. Small amounts of bonus points are awarded for solving it in least number of tries.Question solved by lesser number of coders get more points than questions solved by more number of programmers. Right now, we do not consider length of the program, speed of execution or memory usage for the score (as long as your code produces proper output inside the stipulated time and memory limits). For more information on scoring click here.
Our platform runs your code against a certain number of testcases everytime you submit code. A test case consists of input data that is fed into your program, and the output expected from your program for that particular input. So, a test case succeeding means that your program produced correct output for that particular input, while a failure means it didn't produce the expected output (either wrong output or it took too long and was killed). A 'large' test case means a test case with a large input. You can check how many testcases your submission passed in the submissions tab. For example, "10/15 testcases passed" means your submission passed 10 out of our 15 testcases, and failed on the 11th one.
We look for optimal algorithms in your solutions. Every problem has been set a timelimit with respect to its optimal solution. If your code could not produce the required output within the set time limit, you get a 'Time Limit Exceeded' error. For example, if you get a Time Limit Exceeded message and 5/10 testcases have passed, your code was unable to handle the 6th test case within the stipulated time. Test cases get progressively larger, so it is not uncommon for a naive solution to pass the first few (smaller) test cases and then falter when confronted with the bigger ones.
Your logic is wrong, or you have formatting issues. Make sure that the output format is exactly the same as specified in the problem statement. Check for extra/missing whitespaces/newlines. If a few test cases have passed, that probably means some of the later test cases have edge cases that your code is not handling. Think about every possible edge case within the problem specifications (you will never be given invalid input), and handle them.
All runtime errors (segfaults, stack overflows, uncaught exceptions, etc) will also show up as 'Wrong answer'. So check for runaway recursion and allocating too much memory as well.
If you're using Java/Clojure/Scala, please ensure that you follow the appropriate class/package naming guidelines. These are essential to get your code to run.
In most problems, you would read input from STDIN (Standard Input) and write output to STDOUT (Standard Output). Different languages have different methods of accessing STDIN and STDOUT. The most common (possibly naive) methods are listed below.
| Language | STDIN | STDOUT |
|---|---|---|
| C | scanf(), gets(), getchar() |
printf(), puts(), putchar() |
| C++ | cin |
cout |
| C# | Console.ReadLine() |
Console.WriteLine() |
| Java | Example | |
| Python | raw_input() |
print |
| Ruby | gets |
puts |
| Perl | <STDIN> |
print |
| PHP | Official Documentation | |
| Haskell | Official Documentation | |
Note that these are not the only ways to access STDIN and STDOUT - just the most common.
Nope. No trailing spaces or newlines.
These problems were provided by certain companies. Other than the problem content, it is just like any other problem, and any company is free to weight its importance how they see fit. It is reasonable to assume that the company which provided this problem is likely to weight this problem higher, but that's about all the additional information you can infer from its status as a Company Problem.
In order to keep things fair, we can't give additional test cases or provide any specifc hints to code. Any information that we give must be general and public.
For problem clarification, CodeSprint logistics questions, or just to chat with the CodeSprint team, please join us in the IRC freenode channel #codesprint
For account specific questions, such as a submission queued for greater than 10 minutes, please email us at support@interviewstreet.com. We know you guys have a limited amount of time for this, and we'll try to get back to you as soon as we can.
This is the type of problem in which there can be more than one correct answer and the user's program can produce any one of them, the judge will evaluate the solution based on the output. Generally optimisation problems can be of this type, where the most optimal solution is not possible within the time constraint, but a close result can be obtained.
Your program is given the input test cases, and the output generated by your program is given to the judge. The evaluator allots some score for the output generated by your program.
In permutation problem you can print any permutation of number, which will be accepted as a solution. But score for different permutations are not the same, scoring method will be explained in the question. So you should try to generate a permutation which will maximise your score.
Similarly for the classification problem, your score is based on the number of correct classification.
The difference between normal problem and approximate solution problem is that, exact output is not expected. Your submission will be scored on the basis of how near it is to the actual solution.