結果

問題 No.251 大きな桁の復習問題(1)
ユーザー tailstails
提出日時 2015-07-25 02:10:41
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 140 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 11,292 KB
実行使用メモリ 13,848 KB
最終ジャッジ日時 2023-09-23 04:20:19
合計ジャッジ時間 2,607 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
11,288 KB
testcase_01 AC 41 ms
11,108 KB
testcase_02 AC 43 ms
11,056 KB
testcase_03 AC 40 ms
11,108 KB
testcase_04 WA -
testcase_05 AC 42 ms
11,292 KB
testcase_06 WA -
testcase_07 AC 41 ms
11,224 KB
testcase_08 AC 42 ms
11,128 KB
testcase_09 AC 81 ms
13,580 KB
testcase_10 AC 82 ms
13,580 KB
testcase_11 AC 81 ms
13,616 KB
testcase_12 AC 81 ms
13,848 KB
testcase_13 AC 82 ms
13,584 KB
testcase_14 AC 81 ms
13,784 KB
testcase_15 AC 81 ms
13,588 KB
testcase_16 AC 82 ms
13,608 KB
testcase_17 AC 82 ms
13,640 KB
testcase_18 AC 82 ms
13,688 KB
testcase_19 AC 81 ms
13,588 KB
testcase_20 AC 43 ms
11,188 KB
testcase_21 AC 41 ms
11,116 KB
testcase_22 AC 44 ms
11,276 KB
testcase_23 AC 41 ms
10,980 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

use bigint;
$p=129402307;
sub f{
	my($n,$m)=@_;
	$m?$m&1?f($n,$m-1)*$n%$p:f($n*$n%$p,$m/2):1;
}
$n=<>;$m=<>;
print$n?$m?f$n%$p,$m%($p-1):1:0
0