結果

問題 No.8 N言っちゃダメゲーム
ユーザー snzt_ry
提出日時 2017-11-21 11:59:32
言語 Java
(openjdk 23)
結果
AC  
実行時間 143 ms / 5,000 ms
コード長 499 bytes
コンパイル時間 1,856 ms
コンパイル使用メモリ 74,020 KB
実行使用メモリ 54,460 KB
最終ジャッジ日時 2024-11-26 08:04:30
合計ジャッジ時間 3,825 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int[] a = new int[n * 2];

		for (int i = 0; i < n*2; i++) {
			a[i] = scanner.nextInt();
		}

		for (int i = 0; i < n * 2; i += 2) {
			int ans = a[i] - 1;
			while (ans > a[i + 1]) {
				ans -= a[i+1]+1;
			}

			if (ans > 0 && ans <= a[i+1]) {
				System.out.println("Win");
			} else {
				System.out.println("Lose");
			}
		}
	}
}
0