結果
問題 | No.1184 Hà Nội |
ユーザー |
![]() |
提出日時 | 2020-08-22 14:20:27 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 493 bytes |
コンパイル時間 | 2,325 ms |
コンパイル使用メモリ | 192,492 KB |
最終ジャッジ日時 | 2025-01-13 08:37:49 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 20 TLE * 7 |
ソースコード
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(int i = 0; i < n; i++) using ll = long long; using graph = vector<vector<int>>; const ll mod = 998244353; const int INF = 1001001001; int main(){ ll n, k; cin >> n >> k; ll ans = 1; if(n <= k){ cout << ans << endl; return 0; } else{ ll tmp = (n-1) / k; for(ll i = 0; i < tmp; i++){ ans = (ans * 2 % mod + 1) % mod; } cout << ans << endl; } }