結果
| 問題 |
No.521 Cheeses and a Mousetrap(チーズとネズミ捕り)
|
| コンテスト | |
| ユーザー |
focus
|
| 提出日時 | 2018-02-15 12:50:16 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 279 bytes |
| コンパイル時間 | 674 ms |
| コンパイル使用メモリ | 59,992 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-25 23:45:49 |
| 合計ジャッジ時間 | 1,633 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 28 |
ソースコード
#include<iostream>
#include<string>
#include<cmath>
#include<set>
using namespace std;
int main(){
long long N,K;
cin >> N >> K;
if(K==0||N<K) cout << 0 << endl;
else if(N%2==1&&N/2+1==K) cout << N-1 << endl;
else cout << N-2 << endl;
return 0;
}
focus