結果

問題 No.521 Cheeses and a Mousetrap(チーズとネズミ捕り)
ユーザー ninoinuininoinui
提出日時 2020-02-14 02:33:51
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 183 bytes
コンパイル時間 1,410 ms
コンパイル使用メモリ 166,008 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-06 06:50:45
合計ジャッジ時間 2,237 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, K;
  cin >> N >> K;
  cout << ((N < K || K == 0) ? 0 : (N % 2 && K == (N - 1) / 2 + 1) ? N - 1 : N - 2) << "\n";
}
0