結果

問題 No.1184 Hà Nội
ユーザー ぷら
提出日時 2020-08-22 13:16:16
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 479 bytes
コンパイル時間 1,417 ms
コンパイル使用メモリ 165,716 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-15 07:27:42
合計ジャッジ時間 2,192 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> P;
int INF = 1e16+7;
int mod = 998244353;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int mod_pow(int x,int y) {
    int res = 1;
    while(y > 0) {
        if(y%2) {
            res = res*x%mod;
        }
        x = x*x%mod;
        y/=2;
    }
    return res;
}
signed main() {
    int N,L;
    cin >> N >> L;
    N = (N+L-1)/L;
    cout << (mod_pow(2,N)+mod-1)%mod << endl;
}
0