結果
| 問題 | No.521 Cheeses and a Mousetrap(チーズとネズミ捕り) |
| コンテスト | |
| ユーザー |
Risen
|
| 提出日時 | 2017-06-02 22:23:40 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 550 bytes |
| コンパイル時間 | 739 ms |
| コンパイル使用メモリ | 107,988 KB |
| 実行使用メモリ | 26,744 KB |
| 最終ジャッジ日時 | 2024-09-21 22:24:12 |
| 合計ジャッジ時間 | 2,257 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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(n != 0 || k == 0 || k > n)
{
if(k * 2 - 1 == n)
{
result = n - 1;
}
else
{
result = n - 2;
}
}
Console.WriteLine(result);
}
}
Risen