結果

問題 No.8 N言っちゃダメゲーム
ユーザー SagTokiSagToki
提出日時 2018-05-21 16:35:01
言語 Java21
(openjdk 21)
結果
AC  
実行時間 150 ms / 5,000 ms
コード長 794 bytes
コンパイル時間 3,393 ms
コンパイル使用メモリ 72,624 KB
実行使用メモリ 56,372 KB
最終ジャッジ日時 2023-09-11 00:23:42
合計ジャッジ時間 5,850 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,744 KB
testcase_01 AC 122 ms
55,752 KB
testcase_02 AC 125 ms
55,708 KB
testcase_03 AC 148 ms
56,372 KB
testcase_04 AC 148 ms
56,352 KB
testcase_05 AC 148 ms
55,716 KB
testcase_06 AC 148 ms
55,604 KB
testcase_07 AC 150 ms
56,036 KB
testcase_08 AC 150 ms
55,928 KB
testcase_09 AC 148 ms
56,364 KB
testcase_10 AC 147 ms
56,012 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.InputMismatchException;

public class DonotSayN {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        try{
            int P = scanner.nextInt();
            for(int i = 0 ; i < P ; i++){
                int N = scanner.nextInt();
                int K = scanner.nextInt();
                if((N - 1) % (K + 1) == 0){
                    System.out.println("Lose");
                }else{
                    System.out.println("Win");
                }
            }
            
        }catch(InputMismatchException e){
            System.out.println("数字を入力してください");
        }catch(Exception E){
            System.out.println("想定外のエラーです");
        }
    }
}
0