結果

問題 No.8 N言っちゃダメゲーム
ユーザー kou6839
提出日時 2014-11-09 12:49:22
言語 Java
(openjdk 23)
結果
AC  
実行時間 162 ms / 5,000 ms
コード長 504 bytes
コンパイル時間 2,209 ms
コンパイル使用メモリ 74,436 KB
実行使用メモリ 54,444 KB
最終ジャッジ日時 2024-12-31 08:48:21
合計ジャッジ時間 4,442 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
 

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int P =sc.nextInt();
		int[] N = new int[P];
		int[] K = new int[P];
		for(int i=0;i<P;i++){
			N[i]=sc.nextInt();
			K[i]=sc.nextInt();
		}
		for(int i=0;i<P;i++){
			int temp=N[i]-1;
			while(temp>0){
				temp-=K[i]+1;
			}
			temp+=K[i]+1;
			if(temp<=K[i]){
				System.out.println("Win");
			}else{
				System.out.println("Lose");
			}
		}
 	}
}	
0