結果

問題 No.329 全射
ユーザー TawaraTawara
提出日時 2015-12-26 05:10:26
言語 PyPy2
(7.3.13)
結果
AC  
実行時間 286 ms / 2,000 ms
コード長 449 bytes
コンパイル時間 679 ms
コンパイル使用メモリ 78,060 KB
実行使用メモリ 88,708 KB
最終ジャッジ日時 2023-08-25 02:37:38
合計ジャッジ時間 9,052 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
76,396 KB
testcase_01 AC 69 ms
76,488 KB
testcase_02 AC 71 ms
76,404 KB
testcase_03 AC 72 ms
76,528 KB
testcase_04 AC 72 ms
76,584 KB
testcase_05 AC 72 ms
76,404 KB
testcase_06 AC 73 ms
76,400 KB
testcase_07 AC 72 ms
76,396 KB
testcase_08 AC 73 ms
76,820 KB
testcase_09 AC 73 ms
76,628 KB
testcase_10 AC 74 ms
76,404 KB
testcase_11 AC 72 ms
76,368 KB
testcase_12 AC 72 ms
76,496 KB
testcase_13 AC 268 ms
88,356 KB
testcase_14 AC 195 ms
88,292 KB
testcase_15 AC 199 ms
88,160 KB
testcase_16 AC 191 ms
88,052 KB
testcase_17 AC 233 ms
88,552 KB
testcase_18 AC 248 ms
88,656 KB
testcase_19 AC 283 ms
88,480 KB
testcase_20 AC 230 ms
88,296 KB
testcase_21 AC 211 ms
88,448 KB
testcase_22 AC 286 ms
88,708 KB
testcase_23 AC 143 ms
87,336 KB
testcase_24 AC 146 ms
87,516 KB
testcase_25 AC 178 ms
87,720 KB
testcase_26 AC 152 ms
87,580 KB
testcase_27 AC 125 ms
87,804 KB
testcase_28 AC 88 ms
80,264 KB
testcase_29 AC 110 ms
80,516 KB
testcase_30 AC 98 ms
80,592 KB
testcase_31 AC 78 ms
80,068 KB
testcase_32 AC 127 ms
86,612 KB
testcase_33 AC 155 ms
80,256 KB
testcase_34 AC 141 ms
80,200 KB
testcase_35 AC 165 ms
80,264 KB
testcase_36 AC 154 ms
80,256 KB
testcase_37 AC 136 ms
80,288 KB
testcase_38 AC 145 ms
80,276 KB
testcase_39 AC 146 ms
80,532 KB
testcase_40 AC 164 ms
80,348 KB
testcase_41 AC 139 ms
80,424 KB
testcase_42 AC 164 ms
80,092 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

I=lambda:map(int,raw_input().split());R=xrange;p=10**9+7 
N,M=I();w=I();W=max(w)+1;E=[N*[0]for i in R(N)]
D=[W*[0]for i in R(W)];D[0][0]=1
for i in R(1,W):
	for j in R(i+1):D[i][j]=j*(D[i-1][j]+D[i-1][j-1])%p
for i in R(N):E[i][i]=w[i]
for t in R(M):i,j=I();E[i-1][j-1]=w[i-1]
for k in R(N):
	for i in R(N):
		for j in R(N):E[i][j]=max(E[i][j],min(E[i][k],E[k][j]))
A=0
for i in R(N):
	for j in R(N):
		if w[j]<=E[i][j]:A=(A+D[w[i]][w[j]])%p
print A
0