結果

問題 No.1184 Hà Nội
ユーザー SSRS
提出日時 2020-08-22 13:04:42
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 397 bytes
コンパイル時間 1,762 ms
コンパイル使用メモリ 167,432 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-15 07:07:32
合計ジャッジ時間 2,555 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
long long modpow(long long a, long long b){
  long long ans = 1;
  while (b > 0){
    if (b % 2 == 1){
      ans *= a;
      ans %= MOD;
    }
    a *= a;
    a %= MOD;
    b /= 2;
  }
  return ans;
}
int main(){
  long long N, L;
  cin >> N >> L;
  long long p = (N + L - 1) / L;
  cout << modpow(2, p) - 1 << endl;
}
0