結果

問題 No.1800 Random XOR
ユーザー soldray
提出日時 2022-01-08 22:07:12
言語 C++17(clang)
(17.0.6 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 462 bytes
コンパイル時間 3,725 ms
コンパイル使用メモリ 115,968 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-14 09:47:27
合計ジャッジ時間 1,372 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <iostream>

using namespace std;

#define ll long long
#define P (ll)(1000000007)

ll mpow(ll base, ll pow) {
  ll res = 1;

  while (pow > 0) {
    if ((pow & 1) == 1) {
      res *= base;
      res %= P;
    }

    base *= base;
    base %= P;

    pow >>= 1;
  }

  return res;
}

int main() {
  ll n, m; cin >> n >> m;

  ll ans = mpow(2, m);
  ans = (ans - 1) * mpow(2, P - 2);
  ans %= P;

  cout << ans << endl;

  return 0;
}
0