[Logo] Форум DL
  [DL]  На главную страницу 
Индекс форума ->Общего плана ->Проблемы и их решения
Автор Сообщение
Atanas Atanasov

Темы: 1
Сообщений: 3

Мой профиль
Hi,
With what name must be my java class ?
Because my submissions are only in 'Compilation Error' state.

Thanks in advance!
Михаил Долинский

Темы: 1984
Сообщений: 47232

Мой профиль
I think you chose wrong compiler

For example below
when I chose Delphi (for you code from the testing log) - I have got "compilation error"
in all other cases I have got error at execution

9.11 09:07 1. Your Ride Is Here 0 / 200 ошибка компиляции atanas.java DelTA3 at NIT7 Delphi 7
9.11 09:03 1. Your Ride Is Here 0 / 200 не пройден 1-й тест. Решение вызвало ошибку Runtime Error 1:Invalid function number atanas.java DelTA3 at NIT7 Java 6
9.11 09:02 1. Your Ride Is Here 0 / 200 не пройден 1-й тест. Решение вызвало ошибку Runtime Error 1:Invalid function number atanas.java DelTA3 at NIT7 Java 8
9.11 09:01 1. Your Ride Is Here 0 / 200 не пройден 1-й тест. Решение вызвало ошибку Runtime Error 1:Invalid function number atanas.java DelTA3 at NIT7 Java 7


import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;

class Test {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(new File("input.txt"));
        PrintWriter pw = new PrintWriter(new File("output.txt"));
        if (toNumber(sc.nextLine()) % 47 == toNumber(sc.nextLine()) % 47) {
            pw.println("GO");
        } else {
            pw.println("STAY");
        }
        pw.close();
    }

    public static int toNumber(String name) {
        int product = 1;
        for (int i = 0; i < name.length(); i++) {
            int charVal = (name.charAt(i) - 'A') + 1;
            product *= charVal;
        }
        return product;
    }
}

Please next time give MORE information
- link on task, copy of DL-log lines etc.
Atanas Atanasov

Темы: 1
Сообщений: 3

Мой профиль
Thank you for the information.

I copy this java source and submit task http://dl.gsu.by/task.jsp?nid=7977&cid=130 ( USACO 1998\Open\1 - "Your Ride Is Here" )

and i got 'wrong answer'.
Here is the log of my last submission.

9.11 10:22	  1. Your Ride Is Here  	0 / 200 	 	Test.java 	DelTA3 at NIT6	Java 8 

Submission url: http://dl.gsu.by/getmysol.asp?id=5041531

It fails on the first test case.
ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ


Is something that I miss for choosing the right compiler or any other configuration, because on my local machine everything works fine.
Atanas Atanasov

Темы: 1
Сообщений: 3

Мой профиль
I found my mistake.
Everything works as expected !

Thank you very much, greetings from Bulgaria !
 
Индекс форума ->Общего плана ->Проблемы и их решения
Time:0,04