結果

問題 No.264 じゃんけん
ユーザー mobius_bkstmobius_bkst
提出日時 2015-08-07 22:26:29
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,641 bytes
コンパイル時間 4,868 ms
コンパイル使用メモリ 77,320 KB
実行使用メモリ 51,328 KB
最終ジャッジ日時 2023-09-25 06:04:30
合計ジャッジ時間 4,725 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
49,372 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 42 ms
49,364 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 41 ms
49,532 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[0];
            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