結果
問題 |
No.8 N言っちゃダメゲーム
|
ユーザー |
![]() |
提出日時 | 2016-11-01 05:14:28 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,103 bytes |
コンパイル時間 | 968 ms |
コンパイル使用メモリ | 110,408 KB |
実行使用メモリ | 60,092 KB |
最終ジャッジ日時 | 2024-11-25 00:37:43 |
合計ジャッジ時間 | 45,393 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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[120001]; 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]); } } }