結果

問題 No.521 Cheeses and a Mousetrap(チーズとネズミ捕り)
ユーザー aaaaaaiu
提出日時 2019-07-31 01:14:33
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 232 bytes
コンパイル時間 2,104 ms
コンパイル使用メモリ 192,688 KB
最終ジャッジ日時 2025-01-07 10:13:41
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    int n, k;
    cin>>n>>k;
    if (k==0 || k>n) puts("0");
    else if (k==n-k+1) cout << n-1 << endl;
    else cout << n-2 << endl;
    return 0;
}
0