結果
| 問題 |
No.1314 N言っちゃダメゲーム (5)
|
| コンテスト | |
| ユーザー |
keymoon
|
| 提出日時 | 2021-01-18 11:13:37 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 28 ms / 1,000 ms |
| コード長 | 896 bytes |
| コンパイル時間 | 831 ms |
| コンパイル使用メモリ | 104,960 KB |
| 実行使用メモリ | 19,072 KB |
| 最終ジャッジ日時 | 2024-11-30 22:44:45 |
| 合計ジャッジ時間 | 2,877 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 |
コンパイルメッセージ
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;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;
public static class P
{
public static void Main()
{
// (N-1)%(k+1)!=0ならば先手必勝、そうでないならば後手必勝
var mk = Console.ReadLine().Split().Select(int.Parse).ToArray();
var m = mk[0];
var k = mk[1];
var winSecond = (m - 1) / (k + 1);
var winFirst = (m - 1) - winSecond;
var me = (winFirst + 1) / 2 + (winFirst % 2 == 1 ? winSecond : 0);
var grant = (m - 1) - me;
if (me > grant) Console.WriteLine("Win");
if (me < grant) Console.WriteLine("Lose");
if (me == grant) Console.WriteLine("Draw");
}
}
keymoon