Common guidelines for composing solutions...

Feel free to ask any questions related to the COJ.
Post Reply
User avatar
ymondelo20
Posts: 1968
Joined: 7 years ago
Location: Universidad de las Ciencias Informáticas
Gender: None specified
Contact:

Common guidelines for composing solutions...

Post by ymondelo20 » 7 years ago

The judge systems challenges you with thousands of programming problems which demand diverse ideas and techniques to solve. Nevertheless, you must write the solutions in accordance with certain common guidelines so that they are judged as intended.

Guideline 1 - Do exactly what the problems demand.
A mistake made by some newcomers is to print some friendly-looking prompt messages such as “Please input an integer” which the problems do not ask for. Another example of violating this guideline is to leave debug information in the output. Judge systems are automated. There is no human involvement in judging the solutions. Neither the administrators nor the developers will read any output by the solutions in normal circumstances. Hence, unrequested prompt messages are virtually useless. Worse still, undesired output may mess with the jugding process, which in all probability will lead to rejection of the solution, even though it is logically correct.

Guideline 2 - Access only the standard input, the standard output and the memory.
Your solution must always read the input data from the standard input and write the output data to the standard output. The only location that your solution can utilize for storage is the memory. Access to other resources such as disks and the file system is denied by the judge systems. Any such attempt results in a security violation, and is rejected by the systems.

Guideline 3 - Write standard-conforming code.
Judge systems promote the use of standard-conforming code. Certain compilers offer vendor-specific features beyond language standards. Judge systems have made efforts to disable these features to advocate standard-compliant programming practices. Solutions using these features are likely to fail compilation.


"Every problem has a simple, fast and wrong solution" OJ's Main Law. ;)

Post Reply

Return to “FAQ”