結果
| 問題 |
No.1184 Hà Nội
|
| コンテスト | |
| ユーザー |
ninoinui
|
| 提出日時 | 2020-08-22 13:18:59 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 402 bytes |
| コンパイル時間 | 2,148 ms |
| コンパイル使用メモリ | 192,504 KB |
| 最終ジャッジ日時 | 2025-01-13 07:26:09 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 27 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
// constexpr int MOD = 1000000007;
constexpr int MOD = 998244353;
long mpow(long a, long b) {
long res = 1;
while (b > 0) {
if (b & 1) res = res * a % MOD;
a = a * a % MOD;
b >>= 1;
}
return res;
}
int main() {
long N, L;
cin >> N >> L;
if (N <= L) return cout << 1 << "\n", 0;
cout << mpow(2, (N + L - 1) / L) - 1 << "\n";
}
ninoinui