結果

問題 No.2186 冪乗の片側極限
ユーザー OnjoujiToki
提出日時 2023-01-13 21:50:22
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 897 bytes
コンパイル時間 936 ms
コンパイル使用メモリ 117,016 KB
最終ジャッジ日時 2025-02-10 02:27:49
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 55 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <array>
#include <bit>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <complex>
#include <cstdint>
#include <cstring>
#include <ctime>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>

long long mod_pow(long long x, int n, int p) {
  long long ret = 1;
  while (n) {
    if (n & 1) (ret *= x) %= p;
    (x *= x) %= p;
    n >>= 1;
  }
  return ret;
}

void solve() {
  int a, b;
  std::cin >> a >> b;
  long long ans = 1;
  while(b) {
    if (b & 1) (ans *= a);
    a *= a;
    b >>= 1;
  }
  std::cout << ans << '\n';
}
int main() {
  std::cin.tie(nullptr);
  std::ios::sync_with_stdio(false);
  std::cout << std::boolalpha;
  int t = 1;
  // std::cin >> t;

  while (t--) solve();
  // solve();
  return 0;
}
0