結果

問題 No.329 全射
ユーザー tailstails
提出日時 2015-12-22 01:07:46
言語 Perl
(5.38.2)
結果
TLE  
実行時間 -
コード長 396 bytes
コンパイル時間 1,049 ms
コンパイル使用メモリ 12,912 KB
実行使用メモリ 18,880 KB
最終ジャッジ日時 2023-10-18 22:21:10
合計ジャッジ時間 4,774 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
17,276 KB
testcase_01 AC 55 ms
12,936 KB
testcase_02 AC 59 ms
12,936 KB
testcase_03 AC 54 ms
12,940 KB
testcase_04 AC 62 ms
12,948 KB
testcase_05 AC 75 ms
12,924 KB
testcase_06 AC 62 ms
12,944 KB
testcase_07 AC 65 ms
12,932 KB
testcase_08 AC 61 ms
12,948 KB
testcase_09 AC 60 ms
12,936 KB
testcase_10 AC 55 ms
12,932 KB
testcase_11 AC 55 ms
12,932 KB
testcase_12 AC 57 ms
12,928 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)*(bmodpow{$i+0}$s,1e9+7);
				$r%=1e9+7;
			}
		}

		$s=$t if $s>$t;
		for(@$l){
			if(!$u[$_]++){
				push@a,[$_,$s];
			}
		}
	}
}
print$r;
0