結果

問題 No.8 N言っちゃダメゲーム
ユーザー mitsuomitsuo
提出日時 2016-05-07 21:06:32
言語 Java21
(openjdk 21)
結果
AC  
実行時間 139 ms / 5,000 ms
コード長 869 bytes
コンパイル時間 2,374 ms
コンパイル使用メモリ 79,380 KB
実行使用メモリ 41,904 KB
最終ジャッジ日時 2024-04-15 13:40:48
合計ジャッジ時間 4,531 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
41,396 KB
testcase_01 AC 127 ms
41,324 KB
testcase_02 AC 127 ms
41,200 KB
testcase_03 AC 138 ms
41,608 KB
testcase_04 AC 136 ms
41,904 KB
testcase_05 AC 136 ms
41,832 KB
testcase_06 AC 136 ms
41,636 KB
testcase_07 AC 139 ms
41,660 KB
testcase_08 AC 136 ms
41,792 KB
testcase_09 AC 139 ms
41,812 KB
testcase_10 AC 136 ms
41,472 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 <= k) {
				sb.append("Win");
			} else {
				int m = (n - 1) % (k + 1);
				if (m == 0) {
					sb.append("Lose");
				} else {
					sb.append("Win");
				}
			}
			sb.append("\r\n");
		}

		return sb.toString().trim();

	}
}
0