結果

問題 No.201 yukicoderじゃんけん
ユーザー t8m8⛄️t8m8⛄️
提出日時 2015-05-03 23:25:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 160 ms / 5,000 ms
コード長 1,147 bytes
コンパイル時間 3,666 ms
コンパイル使用メモリ 75,868 KB
実行使用メモリ 56,596 KB
最終ジャッジ日時 2023-09-19 03:53:18
合計ジャッジ時間 7,500 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,560 KB
testcase_01 AC 123 ms
56,036 KB
testcase_02 AC 123 ms
55,428 KB
testcase_03 AC 126 ms
55,836 KB
testcase_04 AC 125 ms
55,840 KB
testcase_05 AC 128 ms
56,156 KB
testcase_06 AC 127 ms
55,496 KB
testcase_07 AC 123 ms
55,692 KB
testcase_08 AC 128 ms
55,692 KB
testcase_09 AC 130 ms
55,624 KB
testcase_10 AC 128 ms
56,028 KB
testcase_11 AC 129 ms
55,412 KB
testcase_12 AC 128 ms
55,600 KB
testcase_13 AC 129 ms
55,560 KB
testcase_14 AC 127 ms
55,996 KB
testcase_15 AC 157 ms
55,868 KB
testcase_16 AC 156 ms
56,596 KB
testcase_17 AC 156 ms
56,584 KB
testcase_18 AC 159 ms
56,328 KB
testcase_19 AC 160 ms
56,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import static java.util.Arrays.*;
import static java.lang.Math.*;

public class No0201 {
    
    static final Scanner in = new Scanner(System.in);
    static final PrintWriter out = new PrintWriter(System.out,false);

    static void solve() {
        String a = in.next();
        String x = in.next();
        in.next();
        String b = in.next();
        String y = in.next();
        in.next();

        if (x.length() != y.length()) {
            out.println(x.length() > y.length() ? a : b);
            return;
        }

        for (int i=0; i<x.length(); i++) {
            if (x.charAt(i) != y.charAt(i)) {
                out.println(x.charAt(i) > y.charAt(i) ? a : b);
                return;
            }
        }

        out.println("-1");
    }

    public static void main(String[] args) {
        long start = System.currentTimeMillis();

        solve();
        out.flush();

        long end = System.currentTimeMillis();
        //trace(end-start + "ms");
        in.close();
        out.close();
    }

    static void trace(Object... o) { System.out.println(deepToString(o));}
}
0