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 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 <iostream>

using namespace std;

int main()

{

    int a,b;

    cin >> a >> b;

    cout << a+b << endl;

    return 0;

}

GCC:

#include <stdio.h>

int main()

{

    int a,b;

    scanf("%d %d",&a, &b);

    printf("%d\n",a+b);

    return 0;

}

Java has two compilers(virtual machine),one is traditional Sun Java,the other is GNU Java Compiler(GCJ). The difference of the two lies that Sun Java runs the program in the virtual machine , while GCJ convert file of .class to the executable code(file .exe at Windows),just as C/C++,runs without virtual machine. Considering the differece mentioned above,after the GCJ compiles the program , it will run faster than Sun Java.( It is obeserved that there is about 30% difference in speed ); Besides,at the present time ,GCJ can only support Java 1.4,when it is Java 1.5 ,only Sun Java can be used. Java solution to problem NO.1001 is as follows:

import java.io.*;

import java.util.*;

public class Main

{

    public static void main (String args[]) throws Exception {

        BufferedReader stdin = new BufferedReader( new InputStreamReader(System.in));

        String line = stdin.readLine();

        StringTokenizer st = new StringTokenizer(line);

        int a = Integer.parseInt(st.nextToken());

        int b = Integer.parseInt(st.nextToken());

        System.out.println(a+b);

    }

}

Java 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);

    }

}

3. Pascal solution to problem NO.1001 is shown as follows.

program p1000(Input,Output);

var

    a,b:Integer;

begin

    Readln(a,b);

    Writeln(a+b);

end.


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 <stdio.h>

int main()

{

    int n,i,a,b;

    scanf("%d",&n); /*The number of test cases*/

    for(i=0;i<n;i++)

    {

        scanf("%d %d",&a,&b);

        if(a>b)

            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 <stdio.h>

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 <stdio.h>

int main()

{

    int n,i,a,b;

    scanf("%d",&n); /*The number of test cases*/

    for(i=0;i<n;i++)

    {

        scanf("%d %d",&a,&b);

        printf("%d\n",a+b);

    }

}

=========================

Problem ID:1078

Solution:

#include <stdio.h>

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 <stdio.h>

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 <stdio.h>

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 <stdio.h>

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 GNU C/C++ Pascal
    Type name __int64 int64
    Input scanf("%I64d", &x); read(x);
    Output printf("%I64d", x); write(x);

     
  • Unsigned 64-bit integer. Value range: 0 .. 18446744073709551615.

     
    Language GNU C/C++ Pascal
    Type name unsigned __int64 qword
    Input scanf("%I64u", &x); read(x);
    Output printf("%I64u", x); write(x);
|返回 |
 
Copyright @ 2008-2024 (浙ICP备2022001332号), TZOJ. All Rights Reserved.
2017-2024 台州市非普软件技术有限公司,浙江省台州市君悦大厦B幢1603室