結果
問題 |
No.1184 Hà Nội
|
ユーザー |
![]() |
提出日時 | 2020-08-22 13:32:15 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 714 bytes |
コンパイル時間 | 2,157 ms |
コンパイル使用メモリ | 192,736 KB |
最終ジャッジ日時 | 2025-01-13 07:42:02 |
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 20 WA * 7 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for (int i=0; i < (n); i++) using namespace std; using ll = long long; ll MOD = 998244353; long long pow(long long x, long long n) { long long ret = 1; while (n > 0) { if (n & 1) ret = ret * x % MOD; // n の最下位bitが 1 ならば x^(2^i) をかける x = x * x % MOD; n >>= 1; // n を1bit 左にずらす } return ret; } int main(){ ios::sync_with_stdio(false); ll N,L; cin>>N>>L; if(N<L){ cout << 1 << endl; return 0; } if(N%L==0){ N = N/L; }else{ N = N/L + 1; } cerr << N << endl; ll ans=1; ans = pow(2,N); cout << ans - 1 << endl; }