Java Support in the Judge

Write here if you have problems with your Java source code

Moderator: Board moderators

Post Reply
System administrator
Posts: 8
Joined: Sun Oct 07, 2001 2:00 am

Java Support in the Judge

Post by judge » Tue Apr 30, 2002 12:52 pm

If you haven't done it yet, please review this web pages related to Java in the judge:

Best regards,

Fernando N

New poster
Posts: 2
Joined: Tue Feb 05, 2002 2:00 am

the example code doesn't even work ...

Post by vincehung » Sat May 18, 2002 10:42 pm

the example code doesn't even work ...
it still gets compile error ....
i tried tons of times .....
:cry: [/java]

New poster
Posts: 4
Joined: Wed Nov 06, 2002 2:34 am


Post by EZE » Wed Nov 06, 2002 9:16 am

I couldnt get the java mail submission to work, but if you submit using the online form on the web site it works fine. The only problem is that the big number class and other such usefull java classes (they're the only reason I would use java :P) dont seem to be on the servers.


New poster
Posts: 2
Joined: Thu Jan 27, 2005 8:25 am

Post by mythicwolf » Thu Jan 27, 2005 8:29 am

i think the reason the sample code doesn't work is because the judge doesnt allow use of the java.util package and the code uses it

New poster
Posts: 1
Joined: Thu May 05, 2005 9:51 am

Post by chy168 » Thu May 05, 2005 9:53 am

Hi, I can not download the sample code.

Thank you~ ^^

New poster
Posts: 1
Joined: Thu Jun 16, 2005 7:08 am

You don't have permission to access /p/data/ o

Post by uviedor » Sun Jun 19, 2005 5:52 am


I have intend view the code from: and not it is disponible. Please help me. I need this code.

Excuse my english. I am speaking spanish. I am venzuelan.

New poster
Posts: 5
Joined: Mon Mar 31, 2008 12:49 am

Re: Java Support in the Judge

Post by Stefan_Bialucha » Sun Mar 27, 2011 2:57 am

Because there is some lack of up to date information about sending in solutions in Java:
You can use this code frame as a start:

Code: Select all

import java.util.Scanner;
class Main {
    public static void main(String[] args) {
        new Main().solveProblem();
    public void solveProblem() {
        final Scanner scanner = new Scanner(;
        while (scanner.hasNextInt()) {
            int input = scanner.nextInt();
            int solution = solveCase(input);
    public int solveCase(int number)
        int solution = number + number;
        return solution;

New poster
Posts: 1
Joined: Wed Dec 28, 2011 1:01 pm

Re: Java Support in the Judge

Post by Janijan » Wed Dec 28, 2011 1:30 pm


i'm trying to solve the problem 10055 - Hashmat the Brave Warrior, i have the next code, this code is running fine in my eclipse , but when i submit the code to the judge, they answer me:

"Your submission with number 9597827 for the problem 10055 - Hashmat the Brave Warrior has failed with verdict Runtime error.
This means that the execution of your program didn't finish properly. Remember to always terminate your code with the exit code 0."

is this problem recomended to make in java to submit to the judged? i'm a begginner, please help me with any information about how i can modify this code to submit in java?

The Code:

import java.util.Scanner;

class TheBraveWarrior {
public static void main(String[] args){

new TheBraveWarrior().solveProblem();


void solveProblem(){
Scanner in=new Scanner(;
long num=0,num2=0;

while(num <= Math.pow(2, 32) && num2 <= Math.pow(2, 32)){



void printLine(long num,long num2){
long res=0;


Thanks for your attention.

Post Reply

Return to “Java”