結果

問題 No.201 yukicoderじゃんけん
ユーザー Grenache
提出日時 2015-11-03 12:48:18
言語 Java
(openjdk 23)
結果
AC  
実行時間 164 ms / 5,000 ms
コード長 854 bytes
コンパイル時間 3,483 ms
コンパイル使用メモリ 77,628 KB
実行使用メモリ 54,252 KB
最終ジャッジ日時 2024-09-13 12:05:29
合計ジャッジ時間 7,002 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

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