結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
11,312 KB
testcase_01 WA -
testcase_02 AC 43 ms
11,184 KB
testcase_03 AC 41 ms
11,188 KB
testcase_04 AC 41 ms
11,204 KB
testcase_05 AC 41 ms
11,120 KB
testcase_06 AC 42 ms
11,116 KB
testcase_07 AC 41 ms
10,996 KB
testcase_08 AC 40 ms
11,020 KB
testcase_09 AC 82 ms
13,616 KB
testcase_10 AC 82 ms
13,620 KB
testcase_11 AC 82 ms
13,796 KB
testcase_12 AC 81 ms
13,644 KB
testcase_13 AC 82 ms
13,804 KB
testcase_14 AC 82 ms
13,624 KB
testcase_15 AC 82 ms
13,528 KB
testcase_16 AC 82 ms
13,600 KB
testcase_17 AC 82 ms
13,824 KB
testcase_18 AC 82 ms
13,620 KB
testcase_19 AC 82 ms
13,804 KB
testcase_20 AC 41 ms
11,316 KB
testcase_21 AC 41 ms
11,328 KB
testcase_22 AC 43 ms
11,316 KB
testcase_23 AC 41 ms
11,180 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=<>;$m=<>;
print$n?$m?f$n%$p,$m%($p-1):1:0
0