結果

問題 No.8 N言っちゃダメゲーム
ユーザー mitsuomitsuo
提出日時 2016-05-07 20:28:58
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 819 bytes
コンパイル時間 2,287 ms
コンパイル使用メモリ 79,172 KB
実行使用メモリ 54,344 KB
最終ジャッジ日時 2024-04-15 13:38:52
合計ジャッジ時間 4,595 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
54,224 KB
testcase_01 AC 132 ms
54,204 KB
testcase_02 AC 131 ms
54,244 KB
testcase_03 AC 144 ms
54,296 KB
testcase_04 AC 139 ms
54,200 KB
testcase_05 AC 141 ms
54,176 KB
testcase_06 WA -
testcase_07 AC 140 ms
54,344 KB
testcase_08 AC 141 ms
54,344 KB
testcase_09 AC 141 ms
54,040 KB
testcase_10 AC 143 ms
54,088 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package jp.fedom.challange.yuki.l2.q8;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List<String> input = new ArrayList<>();
		while (sc.hasNext()) {
			input.add(sc.nextLine());
		}

		System.out.println(solve(input));

		sc.close();
	}

	public static String solve(List<String> in) {
		int P = Integer.valueOf(in.get(0));
		StringBuilder sb = new StringBuilder();
		in.remove(0);

		for (String s : in) {
			int n = Integer.valueOf(s.split(" ")[0]);
			int k = Integer.valueOf(s.split(" ")[1]);
			if ((n - 1) % (k + 1) == 1 || (n - 1) % (k + 1) == 0) {
				sb.append("Lose");
			} else {
				sb.append("Win");
			}
			sb.append("\r\n");
		}

		return sb.toString().trim();

	}
}
0