結果
| 問題 |
No.1184 Hà Nội
|
| コンテスト | |
| ユーザー |
akane
|
| 提出日時 | 2020-08-22 13:31:00 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 656 bytes |
| コンパイル時間 | 2,177 ms |
| コンパイル使用メモリ | 192,772 KB |
| 最終ジャッジ日時 | 2025-01-13 07:40:13 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 9 WA * 18 |
ソースコード
#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==0 || N<L){
N = N/L;
}else{
N = N/L + 1;
}
cerr << N << endl;
ll ans=1;
ans = pow(2,N);
cout << ans - 1 << endl;
}
akane