結果

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

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

int main() {
  long long n, l; cin >> n >> l;
  long long kaage;
  if(n % l == 0) {
    kaage = n /l;
  }
  else {
    kaage = n /l +1;
  }
  
  cout << modpow(2, kaage, 998244353) -1 << endl;
}
0