How To
Supported languages and libraries

The system currently supports C++ and C. The source files are compiled using the GNU G++ compiler version 4.9.2, with pthreads, OpenMP v4.0 and OpenCL v1.1 support. The -O2 optimization flag is used.

Upload Solution

The uploaded solution must be either a compressed folder (.zip) containing all the source and header files needed, or a single C/C++ source file. Also make sure that the zip does not contain any unnecessary or hidden folders or files. OSX users may zip the directory containing the source files following the guide found here. This will make sure the unnecessary file .DS-Store is not included in the zip.

Solutions will be timed out after about 90 seconds, so make sure that your program reads from input and writes to output correctly (see below). Also, make sure that you do get the expected output locally before submitting a solution to a problem.

Warning!

Uploaded solutions are stored on our server. Please do not include sensitive information.

Read Input

Submitted code should read input from STDIN. A common way to do this in C++ is using std::cin, which reads a single word from STDIN. It is not possible to read from files.

Example:

#include <iostream>
using namespace std;
int main(void){
    cin.sync_with_stdio(false);
    string code;
    while(cin >> code) {
	//do stuff
    }
}

cin.sync_with_stdio(false) makes reading from stdin much faster.

Write Output

Output should be written to STDOUT. A common way of doing this in C++ is using std::cout. Writing to files is not possible.

Example:

#include <iostream>
using namespace std;
int main(void){
    cout<<"Hello World!"<<endl;
}

Programs can also use std::cerr to write to stderr.

Error codes

The system returns an error code if your solution to a problem contains a runtime error. A complete list of all runtime error codes may be found below:

Signal

Description

SIGABRT

Process abort signal.

SIGALRM

Alarm clock.

SIGBUS

Access to an undefined portion of a memory object.

SIGCHLD

Child process terminated, stopped, or continued.

SIGCONT

Continue executing, if stopped.

SIGFPE

Erroneous arithmetic operation.

SIGHUP

Hangup.

SIGILL

Illegal instruction.

SIGINT

Terminal interrupt signal.

SIGKILL

Kill (cannot be caught or ignored).

SIGPIPE

Write on a pipe with no one to read it.

SIGQUIT

Terminal quit signal.

SIGSEGV

Invalid memory reference.

SIGSTOP

Stop executing (cannot be caught or ignored).

SIGTERM

Termination signal.

SIGTSTP

Terminal stop signal.

SIGTTIN

Background process attempting read.

SIGTTOU

Background process attempting write.

SIGUSR1

User-defined signal 1.

SIGUSR2

User-defined signal 2.

SIGPOLL

Pollable event.

SIGPROF

Profiling timer expired.

SIGSYS

Bad system call.

SIGTRAP

Trace/breakpoint trap.

SIGURG

High bandwidth data is available at a socket.

SIGVTALRM

Virtual timer expired.

SIGXCPU

CPU time limit exceeded.

SIGXFSZ

File size limit exceeded.

Contact

If you have any questions or are having problems using this system, please do not hesitate to contact us at ntnu.cmb@gmail.com.