結果

問題 No.1748 Parking Lot
ユーザー cellcraftycellcrafty
提出日時 2021-11-21 17:00:16
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,628 bytes
コンパイル時間 1,111 ms
コンパイル使用メモリ 113,932 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-05 02:39:45
合計ジャッジ時間 2,198 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 1 ms
4,376 KB
testcase_21 AC 1 ms
4,380 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <map>
#include <set>
#include <climits>
#include <queue>
#include <bitset>
#include <sstream>
#include <deque>
#include <cassert>
#if __has_include(<atcoder/modint>)
#   include <atcoder/modint>
#   include <atcoder/segtree>
#   include <atcoder/dsu>
#   include <atcoder/math>
#   include <atcoder/scc>
#endif
#include <unordered_map>
#include <unordered_set>
#include <cmath>
#include <numeric>
#include <iomanip>
#include <algorithm>
#include<stack>
#define CLIBCXX_DEBUG
#define ll long long
#define hmap unordered_map
#define hset unordered_set
using namespace std;
#if __has_include(<atcoder/modint>)
    using namespace atcoder;
    using mint10 = static_modint<10>;
    using mint24 = static_modint<24>;
    using mint = modint998244353;
#endif

ll powll(ll a, ll b)
{
    //制約 ans∊ll a, b∊double range
    return (ll)pow(a, b / 2) * (ll)pow(a, b - b / 2);
}
ll sum(ll a, ll b)
{
    return a + b;
}
ll e()
{
    return 0;
}

//return true if an argument is prime or one
bool isPrime(double num, set<ll>& primes, set<ll>& comps){
    if(num==1){
        return false;
    }
    if(primes.find(num)!=primes.end()){
        return true;
    }
    if(comps.find(num)!=comps.end()){
        return false;
    }
    double sq = sqrtf64(num);
    for(int32_t i = 2; i <= sq; ++i){
        if((ll)num%i==0){
            comps.insert(num);
            return false;
        }
    }
    primes.insert(num);
    return true;
}

int main()
{
    ll n,k;
    cin >> n>>k;
    if(n==1){
        cout << 1;
    }
    else if(k!=n-1){
        cout << (n-1);
    }else {
        cout << n;
    }
}
0