結果
問題 | No.521 Cheeses and a Mousetrap(チーズとネズミ捕り) |
ユーザー | tom |
提出日時 | 2017-06-02 22:27:29 |
言語 | C++11 (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 343 bytes |
コンパイル時間 | 601 ms |
コンパイル使用メモリ | 66,104 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-21 22:29:13 |
合計ジャッジ時間 | 1,507 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 WA * 7 |
ソースコード
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <stack> #include <queue> #include <set> #include <map> using namespace std; int main(){ int n, k; cin >> n >> k; if (k > n || k < 0) { cout << 0 << endl; } else if((n + 1)/ 2 == k){ cout << n - 1 << endl; } else { cout << n - 2 << endl; } }