結果

問題 No.201 yukicoderじゃんけん
ユーザー k_kadora
提出日時 2015-06-10 22:46:33
言語 Java
(openjdk 23)
結果
AC  
実行時間 134 ms / 5,000 ms
コード長 943 bytes
コンパイル時間 2,857 ms
コンパイル使用メモリ 77,888 KB
実行使用メモリ 41,316 KB
最終ジャッジ日時 2024-07-06 15:26:51
合計ジャッジ時間 5,718 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

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