結果
問題 |
No.329 全射
|
ユーザー |
![]() |
提出日時 | 2015-12-22 01:07:46 |
言語 | Perl (5.40.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 396 bytes |
コンパイル時間 | 721 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 19,840 KB |
最終ジャッジ日時 | 2024-09-18 18:21:44 |
合計ジャッジ時間 | 4,695 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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)*(bmodpow{$i+0}$s,1e9+7); $r%=1e9+7; } } $s=$t if $s>$t; for(@$l){ if(!$u[$_]++){ push@a,[$_,$s]; } } } } print$r;