結果

問題 No.8 N言っちゃダメゲーム
ユーザー shinshin
提出日時 2022-05-17 17:56:00
言語 Java21
(openjdk 21)
結果
AC  
実行時間 53 ms / 5,000 ms
コード長 854 bytes
コンパイル時間 4,625 ms
コンパイル使用メモリ 73,348 KB
実行使用メモリ 49,800 KB
最終ジャッジ日時 2023-10-13 16:51:02
合計ジャッジ時間 4,924 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,264 KB
testcase_01 AC 44 ms
49,156 KB
testcase_02 AC 44 ms
49,260 KB
testcase_03 AC 53 ms
49,800 KB
testcase_04 AC 52 ms
49,292 KB
testcase_05 AC 53 ms
49,496 KB
testcase_06 AC 53 ms
49,440 KB
testcase_07 AC 53 ms
49,440 KB
testcase_08 AC 53 ms
49,348 KB
testcase_09 AC 53 ms
49,780 KB
testcase_10 AC 51 ms
49,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class No8 {

	public static void main(String[] args) throws IOException{
		//N言っちゃダメゲーム
		String[] text = readStr();
		int P = Integer.parseInt(text[0]) , N , K;
		
		for(int i = 0;i < P;i++) {
			N = Integer.parseInt(text[i+1].split(" ")[0]);
			K = Integer.parseInt(text[i+1].split(" ")[1]);
			System.out.println((N - 1) % (K + 1) != 0 ? "Win" : "Lose");
		}

	}
	
	
	public static String[] readStr() throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<String> list = new ArrayList<>();

		do {
			list.add(br.readLine());
		}while(br.ready());

		br.close();

		String[] text = new String[list.size()];
		list.toArray(text);

		return text;

	}

}
0