結果

問題 No.251 大きな桁の復習問題(1)
ユーザー tailstails
提出日時 2015-07-25 02:12:58
言語 Perl
(5.38.2)
結果
AC  
実行時間 83 ms / 5,000 ms
コード長 149 bytes
コンパイル時間 600 ms
コンパイル使用メモリ 11,092 KB
実行使用メモリ 13,992 KB
最終ジャッジ日時 2023-08-22 16:59:26
合計ジャッジ時間 3,034 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
11,228 KB
testcase_01 AC 39 ms
11,440 KB
testcase_02 AC 42 ms
11,244 KB
testcase_03 AC 40 ms
11,184 KB
testcase_04 AC 39 ms
11,220 KB
testcase_05 AC 40 ms
11,080 KB
testcase_06 AC 39 ms
11,292 KB
testcase_07 AC 39 ms
11,080 KB
testcase_08 AC 39 ms
11,360 KB
testcase_09 AC 80 ms
13,904 KB
testcase_10 AC 82 ms
13,808 KB
testcase_11 AC 80 ms
13,848 KB
testcase_12 AC 81 ms
13,796 KB
testcase_13 AC 82 ms
13,880 KB
testcase_14 AC 80 ms
13,868 KB
testcase_15 AC 80 ms
13,788 KB
testcase_16 AC 81 ms
13,788 KB
testcase_17 AC 82 ms
13,900 KB
testcase_18 AC 83 ms
13,992 KB
testcase_19 AC 82 ms
13,848 KB
testcase_20 AC 40 ms
11,384 KB
testcase_21 AC 40 ms
11,172 KB
testcase_22 AC 42 ms
11,444 KB
testcase_23 AC 41 ms
11,104 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

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