結果

問題 No.521 Cheeses and a Mousetrap(チーズとネズミ捕り)
ユーザー Series_205
提出日時 2019-10-25 20:27:21
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 26 ms / 2,000 ms
コード長 188 bytes
コンパイル時間 682 ms
コンパイル使用メモリ 64,580 KB
最終ジャッジ日時 2025-01-08 00:59:25
ジャッジサーバーID
(参考情報)
judge1 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int n,k;
int main(){
    cin>>n>>k;
    if(k==0||k>n)cout<<0<<endl;
    else if(k*2==n+1)cout<<n-1<<endl;
    else cout<<n-2<<endl;
    return 0;
}
0