結果

問題 No.201 yukicoderじゃんけん
ユーザー k_kadorak_kadora
提出日時 2015-06-10 22:46:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 160 ms / 5,000 ms
コード長 943 bytes
コンパイル時間 3,154 ms
コンパイル使用メモリ 74,524 KB
実行使用メモリ 56,944 KB
最終ジャッジ日時 2023-09-20 20:38:45
合計ジャッジ時間 6,889 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
53,708 KB
testcase_01 AC 117 ms
56,140 KB
testcase_02 AC 115 ms
56,432 KB
testcase_03 AC 119 ms
56,200 KB
testcase_04 AC 119 ms
56,304 KB
testcase_05 AC 120 ms
56,172 KB
testcase_06 AC 120 ms
55,816 KB
testcase_07 AC 117 ms
54,408 KB
testcase_08 AC 123 ms
56,292 KB
testcase_09 AC 123 ms
55,832 KB
testcase_10 AC 119 ms
55,868 KB
testcase_11 AC 122 ms
55,956 KB
testcase_12 AC 121 ms
55,716 KB
testcase_13 AC 123 ms
55,816 KB
testcase_14 AC 122 ms
56,068 KB
testcase_15 AC 158 ms
56,684 KB
testcase_16 AC 159 ms
56,944 KB
testcase_17 AC 160 ms
56,580 KB
testcase_18 AC 156 ms
56,868 KB
testcase_19 AC 154 ms
56,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class Yurufuwa{
	public static void main(String arg[]){
		String[] name = new String[2];
		String[] point = new String[2];
		String[] hand = new String[2];
		int win = 0;
		Scanner sc = new Scanner(System.in);
		for(int i = 0;i<2;i++){
			name[i] = sc.next();
			point[i] = sc.next();
			hand[i] = sc.next();
		}
		if(point[0].length() > point[1].length()){
			win = 1;
		}else if(point[0].length() < point[1].length()){
			win = 2;
		}else{
			for(int i = 0;i<point[0].length();i++){
				if(Character.getNumericValue(point[0].charAt(i)) > Character.getNumericValue(point[1].charAt(i))){
					win = 1;
					break;
				}else if(Character.getNumericValue(point[0].charAt(i)) < Character.getNumericValue(point[1].charAt(i))){
					win = 2;
					break;
				}
			}
		}
		if(win == 0){
			System.out.println(-1);
		}else if(win == 1){
			System.out.println(name[0]);
		}else{
			System.out.println(name[1]);
		}
	}
}
0