結果

問題 No.329 全射
ユーザー tailstails
提出日時 2015-12-22 01:04:39
言語 Perl
(5.38.2)
結果
TLE  
実行時間 -
コード長 379 bytes
コンパイル時間 994 ms
コンパイル使用メモリ 12,944 KB
実行使用メモリ 18,864 KB
最終ジャッジ日時 2023-10-18 22:20:34
合計ジャッジ時間 5,510 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
17,276 KB
testcase_01 AC 56 ms
12,904 KB
testcase_02 AC 57 ms
12,908 KB
testcase_03 AC 55 ms
12,904 KB
testcase_04 AC 60 ms
12,892 KB
testcase_05 AC 70 ms
12,912 KB
testcase_06 AC 61 ms
12,896 KB
testcase_07 AC 64 ms
12,908 KB
testcase_08 AC 58 ms
12,892 KB
testcase_09 AC 58 ms
12,896 KB
testcase_10 AC 54 ms
12,900 KB
testcase_11 AC 55 ms
12,904 KB
testcase_12 AC 57 ms
12,900 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

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;
0