結果

問題 No.8 N言っちゃダメゲーム
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-11-25 17:35:41
言語 Java21
(openjdk 21)
結果
AC  
実行時間 146 ms / 5,000 ms
コード長 569 bytes
コンパイル時間 2,341 ms
コンパイル使用メモリ 71,464 KB
実行使用メモリ 58,412 KB
最終ジャッジ日時 2023-08-18 07:36:14
合計ジャッジ時間 4,405 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
56,176 KB
testcase_01 AC 118 ms
55,812 KB
testcase_02 AC 119 ms
56,184 KB
testcase_03 AC 145 ms
54,076 KB
testcase_04 AC 143 ms
56,168 KB
testcase_05 AC 146 ms
56,344 KB
testcase_06 AC 144 ms
56,212 KB
testcase_07 AC 140 ms
55,832 KB
testcase_08 AC 143 ms
56,296 KB
testcase_09 AC 145 ms
58,412 KB
testcase_10 AC 142 ms
56,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int P = sc.nextInt();
        for(int i=0; i<P; i++){
            int N = sc.nextInt();
            int K = sc.nextInt();
            String S = judge(N,K);
            System.out.println(S);
        }
    }
    static String judge(int x, int y){
        if(y>=x){
            return "Win";
        }
        int z = x%(y+1);
        if(z==1){
            return "Lose";
        }else{
            return "Win";
        }
    }
}
0