結果

問題 No.8 N言っちゃダメゲーム
ユーザー 14番14番
提出日時 2016-03-30 14:19:50
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 24 ms / 5,000 ms
コード長 1,492 bytes
コンパイル時間 3,434 ms
コンパイル使用メモリ 112,172 KB
実行使用メモリ 26,016 KB
最終ジャッジ日時 2024-04-10 06:29:54
合計ジャッジ時間 1,973 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
23,980 KB
testcase_01 AC 23 ms
26,016 KB
testcase_02 AC 23 ms
21,756 KB
testcase_03 AC 22 ms
21,812 KB
testcase_04 AC 22 ms
24,116 KB
testcase_05 AC 23 ms
24,236 KB
testcase_06 AC 23 ms
25,884 KB
testcase_07 AC 23 ms
23,920 KB
testcase_08 AC 24 ms
24,048 KB
testcase_09 AC 23 ms
21,816 KB
testcase_10 AC 23 ms
23,668 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

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();
    }
}
0