結果
問題 |
No.1184 Hà Nội
|
ユーザー |
|
提出日時 | 2020-08-22 14:51:02 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 418 bytes |
コンパイル時間 | 2,220 ms |
コンパイル使用メモリ | 192,920 KB |
最終ジャッジ日時 | 2025-01-13 08:58:15 |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 27 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i = 0; i < (int)n; i++) using ll = long long; const ll mod = 998244353; ll Pow(ll x, ll n){ if(n == 0) return 1; if(n % 2 == 0) return Pow(x*x % mod,n/2); else return x * Pow(x,n-1) % mod; } int main(){ ll n, l; cin >> n >> l; ll a = (n+l-1)/l; ll ans = Pow(2,a) - 1; if(ans < 0) ans += mod; cout << ans << endl; return 0; }