結果

問題 No.521 Cheeses and a Mousetrap(チーズとネズミ捕り)
ユーザー inori
提出日時 2017-06-02 22:25:22
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 204 bytes
コンパイル時間 1,309 ms
コンパイル使用メモリ 159,228 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-21 22:26:07
合計ジャッジ時間 2,134 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 27 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,k; cin>>n>>k;
  int ans;
  if(k>n || k==0) ans=0;
  else{
    if(k==n/2+1) ans=n-1;
    else ans=n-2;
  }
  cout<<ans<<endl;
  return 0;
}
0