結果

問題 No.8 N言っちゃダメゲーム
ユーザー suzusuzu
提出日時 2023-04-28 10:24:40
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 58 ms / 5,000 ms
コード長 842 bytes
コンパイル時間 2,379 ms
コンパイル使用メモリ 106,272 KB
実行使用メモリ 23,804 KB
最終ジャッジ日時 2023-08-11 00:18:49
合計ジャッジ時間 4,184 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
23,708 KB
testcase_01 AC 57 ms
23,660 KB
testcase_02 AC 57 ms
23,804 KB
testcase_03 AC 57 ms
21,792 KB
testcase_04 AC 57 ms
23,628 KB
testcase_05 AC 57 ms
21,692 KB
testcase_06 AC 58 ms
21,516 KB
testcase_07 AC 57 ms
21,584 KB
testcase_08 AC 56 ms
21,648 KB
testcase_09 AC 56 ms
21,644 KB
testcase_10 AC 57 ms
21,680 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.Linq;
using System.Collections.Generic;
namespace yukicoder
{
    class Program
    {
    	static void Main(string[] args)
    	{
    		int P = int.Parse(Console.ReadLine());
    		var array = new int[P,2];
    		var winLose = new string[P];
    		for(int i = 0;i < P;i++)
    		{
    			var tempNK = Console.ReadLine().Split(' ').Select(c => int.Parse(c)).ToArray();
    			array[i,0] = tempNK[0];
    			array[i,1] = tempNK[1];
    		}
    		for(int i = 0;i < P;i++)
    		{
    			int N = array[i,0];
    			int K = array[i,1];
    			
    			if((N - 1)%(K + 1) == 0 && N - 1 >= K + 1)
    			{
    				winLose[i] = "Lose";
    			}else
    			{
    				winLose[i] = "Win";
    			}
    			
    		}
    		for(int i = 0;i < P;i++)
    		{
    			Console.WriteLine(winLose[i]);
    		}
    		
    		
    	}
    }
}
0