結果
問題 |
No.1184 Hà Nội
|
ユーザー |
![]() |
提出日時 | 2021-06-07 00:36:02 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 372 bytes |
コンパイル時間 | 2,582 ms |
コンパイル使用メモリ | 165,648 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-23 22:07:35 |
合計ジャッジ時間 | 3,230 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | WA * 27 |
ソースコード
#include <bits/stdc++.h> #define NIL (-1) #define ll long long using namespace std; const double PI = acos(-1.0); int main() { ll N, L; cin >> N >> L; ll n = N / L; n += N % L; const ll mod = 998244353; ll ans = 1, m = 2; while (n) { if (n & 1) { ans *= m; n--; } m *= 2; ans %= mod; m %= mod; n /= 2; } cout << ans - 1 << endl; return 0; }