結果

問題 No.8 N言っちゃダメゲーム
ユーザー koukonkokoukonko
提出日時 2015-12-11 20:42:56
言語 Java21
(openjdk 21)
結果
AC  
実行時間 51 ms / 5,000 ms
コード長 793 bytes
コンパイル時間 1,949 ms
コンパイル使用メモリ 71,324 KB
実行使用メモリ 49,552 KB
最終ジャッジ日時 2023-10-13 11:24:33
合計ジャッジ時間 3,588 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
49,372 KB
testcase_01 AC 43 ms
49,076 KB
testcase_02 AC 42 ms
49,380 KB
testcase_03 AC 49 ms
49,552 KB
testcase_04 AC 49 ms
49,412 KB
testcase_05 AC 49 ms
49,480 KB
testcase_06 AC 50 ms
49,092 KB
testcase_07 AC 51 ms
49,404 KB
testcase_08 AC 50 ms
49,068 KB
testcase_09 AC 50 ms
49,284 KB
testcase_10 AC 51 ms
49,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
		BufferedReader buff = new BufferedReader(new InputStreamReader(System.in));

		try {
			int count = Integer.parseInt(buff.readLine());

			while(count-- > 0){
				String[] box = buff.readLine().split(" ");
				int N = Integer.parseInt(box[0]);
				int K = Integer.parseInt(box[1]);
				if(N <= K){
					System.out.println("Win");
					continue;
				}
				if((N-K-2) % (K+1) == 0){
					System.out.println("Lose");
				}else{
					System.out.println("Win");
				}
			}

		} catch (NumberFormatException e) {
			e.getStackTrace();
		} catch (IOException e) {
			e.getStackTrace();
		} catch (Exception e) {
			e.getStackTrace();
		}
	}
}
0