結果

問題 No.201 yukicoderじゃんけん
ユーザー dazy
提出日時 2017-02-23 16:06:24
言語 Java
(openjdk 23)
結果
AC  
実行時間 179 ms / 5,000 ms
コード長 978 bytes
コンパイル時間 5,318 ms
コンパイル使用メモリ 77,372 KB
実行使用メモリ 56,080 KB
最終ジャッジ日時 2025-01-02 18:35:05
合計ジャッジ時間 8,775 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Run {
    public static void main (String arg[]) {
        Scanner scan = new Scanner(System.in);
        String ans = "-1";

        String A = scan.next();
        String a = scan.next();
        String trash = scan.next();

        String B = scan.next();
        String b = scan.next();
        trash = scan.next();

        if (a.length() > b.length()) ans = A;
        else if (b.length() > a.length()) ans = B;
        else if (a.equals(b)) {
        } else {
            int X, Y;
            for (int i = 0; i < a.length(); i++) {
                X = Integer.parseInt(a.substring(i, i+1));
                Y = Integer.parseInt(b.substring(i, i+1));
                if (X > Y) {
                    ans = A;
                    break;
                } else if (Y > X) {
                    ans = B;
                    break;
                } else {
                }
            }
        }

        System.out.println(ans);
    }
}
0