結果
問題 | No.1184 Hà Nội |
ユーザー |
![]() |
提出日時 | 2020-08-22 13:11:38 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 349 bytes |
コンパイル時間 | 869 ms |
コンパイル使用メモリ | 72,080 KB |
最終ジャッジ日時 | 2025-01-13 07:17:26 |
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 13 WA * 14 |
ソースコード
#include <iostream>#include <vector>#include <algorithm>using namespace std;int main(){long long n,l;cin>>n>>l;long long k=max(n-l+1,1LL);const long long MOD=998244353;long long d=2;long long ans=1;for(;k>0;k>>=1){if(k&1) ans=(ans*d)%MOD;d=(d*d)%MOD;}cout<<ans-1<<endl;return 0;}