結果
問題 |
No.1184 Hà Nội
|
ユーザー |
|
提出日時 | 2020-12-22 10:25:00 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,285 bytes |
コンパイル時間 | 1,678 ms |
コンパイル使用メモリ | 167,964 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-21 14:00:59 |
合計ジャッジ時間 | 2,657 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 27 |
ソースコード
#include <bits/stdc++.h> using namespace std; using Int = int_fast64_t; using Word = uint_fast64_t; using VInt = vector<Int>; using VVI = vector<VInt>; using VWord = vector<Word>; using VVW = vector<VWord>; using VS = vector<string>; using VVS = vector<VS>; using VB = vector<bool>; using VVB = vector<VB>; using PII = pair<Int,Int>; using PWW = pair<Word,Word>; using VPII = vector<PII>; using VPWW = vector<PWW>; #define SZ(x) ((Int)(x).size()) #define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()) #define rep(i,n) for(Int i=0, i##_len=(n); i<i##_len; ++i) #define reps(i,n) for(Int i=0, i##_len=(n); i<=i##_len; ++i) #define Range(i,a,b) for(Int i=a; i<=(Int)(b); i++) #define ALL(x) (x).begin(),(x).end() #define RALL(x) (x).rbegin(),(x).rend() #define pb push_back #define eb emplace_back int main() { ios_base::sync_with_stdio(0); cin.tie(0); const Int mod = 998244353; auto f = [](Int a, Int b) -> Int { Int x = 1; while (b != 0) { if (b & 1) { x = ((Int)x * a) % mod; } a = ((Int)a * a) % mod; b >>= 1; } return x; }; auto g = [](Int x) -> Int { return ((Int)x + mod) % mod; }; Int n, m; cin >> n >> m; n = (n + m - 1) / m; Int ans = f(2, n); cout << g(ans - 1) << endl; return 0; }