結果

問題 No.201 yukicoderじゃんけん
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-11-13 08:46:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 175 ms / 5,000 ms
コード長 1,019 bytes
コンパイル時間 2,011 ms
コンパイル使用メモリ 73,340 KB
実行使用メモリ 56,136 KB
最終ジャッジ日時 2023-08-17 04:18:06
合計ジャッジ時間 6,034 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
56,120 KB
testcase_01 AC 120 ms
55,716 KB
testcase_02 AC 120 ms
55,892 KB
testcase_03 AC 122 ms
56,104 KB
testcase_04 AC 124 ms
55,428 KB
testcase_05 AC 123 ms
55,724 KB
testcase_06 AC 119 ms
56,100 KB
testcase_07 AC 118 ms
55,740 KB
testcase_08 AC 120 ms
55,476 KB
testcase_09 AC 121 ms
55,464 KB
testcase_10 AC 125 ms
55,780 KB
testcase_11 AC 122 ms
55,856 KB
testcase_12 AC 123 ms
55,740 KB
testcase_13 AC 122 ms
55,884 KB
testcase_14 AC 121 ms
55,660 KB
testcase_15 AC 156 ms
56,136 KB
testcase_16 AC 154 ms
55,776 KB
testcase_17 AC 158 ms
56,096 KB
testcase_18 AC 175 ms
55,488 KB
testcase_19 AC 159 ms
55,876 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String SPXA = sc.nextLine();
        String [] arrA = SPXA.split(" ");
        String SPXB = sc.nextLine();
        String [] arrB = SPXB.split(" ");
        
        int flag =0;
        if( arrA[1].length() > arrB[1].length() ){
            flag=1;
        }else if( arrA[1].length() < arrB[1].length() ){
            flag=2;
        }else{
            for(int i=0; i<arrA[1].length(); i++){
                if( arrA[1].charAt(i) > arrB[1].charAt(i) ){
                    flag=1;
                    break;
                }else if(arrA[1].charAt(i) < arrB[1].charAt(i) ){
                    flag=2;
                    break;
                }
            }
        }
        
        if(flag==1){
            System.out.println(arrA[0]);
        }else if(flag==2){
            System.out.println(arrB[0]);
        }else{
            System.out.println(-1);
        }
    }
}
0