結果
問題 |
No.521 Cheeses and a Mousetrap(チーズとネズミ捕り)
|
ユーザー |
![]() |
提出日時 | 2017-06-02 22:57:39 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 575 bytes |
コンパイル時間 | 2,349 ms |
コンパイル使用メモリ | 108,384 KB |
実行使用メモリ | 29,168 KB |
最終ジャッジ日時 | 2024-09-21 23:54:15 |
合計ジャッジ時間 | 4,047 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 WA * 18 |
コンパイルメッセージ
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); } }