結果

問題 No.201 yukicoderじゃんけん
ユーザー fkwnw3_1243fkwnw3_1243
提出日時 2017-04-30 12:27:56
言語 Java21
(openjdk 21)
結果
AC  
実行時間 98 ms / 5,000 ms
コード長 983 bytes
コンパイル時間 1,885 ms
コンパイル使用メモリ 70,992 KB
実行使用メモリ 52,564 KB
最終ジャッジ日時 2023-10-11 23:34:27
合計ジャッジ時間 4,279 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
49,340 KB
testcase_01 AC 44 ms
49,352 KB
testcase_02 AC 43 ms
49,192 KB
testcase_03 AC 48 ms
49,356 KB
testcase_04 AC 47 ms
49,324 KB
testcase_05 AC 46 ms
49,340 KB
testcase_06 AC 46 ms
49,236 KB
testcase_07 AC 44 ms
49,560 KB
testcase_08 AC 48 ms
49,236 KB
testcase_09 AC 48 ms
49,184 KB
testcase_10 AC 46 ms
49,128 KB
testcase_11 AC 48 ms
49,204 KB
testcase_12 AC 48 ms
49,336 KB
testcase_13 AC 49 ms
49,188 KB
testcase_14 AC 46 ms
49,360 KB
testcase_15 AC 98 ms
52,356 KB
testcase_16 AC 94 ms
52,040 KB
testcase_17 AC 91 ms
52,112 KB
testcase_18 AC 81 ms
52,564 KB
testcase_19 AC 90 ms
52,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;

import static java.lang.System.in;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        String[] inputs = reader.readLine().split(" ");
        String SA = inputs[0];
        BigInteger PA = new BigInteger(inputs[1]);
        inputs = reader.readLine().split(" ");
        String SB = inputs[0];
        BigInteger PB = new BigInteger(inputs[1]);
        showResult(SA,SB,PA,PB);
    }

    private static void showResult(String playerA, String playerB, BigInteger pointA, BigInteger pointB) {
        if(pointA.compareTo(pointB) == 1) {
            System.out.println(playerA);
        } else if (pointA.compareTo(pointB)==0){
            System.out.println("-1");
        } else {
            System.out.println(playerB);
        }
    }
}
0