結果

問題 No.1184 Hà Nội
ユーザー betrue12
提出日時 2020-09-01 03:21:09
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 556 bytes
コンパイル時間 2,256 ms
コンパイル使用メモリ 191,436 KB
最終ジャッジ日時 2025-01-14 02:49:02
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

const int64_t MOD = 998244353;
void add(int64_t& a, int64_t b){
    a = (a+b) % MOD;
}
void mul(int64_t& a, int64_t b){
    a = a*b % MOD;
}

int64_t power_mod(int64_t num, int64_t power){
    int64_t prod = 1;
    num %= MOD;
    while(power > 0){
        if(power&1) prod = prod * num % MOD;
        num = num * num % MOD;
        power >>= 1;
    }
    return prod;
}

int main(){
    int64_t N, L;
    cin >> N >> L;
    int64_t ans = power_mod(2, (N+L-1)/L) - 1;
    cout << ans << endl;
    return 0;
}
0