結果

問題 No.8 N言っちゃダメゲーム
ユーザー mitsuomitsuo
提出日時 2016-05-07 21:05:43
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 896 bytes
コンパイル時間 2,193 ms
コンパイル使用メモリ 79,452 KB
実行使用メモリ 56,232 KB
最終ジャッジ日時 2024-04-15 13:40:36
合計ジャッジ時間 4,429 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 139 ms
41,524 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
権限があれば一括ダウンロードができます

ソースコード

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 <= k) {
				sb.append("Win");
			} else {
				int m = (n - 1) % (k + 1);
				System.out.println(m);
				if (m == 0) {
					sb.append("Lose");
				} else {
					sb.append("Win");
				}
			}
			sb.append("\r\n");
		}

		return sb.toString().trim();

	}
}
0