結果

問題 No.201 yukicoderじゃんけん
ユーザー shinwisteriashinwisteria
提出日時 2018-03-15 20:15:00
言語 Java21
(openjdk 21)
結果
AC  
実行時間 171 ms / 5,000 ms
コード長 755 bytes
コンパイル時間 3,180 ms
コンパイル使用メモリ 74,412 KB
実行使用メモリ 57,028 KB
最終ジャッジ日時 2023-08-23 07:40:37
合計ジャッジ時間 7,172 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
55,824 KB
testcase_01 AC 118 ms
56,048 KB
testcase_02 AC 117 ms
55,732 KB
testcase_03 AC 123 ms
55,588 KB
testcase_04 AC 120 ms
55,620 KB
testcase_05 AC 121 ms
55,844 KB
testcase_06 AC 120 ms
55,692 KB
testcase_07 AC 118 ms
55,708 KB
testcase_08 AC 125 ms
55,904 KB
testcase_09 AC 126 ms
54,124 KB
testcase_10 AC 124 ms
55,452 KB
testcase_11 AC 125 ms
55,544 KB
testcase_12 AC 126 ms
55,860 KB
testcase_13 AC 126 ms
55,616 KB
testcase_14 AC 121 ms
55,400 KB
testcase_15 AC 158 ms
55,928 KB
testcase_16 AC 156 ms
56,244 KB
testcase_17 AC 161 ms
56,312 KB
testcase_18 AC 171 ms
57,028 KB
testcase_19 AC 157 ms
56,560 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package m.shin;
import java.util.Scanner;
public class Con201 {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		String sa = s.next() , pa = s.next() , xa = s.next();
		String sb = s.next() , pb = s.next() , xb = s.next();
		s.close();

		if(pa.length() > pb.length()){
			System.out.println(sa);
		}else if(pa.length() < pb.length()){
			System.out.println(sb);
		}else{
			for(int i = 0;i < pa.length();i++){
				int a = Integer.parseInt(pa.substring(i , i+1));
				int b = Integer.parseInt(pb.substring(i , i+1));
				if(a > b){
					System.out.println(sa);
					break;
				}else if(a < b){
					System.out.println(sb);
					break;
				}
				if(i == pa.length() -1){
					System.out.println(-1);
				}
			}
		}

	}

}
0