#The file must have one and only one ''public'' class, called "Main". (Other classes are allowed, just not public ones).

#The program must take in the input from Standard Input (this can be done by hooking up a scanner to System.in).

#The program must take in the input from Standard Input (this can be done by hooking up a scanner to System.in).

-

#The program must write all output to Standard Output (this is done with regular old System.out.print).

+

#The program must write all output to Standard Output (this is done with regular old System.out.println).

Note that the Progteam's [[Skeleton File]] already observes all these conventions. You should always start with it as a template.

Note that the Progteam's [[Skeleton File]] already observes all these conventions. You should always start with it as a template.

Line 18:

Line 18:

==A+B Problem==

==A+B Problem==

-

[[1000|Problem 1000 (A+B)]] is a simple check to see if everything's working right. The input consists of two integers, the output should consist of their sum. We simply need to take the template, pull the first two integers from the input, and print them to the output:

+

Problem 1000 (A+B) is a simple check to see if everything's working right. The input consists of two integers, the output should consist of their sum. We simply need to take the template, pull the first two integers from the input, and print them to the output:

<pre>

<pre>

Line 33:

Line 33:

}

}

-

public static void doStuff(){

+

public static void doStuff(){

-

System.out.println(in.nextInt()+in.nextInt());

+

int a=in.nextInt();

+

int b=in.nextInt();

+

+

System.out.println(a+b);

}

}

}

}

Latest revision as of 03:34, 28 September 2007

Submitting a problem's solution at PKU is a very important part of the programming team. Nine times out of ten, a tough problem you thought you solved actually fails in some edge case. PKU will get you proof that your answer is correct or incorrect.

Contents

Getting Started

First, you need to have a PKU JudgeOnline login. Go to the JudgeOnline Homepage to get a login. You can also search for problems here by name or number. Note that in the template for each problem in the wiki, there is a direct link to that problems's entry on PKU.

Guidelines

All solutions submitted must follow certain guidelines:

The solution must be contained in one file.

The file must have one and only one public class, called "Main". (Other classes are allowed, just not public ones).

The program must take in the input from Standard Input (this can be done by hooking up a scanner to System.in).

The program must write all output to Standard Output (this is done with regular old System.out.println).

Note that the Progteam's Skeleton File already observes all these conventions. You should always start with it as a template.

Submitting

Go to the PKU page for the problem, scroll to the bottom and hit 'Submit'. Then copy-paste your solution into the text field. Hit submit, and cross your fingers.

A+B Problem

Problem 1000 (A+B) is a simple check to see if everything's working right. The input consists of two integers, the output should consist of their sum. We simply need to take the template, pull the first two integers from the input, and print them to the output:

Note that in the original file, doStuff contains a loop that calls solve() a number of times equal to the first integer it reads in. This is because the majority of problems on PKU give multiple iterations of the same problem, with the first integer on the input being the number of iterations. This is not the case for this file, so solve() and the loop have been removed.