結果

問題 No.8 N言っちゃダメゲーム
ユーザー Amanita2016Amanita2016
提出日時 2017-09-11 19:06:37
言語 Java21
(openjdk 21)
結果
AC  
実行時間 156 ms / 5,000 ms
コード長 601 bytes
コンパイル時間 3,153 ms
コンパイル使用メモリ 74,696 KB
実行使用メモリ 41,784 KB
最終ジャッジ日時 2024-04-25 06:50:52
合計ジャッジ時間 5,605 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
41,784 KB
testcase_01 AC 109 ms
40,352 KB
testcase_02 AC 120 ms
41,136 KB
testcase_03 AC 133 ms
41,512 KB
testcase_04 AC 136 ms
41,600 KB
testcase_05 AC 135 ms
41,652 KB
testcase_06 AC 153 ms
41,728 KB
testcase_07 AC 142 ms
41,224 KB
testcase_08 AC 137 ms
41,660 KB
testcase_09 AC 155 ms
41,448 KB
testcase_10 AC 156 ms
41,508 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class StickUpGame {
	public static void main(String[] args){
		@SuppressWarnings("resource")
		Scanner s = new Scanner(System.in);
		int game  = s.nextInt();
		int stick[] = new int[game];
		int maxNum[] = new int[game];
		for(int i = 0 ; i < game ; i++){
			stick[i] = s.nextInt();
			maxNum[i] = s.nextInt();
		}
		for(int i = 0 ; i < game ; i++){
			int n = stick[i];
			int k = maxNum[i];
			if((n <= k) || ((n%(k+1)) != 1)){
				System.out.println("Win");
			}else{
				System.out.println("Lose");
			}
		}
		
	}
}
0