結果

問題 No.521 Cheeses and a Mousetrap(チーズとネズミ捕り)
ユーザー oooooba
提出日時 2021-03-03 21:15:26
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 539 bytes
コンパイル時間 947 ms
コンパイル使用メモリ 108,044 KB
最終ジャッジ日時 2025-01-19 09:47:32
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 27 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <array>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <optional>
#include <queue>
#include <sstream>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

int main() {
    int32_t n, k;
    cin >> n >> k;
    int32_t ans;
    if (n <= 0 || k > n)
        ans = 0;
    else if (n % 2 == 1 && k == n / 2 + 1)
        ans = n - 1;
    else
        ans = n - 2;
    cout << ans << endl;
    return 0;
}
0