結果
| 問題 |
No.1184 Hà Nội
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-08-22 13:13:40 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 465 bytes |
| コンパイル時間 | 1,519 ms |
| コンパイル使用メモリ | 167,828 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-15 07:25:00 |
| 合計ジャッジ時間 | 2,476 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 27 |
ソースコード
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
ll mod_pow(ll x, ll n, ll mod) {
ll res = 1;
while (n > 0) {
if (n & 1) res = res * x % mod;
x = x * x % mod;
n >>= 1;
}
return res;
}
int main() {
ll N, L;
cin >> N >> L;
ll x = (N + L - 1) / L;
ll MOD = 998244353;
ll ans = (mod_pow(2, x, MOD) - 1 + MOD) % MOD;
cout << ans << "\n";
}