結果
問題 | No.521 Cheeses and a Mousetrap(チーズとネズミ捕り) |
ユーザー |
![]() |
提出日時 | 2017-06-02 22:33:13 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 582 bytes |
コンパイル時間 | 1,790 ms |
コンパイル使用メモリ | 109,268 KB |
実行使用メモリ | 29,420 KB |
最終ジャッジ日時 | 2024-09-21 22:31:21 |
合計ジャッジ時間 | 2,557 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 WA * 7 |
コンパイルメッセージ
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; public class Solution { public static void Main() { var vals = Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); var n = vals[0]; var k = vals[1]; var result = 0; if ((k == 1 && n == 1) || n != 0 || k == 0 || k > n) { if (k * 2 - 1 == n) { result = n - 1; } else { result = n - 2; } } Console.WriteLine(result); } }