結果

問題 No.264 じゃんけん
ユーザー mobius_bkstmobius_bkst
提出日時 2015-08-07 22:30:04
言語 Java19
(openjdk 21)
結果
AC  
実行時間 43 ms / 5,000 ms
コード長 1,641 bytes
コンパイル時間 3,461 ms
コンパイル使用メモリ 74,548 KB
実行使用メモリ 49,468 KB
最終ジャッジ日時 2023-09-25 06:05:13
合計ジャッジ時間 4,617 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
47,288 KB
testcase_01 AC 42 ms
49,208 KB
testcase_02 AC 42 ms
49,180 KB
testcase_03 AC 42 ms
49,224 KB
testcase_04 AC 43 ms
49,304 KB
testcase_05 AC 43 ms
49,104 KB
testcase_06 AC 43 ms
49,308 KB
testcase_07 AC 43 ms
49,336 KB
testcase_08 AC 43 ms
49,468 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class No264 {
    public static void main(String[] args) {
        try {
            BufferedReader br = new BufferedReader(new InputStreamReader(
                    System.in));

            int[] a = strToIntArray(br.readLine());

            int N = a[0];
            int K = a[1];
            String ans = "";
            if (N == K) {
                ans = "Drew";
            } else {
                if (N == 0) {
                    // グー
                    if (K == 1) {
                        ans = "Won";
                    } else {
                        ans = "Lost";
                    }
                } else if (N == 1) {
                    // チョキ
                    if (K == 2) {
                        ans = "Won";
                    } else {
                        ans = "Lost";
                    }
                } else if (N == 2) {
                    // パー
                    if (K == 0) {
                        ans = "Won";
                    } else {
                        ans = "Lost";
                    }
                }

            }

            System.out.println(ans);
        } catch (Exception e) {
            e.printStackTrace();
            System.err.println("Error:" + e.getMessage());
        }
    }

    static int[] strToIntArray(String S) {
        String[] strArray = S.split(" ");
        int[] intArray = new int[strArray.length];
        for (int i = 0; i < strArray.length; i++) {
            intArray[i] = Integer.parseInt(strArray[i]);
        }
        return intArray;
    }
}
0