結果
問題 | No.329 全射 |
ユーザー |
![]() |
提出日時 | 2015-12-22 01:04:39 |
言語 | Perl (5.40.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 379 bytes |
コンパイル時間 | 935 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 21,408 KB |
最終ジャッジ日時 | 2024-09-18 18:21:11 |
合計ジャッジ時間 | 5,387 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 TLE * 1 -- * 29 |
コンパイルメッセージ
Main.pl syntax OK
ソースコード
sub i{<>=~/\d+/g} ($n,$m)=i; @w=(0,i); for(1..$m){ ($i,$j)=i; push@$i,$j; } for$k(1..$n){ @u=();$u[$k]++; @a=[$k,$w[$k]]; while(@a){ ($l,$s)=@{pop@a}; $t=$w[$l]; if($s>=$t){ for$i(1..$t){ use bigint; $r+=(-1)**($t-$i)*(bnok{$t+0}$i)*$i**$s; $r%=1e9+7; } } $s=$t if $s>$t; for(@$l){ if(!$u[$_]++){ push@a,[$_,$s]; } } } } print$r;