Frequently Asked Questions
中文版
Q:Why I get the message"Must be granted this privilege first" when I upload my problem to this system?
A:If you want to upload problems ,you must solve more than 300 problems and total difficulty larger than 300000 on the system.
Q:What are the meanings of the judge's replies?
A:Here is a list of the Judge's replies and their meaning:
Waiting: The system is preparing for judging your program. You just need to wait a while and refresh your WEB browser.
Judging: Your program is judging on the server and a few second later you can get your result.
Accepted: Your program is correct, congratulations!
Presentation Error: Your program's output format is not exactly the same as required by the problem, although the output is correct. This usually means the existence of omitted or extra blank characters (white spaces, tab characters and/or new line characters) between any two non-blank characters, and/or blank lines (a line consisting of only blank characters) between any two non-blank lines. Trailing blank characters at the end of each line and trailing blank lines at the of output are not considered format errors. Check the output for spaces, blank lines, etc. against the problem's output specification.
Wrong Answer: Correct solution not reached for the inputs. The inputs and outputs that we use to test the programs are not public (it is recomendable to get accustomed to a true contest dynamic
Runtime Error: Your program failed during the execution and you will receive the hints for the reasons. Here are part of the hints and their meanings:
Runtime Error(ARRAY_BOUNDS_EXCEEDED) // Array bounds exceed
Runtime Error(DIVIDE_BY_ZERO) //Divisor is nil
Runtime Error(ACCESS_VIOLATION) //Illegal memory access
Runtime Error(STACK_OVERFLOW) //Stack overflow
Time Limit Exceeded: Your program tried to run during too much time.
Memory Limit Exceeded: Your program tried to use more memory than the judge default settings.
Output Limit Exceeded:Your program put out too much information to the console ,please check if exists an endless loop.
Compile Error: The compiler fails to compile your program. Warning messages are not considered errors. Click on the judge's reply to see the warning and error messages produced by the compiler.
System Error: Usually , it is because the unexpected accident of the system design. If it shows “System Error”,please contact the administrator.
Judge Delay:If he judging time is overlong, stop judgement forcefully.
Judge Error:This error is neally impossible ,it refers that “Judging”program itself is something wrong ,however ,it says precautions averts perils.
Q:What is the compiler using in this system? Are there any attentions I should specially pay for?
A:There are five compilers within our system, support four programming languages : C,C++,Java and Pascal. As for the compiler,there are several attentions to pay:
1. GCC,G++ are the compilers provided by the GNU orgnization especially for C and C++. There are not many differences between GCC,G++ and VC.For typical instance, function main must return a data of integer type(int).
For example ,the solution to problem NO.1001 is shown as follows:
G++:
#include
using namespace std;
int main()
{
int a,b;
cin >> a >> b;
cout << a+b << endl;
return 0;
}
GCC, C89 standard, don't use for(int i=0;i<n;i++):
#include
int main()
{
int a,b;
scanf("%d %d",&a, &b);
printf("%d\n",a+b);
return 0;
}
Java(JDK 1.5):
import java.io.*;
import java.util.*;
public class Main
{
public static void main(String args[]) throws Exception
{
Scanner cin=new Scanner(System.in);
int a=cin.nextInt(),b=cin.nextInt();
System.out.println(a+b);
}
}
Pascal:
var
a,b:Integer;
begin
Readln(a,b);
Writeln(a+b);
end.
C#:
using System;
public class TOJ1001
{
private static void Main()
{
int a = int.Parse(Console.ReadLine());
int b = int.Parse(Console.ReadLine());
Console.WriteLine(a+b);
}
}
Python2:
a=raw_input()
b=raw_input()
print int(a)+int(b)
Python3:
a=input()
b=input()
print(int(a)+int(b))
C++17(for new C++ characters):
#include
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int a,b;
cin>>a>>b;
auto x1{a}, x2{b};
cout<
Note when using universal header files, if the input/output data volume is large, it is recommended to turn off sync stream and use C++ I/O;
If using universal header files like stdc++.h or cstdio header while also using C I/O may lead to slower speeds, it's recommended to use stdio.h instead.
Q:How to deal with the “multiple test data” required by some problems?
A:Some solutions are given as follows:
Problem ID:1002
solution:
#include
int main()
{
int n,i,a,b;
scanf("%d",&n); /*先输入测试组数*/
for(i=0;ib)
printf("%d\n",a);
else
printf("%d\n",b);
}
}
Problem ID:1076
Description:
1、Although there are two lines "1 2" and "3 4" in the sample
input, the judge data may far more than these;
2、The results "3"and "7" are the output of the "1 2" and "3
4" which is outputted immediately after each input is completed.
You can suppose that the input lines "1 2" and "3 4" are not related.
Solution:
#include
int main() /*return an int type, not "void main()"*/
{
int a,b;
while(scanf("%d %d",&a,&b)!=EOF) /* The input is completed? */
{
printf("%d\n",a+b); /*Output immediately as soon as one input is read and the result is completed */
}
}
=========================
Problem ID:1077
Solution:
#include
int main()
{
int n,i,a,b;
scanf("%d",&n); /*The number of test cases*/
for(i=0;i
=========================
Problem ID:1078
Solution:
#include
int main()
{
int a,b;
while(1)
{
scanf("%d %d",&a,&b);
if(a==0 && b==0)break; /*The input is completed*/
printf("%d\n",a+b);
}
}
or:
#include
int main()
{
int a,b;
while(scanf("%d %d",&a,&b), a!=0 || b!=0)
{
printf("%d\n",a+b);
}
}
=========================
Problem ID:1079
Solution:
#include
int main()
{
int a,b,k=0;
while(1)
{
scanf("%d %d",&a,&b);
if(a==0 && b==0)break; /*The input is completed*/
if(k)printf("\n"); /*A blank line is output after each input data but the last one*/
printf("%d\n",a+b);
k=1;
}
}
or:
#include
int main()
{
int a,b,k=0;
while(scanf("%d %d",&a,&b), a!=0 || b!=0)
{
if(k)printf("\n"); /*A blank line is output after each input data but the last one*/
printf("%d\n",a+b);
k=1;
}
}
Q:What's the meaning of “Special Judge” marked beside the problem?
A:When a problem has multiple acceptable solutions, a special judge program is needed. The special judge program reads and judges user’s solution. There is no need to kown more details about Special Judge,just one thing,that is predigest the judge. Usually,Special Judge program do not judge Presentation Error, please make sure that the correctness of your output style.
Q:How can I participate in online contests ?
A:There are two kinds of online contests at TZOJ. One is public and the other is private. Everyone who has an account of TZOJ can participate in a public contest, while the private contest must be registered and passed by the administrator.
Q:How to use 64-bit integer types?
A:Server supports signed and unsigned 64-bit integers.
- Signed 64-bit integer. Value range: -9223372036854775808 .. 9223372036854775807.
Language |
GCC |
C++ |
Pascal |
Type |
__int64, long long |
__int64, long long |
int64 |
Input |
scanf("%I64d", &x); scanf("%lld", &x); |
cin>>x; |
read(x); |
Output |
printf("%I64d", x);printf("%lld", x); |
cout<<x; |
write(x); |
- Unsigned 64-bit integer. Value range: 0 .. 18446744073709551615.
Language |
GCC |
C++ |
Pascal |
Type |
unsigned __int64, unsigned long long |
unsigned __int64, unsigned long long |
qword |
Input |
scanf("%I64u", &x); scanf("%llu", &x); |
cin>>x; |
read(x); |
Output |
printf("%I64u", x);printf("%llu", x); |
cout<<x; |
write(x); |
|