Online Programming Server

Login

Login with facebook [?]

Facebook

Help / FAQs

  1. How to use this website?
  2. What are the configurations and environment of the Judge System?
  3. Can you show an example problem for the Judge System?
  4. What do the messages from the Judge System mean?
  5. Why did my program got a Compile Error? I can compile it with Visual C++!
  6. What commands can be called in my bash script?
  7. How do you calculate the contest ranking?
  8. Who made this website?
  9. How did you build this website?
  10. Who maintain this website?

How to use this website?

Please take a look at our list of video tutorials on YouTube.

What are the configurations and environment of the Judge System?

The Judge System, which is the program compiling, running and testing system, is running on Debian Linux.
The compilers we use are:

LanguageCompilerCommand used for compilationCommand used for running
Cgcc 4.4.5 glibc 2.11.3gcc Main.c -o Main -O2 -Wall -lm --static -std=c99 -DONLINE_JUDGE./Main
C++gcc 4.4.5 glibc 2.11.3g++ Main.cc -o Main -O2 -Wall -lm --static -DONLINE_JUDGE./Main
PascalFree Pascal Compiler 2.4.0fpc Main.pas -oMain -O1 -Co -Cr -Ct -Ci./Main
JavaJava 1.6.0javac -J-Xms32m -J-Xmx256m Main.javajava Main
Rubyruby 1.8.7ruby -c Main.rbruby Main.rb
BashGNU bash 4.1.5(1)-releaseN/A/bin/bash Main.sh
PythonPython 2.7.3python -c import py_compile; py_compile.compile(r'Main.py')python Main.py
PHPPHP 5.3.3N/Aphp Main.php
PerlPerl 5.10.1N/Aperl Main.pl
C#Mono C# compiler 2.6.7.0gmcs -warn:0 Main.csmono --debug Main.exe

Can you show an example problem for the Judge System?

Yes. Please take a look at the following example programs that can solve Problem 1000:

/* Language: C */
#include <stdio.h>
int main()
{
	int a,b;
	while(scanf("%d %d",&a, &b) != EOF)
	{
		printf("%d\n", a + b);
	}
	return 0;
}
// Language: C++
#include <iostream>
using namespace std;
int main()
{
	int a, b;
	while(cin >> a >> b)
	{
		cout << a+b << endl;
	}
}
{ Language: Pascal }
program p1000(Input,Output);
var
	a,b:Integer;
begin
	while not eof(Input) do
	begin
		Readln(a,b);
		Writeln(a+b);
	end;
end.
// Language: Java
import java.util.Scanner;
public class Main
{
	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		while (in.hasNextInt())
		{
			int a = in.nextInt();
			int b = in.nextInt();
			System.out.println(a + b);
		}
	}
}
# Language: Ruby
a=gets.chomp
b="0"
a.each_line(" "){
	|d|
	b=b+"+"+d
}
puts eval(b)
# Language: Bash Shell Script
read a b
echo $(($a+$b))
# Language: Python
import sys
for line in sys.stdin:
	a = line.split()
	print int(a[0]) + int(a[1])
// Language: PHP
<?php
while (fscanf(STDIN, "%d%d", $a, $b) == 2)
{
    print ($a + $b) . "\n";
}
?>
# Language: Perl
#!/usr/bin/perl -w
while(<>)
{
	chomp;
	($a,$b)=split(/\s/,$_);
	printf "%d\n",$a+$b;
}
// Language: C#
using System;
public class Sum
{
	public static void Main()
	{
		for(int k = 0; k < 1; k++)
		{
			string[] tokens = Console.ReadLine().Split(' ');
			Console.WriteLine(int.Parse(tokens[0]) + int.Parse(tokens[1]));
		}
	}
}

What do the messages from the Judge System mean?

MessageDescription
PendingYour program submission is placed in queue and will get judged soon.
Pending RejudgeThe administrators decided to judge your program submission again, so your program is placed in the queue waiting for the judge.
CompilingThe judge is starting up and compiling your program source code.
RunningThe judge is running your program, expect to have a result soon.
AcceptedBingo! Your program is correct and passed all test cases!
Presentation ErrorYour program is correct but the output format is not exactly the same as the one expected by the judge.
Wrong AnswerYour program does not generate the correct output for the test cases. Please revise your program and try again.
Time Limited ExceededYour program does not finish running before the time runs out. You may have to try a faster algorithm.
Memory Limit ExceededYour program use up too much memory, each problem have a specific memory limit and you must not use more than that.
Output Limited ExceededYour program generate too much output that must lead to a Wrong Answer if the judge continue, so the judge stops for performance reason.
Runtime ErrorAny other errors during the running phase will result in this message. This includes "Segmentation fault", "Floating Point Exception", use of restricted functions, and any other reason that your program terminated in a sudden.
Compile ErrorThe judge cannot compile your program source code. Please make sure your program syntax is correct and can be compiled with the compilation commands given.

Why did my program got a Compile Error? I can compile it with Visual C++!

Refer to our Judge System Environment, your C or C++ program is compiled with gcc on our system. Here's a few hints that why your VC++ program didn't work:

  • The main function must be declared with int as return type. "void main ( ... )" will get a Compile Error definitely.
  • i is out of definition after block "for(int i=0...){...}".
  • itoa() is not in ANSI C standard. Use sscanf() instead. See "Portability" in this page for details.
  • __int64 is not in ANSI C standard. For 64-bit integer, use long long instead.

What commands can be called in my bash script?

There is a minimum set of commands you can call in your bash script.

  • awk
  • cat
  • dc
  • dd
  • grep
  • head
  • join
  • sed
  • sort
  • tail
  • tr
  • wc
  • xargs

How do you calculate the contest ranking?

The contest ranking follows ACM contests's ranking algorithm:

  • Each submitted solution will be judged and either accepted or rejected.
  • The problem is considered solved, if one of the solution submitted for that problem is accepted.
  • The time consumed for a solved problem is the time elapsed from the beginning of the contest to the submission of the first accepted solution for this problem (in minutes) plus 20 minutes for every other solution for this problem before the accepted one. For an unsolved problem consumed time is not computed.
  • The total time is the sum of the time consumed for each problem solved.
  • Users are ranked according to the number of solved problems. Users that solve the same number of problems are ranked by the least total time.
  • The time is measured to the precision of 1 second, and the the seconds are taken into account when ranking teams.

Who made this website?

Two people, Larry Wang ChaoJun and Wong Ho Wang did. By the time of writting, they are undergraduate students from the department of Computer Science and Engineering, the Chinese University of Hong Kong.

How did you build this website?

We built this website with the help of several open source softwares.

As well as integration with other websites
However, all these things cannot be put together and this website would not exists without the help of our project supervisor:
   Prof. LAU Lap Chi
and also our project marker Dr. TANG Wai Chung Matthew.
Thank you so much for making this project a great success!

Who maintain this website?

Online Programming Server was a school project named "Online High School Programming Server".
This fork is maintained by Wong Ho Wang, which is one of the original author.