結果

問題 No.2007 Arbitrary Mod (Easy)
コンテスト
ユーザー candy-con
提出日時 2022-07-15 22:04:43
言語 C++14
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 405 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 840 ms
コンパイル使用メモリ 179,184 KB
実行使用メモリ 9,412 KB
最終ジャッジ日時 2026-07-31 08:29:02
合計ジャッジ時間 7,486 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 30
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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;
}
long long a;
long long b;
long long mod = pow(10,8);

int main() {
    cin >> a, b;
    cout << mod << endl;
    cout << modpow(a, b, mod) << endl;
}
0