結果

問題 No.1184 Hà Nội
ユーザー ooooobaoooooba
提出日時 2021-08-22 19:47:59
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 714 bytes
コンパイル時間 981 ms
コンパイル使用メモリ 115,800 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-24 10:59:52
合計ジャッジ時間 1,791 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

using namespace std; // NOLINT

const int64_t MOD = 998244353;

int64_t f(int64_t x, int64_t y) {
    if (y == 0)
        return 1;
    auto z = f(x, y / 2);
    z = z * z % MOD;
    if (y % 2)
        z = z * x % MOD;
    return z;
}

int main() {
    int64_t n, l;
    cin >> n >> l;
    auto k = max(n - l + 1, int64_t(0));
    int64_t ans = f(2, k);
    ans = (ans - 1 + MOD) % MOD;
    cout << ans << endl;
    return 0;
}
0