結果
問題 |
No.8 N言っちゃダメゲーム
|
ユーザー |
![]() |
提出日時 | 2016-03-30 14:19:50 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 26 ms / 5,000 ms |
コード長 | 1,492 bytes |
コンパイル時間 | 897 ms |
コンパイル使用メモリ | 114,448 KB |
実行使用メモリ | 18,176 KB |
最終ジャッジ日時 | 2024-10-02 08:09:29 |
合計ジャッジ時間 | 1,712 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 11 |
コンパイルメッセージ
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; public class Program { public void Proc() { Reader.IsDebug = false; int cnt = int.Parse(Reader.ReadLine()); for(int i=0; i<cnt;i++) { int[] inpt = Reader.GetInt(); if(this.IsWin(inpt[0], inpt[1])) { Console.WriteLine("Win"); } else { Console.WriteLine("Lose"); } } } private bool IsWin(int max, int len) { return !(max % (len + 1) == 1); } public class Reader { private static String InitText = @" "; private static System.IO.StringReader sr = null; public static bool IsDebug = true; public static string ReadLine() { if(IsDebug) { if(sr == null) { sr = new System.IO.StringReader(InitText.Trim()); } return sr.ReadLine(); } else { return Console.ReadLine(); } } public static int[] GetInt(char delimiter = ' ') { string[] inpt = ReadLine().Split(delimiter); int[] ret = new int[inpt.Length]; for(int i=0; i<inpt.Length; i++) { ret[i] = int.Parse(inpt[i]); } return ret; } } public static void Main(string[] args) { Program prg = new Program(); prg.Proc(); } }