結果

問題 No.521 Cheeses and a Mousetrap(チーズとネズミ捕り)
ユーザー kyo1
提出日時 2020-10-19 02:28:56
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 314 bytes
コンパイル時間 1,996 ms
コンパイル使用メモリ 191,460 KB
最終ジャッジ日時 2025-01-15 11:41:16
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N, K;
  cin >> N >> K;
  if (K == 0 || K > N) {
    cout << 0 << '\n';
    return 0;
  }
  if (K == N - K + 1) {
    cout << N - 1 << '\n';
  } else {
    cout << N - 2 << '\n';
  }
  return 0;
}
0