結果

問題 No.573 a^2[i] = a[i]
ユーザー %20%20
提出日時 2017-10-06 23:14:36
言語 Perl
(5.38.2)
結果
TLE  
実行時間 -
コード長 261 bytes
コンパイル時間 30 ms
コンパイル使用メモリ 6,684 KB
実行使用メモリ 17,584 KB
最終ジャッジ日時 2024-04-28 10:50:31
合計ジャッジ時間 21,248 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 9 ms
12,188 KB
testcase_01 AC 11 ms
6,940 KB
testcase_02 AC 13 ms
6,940 KB
testcase_03 AC 16 ms
6,944 KB
testcase_04 AC 19 ms
6,944 KB
testcase_05 AC 22 ms
6,944 KB
testcase_06 AC 25 ms
6,944 KB
testcase_07 AC 28 ms
6,940 KB
testcase_08 AC 29 ms
6,944 KB
testcase_09 AC 31 ms
6,940 KB
testcase_10 AC 34 ms
6,944 KB
testcase_11 AC 36 ms
6,944 KB
testcase_12 AC 39 ms
6,940 KB
testcase_13 AC 42 ms
6,944 KB
testcase_14 AC 43 ms
6,940 KB
testcase_15 AC 46 ms
6,940 KB
testcase_16 AC 49 ms
6,940 KB
testcase_17 AC 52 ms
6,940 KB
testcase_18 AC 53 ms
6,944 KB
testcase_19 AC 55 ms
6,940 KB
testcase_20 AC 79 ms
6,940 KB
testcase_21 AC 113 ms
6,940 KB
testcase_22 AC 133 ms
6,944 KB
testcase_23 AC 159 ms
6,940 KB
testcase_24 AC 199 ms
6,940 KB
testcase_25 AC 203 ms
6,940 KB
testcase_26 AC 236 ms
6,944 KB
testcase_27 AC 258 ms
6,944 KB
testcase_28 AC 267 ms
6,940 KB
testcase_29 AC 301 ms
6,944 KB
testcase_30 AC 308 ms
6,944 KB
testcase_31 AC 306 ms
6,940 KB
testcase_32 AC 604 ms
6,940 KB
testcase_33 AC 1,330 ms
6,940 KB
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]%$m*`dc -e'$k $N $k-$m|n'`%$m)%=$m
}
print$x
0