ACM

1. Do not use the ENTER button on the keyboard.

2. The sended program should return value 0.

3. Input data is written down in a file "name.in". It is necessary to write down the result into file "name.out"

4. The sended program can have following statuses:

Pendingwaits for the turn of testing
Compilingthere is in a stage a compilation
Running...testing
Compilation Errorcompilation error
Crashunsuccessful end of the program
Memory Limitexcessive use of operative memory
Output Errorabsence of a target file or presence in it given mismatching task conditions
Time Limittime limit is settled
Wrong Answerthe wrong answer is given
Acceptedit is accepted

5. System C code tests using the compiler gcc 4.1.2. An example of solving the problem number 1000.

#include <stdio.h>
FILE *I, *O;
int main()
{
int a,b,c;
I = fopen("ab.in", "r");
O = fopen("ab.out", "w");
fscanf(I,"%d %d", &a, &b);
c = a + b;
fprintf(O, "%d", c);
fclose(I);
fclose(O);
return 0;
}

6. System C++ code tests using the compiler gcc-c++ 4.1.2. An example of solving the problem number 1000.

#include <fstream>
using namespace std;
int main()
{
ifstream fin ("ab.in");
ofstream fout ("ab.out");
int a,b;
fin>>a;
fin>>b;
fout<<a+b;
return 0;
}

7. Compilers C and C ++ do not accept type "__ int64". Instead it is necessary to write "long long".

8. System Pascal code tests using the compiler fpc 4.1.2. An example of solving the problem number 1000.

var a,b:longint;
Begin
assign(input,'ab.in');
reset(input);
assign(output,'ab.out');
rewrite(output);
read(a,b);
writeln(a+b);
close(output);
End.

9. System Perl code tests using the compiler perl 5.8.8. An example of solving the problem number 1000.

#!/usr/bin/perl
open(f,"ab.in");
($a,$b) = split(" ",<f>);
close(f);
open(f,">ab.out");
print f eval($a+$b);
close(f);

2010-2013 © ACM