結果

問題 No.264 じゃんけん
ユーザー kaoetayakaoetaya
提出日時 2016-12-07 00:03:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 138 ms / 5,000 ms
コード長 1,541 bytes
コンパイル時間 3,939 ms
コンパイル使用メモリ 71,656 KB
実行使用メモリ 57,660 KB
最終ジャッジ日時 2023-08-18 19:42:38
合計ジャッジ時間 5,783 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
55,612 KB
testcase_01 AC 133 ms
55,672 KB
testcase_02 AC 135 ms
55,616 KB
testcase_03 AC 132 ms
55,888 KB
testcase_04 AC 131 ms
55,568 KB
testcase_05 AC 134 ms
55,572 KB
testcase_06 AC 132 ms
55,584 KB
testcase_07 AC 138 ms
55,936 KB
testcase_08 AC 135 ms
57,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        // 標準入力から読み込む際に、Scannerオブジェクトを使う。
        Scanner sc = new Scanner(System.in);

        int n=sc.nextInt(),k=sc.nextInt();

        if(n == 0){
            switch(k){
                case 0:
                    System.out.println("Drew");
                    break;

                case 1:
                    System.out.println("Won");
                    break;

                case 2:
                    System.out.println("Lost");
                    break;

                default:
                    break;
            }
        }
        else if(n == 1){
            switch(k){
                case 0:
                    System.out.println("Lost");
                    break;

                case 1:
                    System.out.println("Drew");
                    break;

                case 2:
                    System.out.println("Won");
                    break;

                default:
                    break;
            }
        }
        else if(n == 2){
            switch(k){
                case 0:
                    System.out.println("Won");
                    break;

                case 1:
                    System.out.println("Lost");
                    break;

                case 2:
                    System.out.println("Drew");
                    break;

                default:
                    break;
            }
        }
    }
}
0