結果
| 問題 |
No.521 Cheeses and a Mousetrap(チーズとネズミ捕り)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-08-27 22:21:37 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 30 ms / 2,000 ms |
| コード長 | 349 bytes |
| コンパイル時間 | 1,650 ms |
| コンパイル使用メモリ | 111,740 KB |
| 実行使用メモリ | 27,288 KB |
| 最終ジャッジ日時 | 2024-11-06 07:02:44 |
| 合計ジャッジ時間 | 2,844 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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.Linq;
class Program {
static void Main() {
int[] nk = Console.ReadLine().Split().Select(int.Parse).ToArray();
int n = nk[0], k = nk[1], ans = 0;
if (0 < k && k <= n) {
if (2 * k == n + 1) ans = n - 1;
else ans = n - 2;
}
Console.WriteLine(ans);
}
}