結果

問題 No.573 a^2[i] = a[i]
ユーザー %20%20
提出日時 2017-10-06 23:13:11
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 258 bytes
コンパイル時間 37 ms
コンパイル使用メモリ 6,940 KB
実行使用メモリ 11,932 KB
最終ジャッジ日時 2024-04-28 10:50:01
合計ジャッジ時間 20,366 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 9 ms
11,932 KB
testcase_01 AC 14 ms
8,928 KB
testcase_02 AC 16 ms
10,400 KB
testcase_03 AC 18 ms
6,948 KB
testcase_04 AC 21 ms
6,940 KB
testcase_05 AC 24 ms
6,940 KB
testcase_06 AC 27 ms
6,944 KB
testcase_07 AC 31 ms
6,944 KB
testcase_08 AC 33 ms
6,944 KB
testcase_09 AC 37 ms
6,940 KB
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 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 TLE -
testcase_35 TLE -
testcase_36 TLE -
testcase_37 TLE -
testcase_38 TLE -
testcase_39 TLE -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

# Σ[k=1..N]{ C(N,k) * k^(N-k) }
$N=<>;
$m=1e9+7;
@f=1;
$f[$_]=$f[$_-1]*$_%$m for 1..$N;
$i[$N]=`dc -e'$f[$N] $m 2-$m|n'`;
$i[$_]=$i[$_+1]*($_+1)%$m for reverse 0..$N-1;
for$k(1..$N){
	($x+=$f[$N]*$i[$k]%$m*$i[$N-$k]*`dc -e'$k $N $k-$m|n'`%$m)%=$m
}
print$x
0