結果

問題 No.251 大きな桁の復習問題(1)
ユーザー
提出日時 2015-10-04 20:26:01
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 345 bytes
コンパイル時間 204 ms
コンパイル使用メモリ 25,700 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-09-27 02:02:15
合計ジャッジ時間 1,399 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,500 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 1 ms
4,376 KB
testcase_21 AC 1 ms
4,384 KB
testcase_22 WA -
testcase_23 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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 >> 1);
	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