Page 1 of 1

Java Support in the Judge

Posted: Tue Apr 30, 2002 12:52 pm
by judge
If you haven't done it yet, please review this web pages related to Java in the judge:

http://acm.uva.es/problemset/java.html
http://acm.uva.es/problemset/howtows.html#java
http://acm.uva.es/problemset/data/p100.java.html

Best regards,

Fernando N

the example code doesn't even work ...

Posted: Sat May 18, 2002 10:42 pm
by vincehung
the example code doesn't even work ...
it still gets compile error ....
i tried tons of times .....
:cry: [/java]

Solution...

Posted: Wed Nov 06, 2002 9:16 am
by EZE
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.

ciao
EZE

Posted: Thu Jan 27, 2005 8:29 am
by mythicwolf
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

Posted: Thu May 05, 2005 9:53 am
by chy168
Hi, I can not download the sample code.

Thank you~ ^^

You don't have permission to access /p/data/p100.java.html o

Posted: Sun Jun 19, 2005 5:52 am
by uviedor
Hello,

I have intend view the code from: http://acm.uva.es/p/data/p100.java.html and not it is disponible. Please help me. I need this code.

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

Re: Java Support in the Judge

Posted: Sun Mar 27, 2011 2:57 am
by Stefan_Bialucha
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(System.in);
        while (scanner.hasNextInt()) {
            int input = scanner.nextInt();
            int solution = solveCase(input);
            System.out.println(solution);
        }
        scanner.close();
    }
    public int solveCase(int number)
    {
        int solution = number + number;
        return solution;
    }
}

Re: Java Support in the Judge

Posted: Wed Dec 28, 2011 1:30 pm
by Janijan
hi,

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(System.in);
long num=0,num2=0;

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

num=in.nextLong();
num2=in.nextLong();
printLine(num,num2);

if(in.hasNext("0"))break;
}
in.close();
}

void printLine(long num,long num2){
long res=0;
if(num>num2)
res=num-num2;
else
res=num2-num;

System.out.println(res);
}
}

Thanks for your attention.