結果
| 問題 |
No.8 N言っちゃダメゲーム
|
| ユーザー |
mban
|
| 提出日時 | 2016-11-01 05:16:52 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,100 bytes |
| コンパイル時間 | 1,141 ms |
| コンパイル使用メモリ | 112,752 KB |
| 実行使用メモリ | 46,404 KB |
| 最終ジャッジ日時 | 2024-11-25 00:38:29 |
| 合計ジャッジ時間 | 46,048 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 TLE * 7 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
class Magatro
{
static int P;
static int[] N, K;
static void Main()
{
Read();
for(int i = 0; i < P; i++)
{
Console.WriteLine(Ans(N[i], K[i]));
}
}
static string Ans(int n,int k)
{
bool[] A = new bool[n+1];
A[n] = true;
for(int i = n; i >= 0; i--)
{
for(int j = 1; j <= k; j++) {
if (i - j < 0)
{
break;
}
A[i - j] ^= !A[i];
}
}
if (A[0])
{
return "Win";
}
else
{
return "Lose";
}
}
static void Read()
{
P = int.Parse(Console.ReadLine());
N = new int[P];
K = new int[P];
for (int i = 0; i<P; i++){
string[] s = Console.ReadLine().Split(' ');
N[i] = int.Parse(s[0]);
K[i] = int.Parse(s[1]);
}
}
}
mban