結果
| 問題 | No.521 Cheeses and a Mousetrap(チーズとネズミ捕り) |
| コンテスト | |
| ユーザー |
samplelpmas
|
| 提出日時 | 2017-12-30 09:53:29 |
| 言語 | C++11 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 2,000 ms |
| + 322µs | |
| コード長 | 311 bytes |
| 記録 | |
| コンパイル時間 | 259 ms |
| コンパイル使用メモリ | 70,964 KB |
| 実行使用メモリ | 9,872 KB |
| 最終ジャッジ日時 | 2026-10-05 15:02:31 |
| 合計ジャッジ時間 | 1,831 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 28 |
ソースコード
#include <iostream>
using namespace std;
int main() {
int N, K;
cin >> N >> K;
if (K == 0 || K > N) {
cout << 0 << endl;
return 0;
}
if (N % 2 == 1 && K == (N + 1) / 2) {
cout << N - 1 << endl;
} else {
cout << N - 2 << endl;
}
return 0;
}
samplelpmas