結果

問題 No.264 じゃんけん
ユーザー l1267976l1267976
提出日時 2017-03-07 22:10:39
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 5,000 ms
コード長 636 bytes
コンパイル時間 3,940 ms
コンパイル使用メモリ 71,820 KB
実行使用メモリ 56,244 KB
最終ジャッジ日時 2023-09-05 22:36:19
合計ジャッジ時間 5,010 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
56,016 KB
testcase_01 AC 121 ms
55,716 KB
testcase_02 AC 122 ms
55,868 KB
testcase_03 AC 123 ms
55,708 KB
testcase_04 AC 122 ms
56,100 KB
testcase_05 AC 125 ms
55,900 KB
testcase_06 AC 126 ms
56,244 KB
testcase_07 AC 125 ms
55,864 KB
testcase_08 AC 123 ms
56,108 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No264 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();

        int diff = Math.abs(n - k);

        switch (diff) {
        case 0:
            System.out.println("Drew");
            break;
        case 1:
            if (n < k) System.out.println("Won");
            else System.out.println("Lost");
            break;
        case 2:
            if (n < k) System.out.println("Lost");
            else System.out.println("Won");
            break;
        }

        sc.close();
    }

}
0