結果

問題 No.1748 Parking Lot
ユーザー yasuwo
提出日時 2021-11-21 20:00:45
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 714 bytes
コンパイル時間 5,513 ms
コンパイル使用メモリ 306,864 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-23 02:16:59
合計ジャッジ時間 6,307 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#line 1 "main.cpp"
#include <bits/stdc++.h>
#include <atcoder/all>
// #include "library/templates/template.cpp"
using namespace atcoder;
using namespace std;
using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

long long solve(long long N, long long K)
{
    if (N == 1)
    {
        return 1;
    }
    if (K != N - 1)
    {
        return N - 1;
    }
    else
    {
        return N;
    }
}

int main()
{
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
    long long N, K;
    std::cin >> N >> K;
    auto ans = solve(N, K);
    std::cout << ans << '\n';
    return 0;
}
0