結果
| 問題 | No.521 Cheeses and a Mousetrap(チーズとネズミ捕り) |
| コンテスト | |
| ユーザー |
samplelpmas
|
| 提出日時 | 2017-12-30 09:53:29 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 311 bytes |
| 記録 | |
| コンパイル時間 | 478 ms |
| コンパイル使用メモリ | 70,128 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-28 05:33:38 |
| 合計ジャッジ時間 | 1,813 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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