結果
問題 |
No.8 N言っちゃダメゲーム
|
ユーザー |
![]() |
提出日時 | 2023-04-28 10:24:40 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 29 ms / 5,000 ms |
コード長 | 842 bytes |
コンパイル時間 | 1,064 ms |
コンパイル使用メモリ | 107,008 KB |
実行使用メモリ | 19,200 KB |
最終ジャッジ日時 | 2024-11-17 11:22:43 |
合計ジャッジ時間 | 2,252 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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.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]); } } } }