結果

問題 No.251 大きな桁の復習問題(1)
コンテスト
ユーザー
提出日時 2015-10-04 20:18:27
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 344 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 170 ms
コンパイル使用メモリ 40,480 KB
実行使用メモリ 48,452 KB
最終ジャッジ日時 2026-04-02 18:04:54
合計ジャッジ時間 805 ms
ジャッジサーバーID
(参考情報)
judge5_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 7 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <stdio.h>
#include <stdlib.h>

typedef unsigned long long ul;

ul modPow(ul x, ul y) {
	if(y == 0) return 1;
	ul res = modPow(x * x % 129402307, y / 2);
	if(y & 1) res = res * x % 129402307;
	return res;
}

int main() {
	ul n, m;
	scanf("%llu", &n); fflush(stdin);
	scanf("%llu", &m); fflush(stdin);
	printf("%llu\n", modPow(n, m));
}
0