結果

問題 No.411 昇順昇順ソート
ユーザー kpinkcat
提出日時 2023-12-11 14:06:55
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 412 bytes
コンパイル時間 822 ms
コンパイル使用メモリ 103,732 KB
最終ジャッジ日時 2025-02-18 10:22:49
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 28 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<algorithm>
#include<cctype>
#include<set>
#include<bitset>
#include<math.h>
#include<map>
#include<queue>
#include<iomanip>
using namespace std;
using ll = long long;

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