結果

問題 No.8 N言っちゃダメゲーム
ユーザー kohaku_kohaku
提出日時 2016-11-25 17:35:41
言語 Java
(openjdk 23)
結果
AC  
実行時間 157 ms / 5,000 ms
コード長 569 bytes
コンパイル時間 2,292 ms
コンパイル使用メモリ 73,988 KB
実行使用メモリ 41,908 KB
最終ジャッジ日時 2024-11-27 11:19:52
合計ジャッジ時間 4,164 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

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