結果

問題 No.201 yukicoderじゃんけん
ユーザー GrenacheGrenache
提出日時 2015-11-03 12:48:18
言語 Java21
(openjdk 21)
結果
AC  
実行時間 158 ms / 5,000 ms
コード長 854 bytes
コンパイル時間 3,916 ms
コンパイル使用メモリ 74,796 KB
実行使用メモリ 56,604 KB
最終ジャッジ日時 2023-10-11 13:20:24
合計ジャッジ時間 7,135 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,712 KB
testcase_01 AC 119 ms
55,808 KB
testcase_02 AC 118 ms
55,708 KB
testcase_03 AC 123 ms
56,232 KB
testcase_04 AC 123 ms
55,772 KB
testcase_05 AC 123 ms
55,764 KB
testcase_06 AC 122 ms
55,816 KB
testcase_07 AC 120 ms
56,176 KB
testcase_08 AC 125 ms
55,852 KB
testcase_09 AC 123 ms
55,944 KB
testcase_10 AC 124 ms
55,724 KB
testcase_11 AC 124 ms
55,940 KB
testcase_12 AC 123 ms
56,080 KB
testcase_13 AC 123 ms
56,056 KB
testcase_14 AC 125 ms
55,836 KB
testcase_15 AC 156 ms
56,440 KB
testcase_16 AC 157 ms
56,524 KB
testcase_17 AC 158 ms
56,244 KB
testcase_18 AC 154 ms
54,668 KB
testcase_19 AC 155 ms
56,604 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main_yukicoder201 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String[] s = new String[2];
        String[] p = new String[2];
        String[] x = new String[2];
        for (int i = 0; i < 2; i++) {
        	s[i] = sc.next();
        	p[i] = sc.next();
        	x[i] = sc.next();
        }

        int res = p[0].compareTo(p[1]);
        if (p[0].length() > p[1].length()) {
        	System.out.println(s[0]);
        } else if (p[0].length() < p[1].length()) {
        	System.out.println(s[1]);
        } else {
        	if (res > 0) {
        		System.out.println(s[0]);
        	} else if (res < 0) {
        		System.out.println(s[1]);
        	} else {
        		System.out.println("-1");
        	}
        }
        
        sc.close();
    }
}
0