結果

問題 No.521 Cheeses and a Mousetrap(チーズとネズミ捕り)
ユーザー RisenRisen
提出日時 2017-06-02 22:57:39
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 575 bytes
コンパイル時間 3,524 ms
コンパイル使用メモリ 108,164 KB
実行使用メモリ 25,172 KB
最終ジャッジ日時 2023-10-21 22:24:32
合計ジャッジ時間 3,967 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 24 ms
25,172 KB
testcase_03 AC 23 ms
25,172 KB
testcase_04 AC 25 ms
25,172 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 25 ms
25,172 KB
testcase_10 AC 24 ms
25,172 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 27 ms
25,172 KB
testcase_14 AC 27 ms
25,172 KB
testcase_15 AC 27 ms
25,172 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 24 ms
25,172 KB
testcase_27 AC 25 ms
25,172 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;

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