結果

問題 No.389 ロジックパズルの組み合わせ
ユーザー tjaketjake
提出日時 2016-07-08 22:47:01
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 348 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 45,664 KB
最終ジャッジ日時 2024-04-21 07:27:55
合計ジャッジ時間 13,360 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
6,272 KB
testcase_01 AC 11 ms
6,272 KB
testcase_02 AC 11 ms
6,400 KB
testcase_03 WA -
testcase_04 AC 182 ms
32,128 KB
testcase_05 AC 11 ms
6,400 KB
testcase_06 AC 11 ms
6,400 KB
testcase_07 AC 11 ms
6,400 KB
testcase_08 AC 10 ms
6,400 KB
testcase_09 AC 227 ms
37,824 KB
testcase_10 AC 51 ms
11,256 KB
testcase_11 AC 240 ms
38,400 KB
testcase_12 AC 35 ms
8,928 KB
testcase_13 AC 321 ms
45,324 KB
testcase_14 AC 62 ms
11,988 KB
testcase_15 AC 48 ms
11,648 KB
testcase_16 AC 106 ms
20,096 KB
testcase_17 AC 168 ms
28,308 KB
testcase_18 AC 276 ms
33,536 KB
testcase_19 AC 12 ms
6,272 KB
testcase_20 AC 10 ms
6,400 KB
testcase_21 AC 11 ms
6,400 KB
testcase_22 AC 10 ms
6,272 KB
testcase_23 AC 10 ms
6,400 KB
testcase_24 AC 9 ms
6,400 KB
testcase_25 AC 10 ms
6,272 KB
testcase_26 AC 10 ms
6,400 KB
testcase_27 AC 10 ms
6,400 KB
testcase_28 AC 10 ms
6,272 KB
testcase_29 AC 10 ms
6,272 KB
testcase_30 AC 10 ms
6,400 KB
testcase_31 AC 9 ms
6,272 KB
testcase_32 AC 9 ms
6,400 KB
testcase_33 AC 10 ms
6,272 KB
testcase_34 AC 10 ms
6,272 KB
testcase_35 AC 10 ms
6,400 KB
testcase_36 AC 10 ms
6,272 KB
testcase_37 AC 9 ms
6,272 KB
testcase_38 AC 10 ms
6,400 KB
testcase_39 AC 10 ms
6,400 KB
testcase_40 AC 10 ms
6,400 KB
testcase_41 AC 11 ms
6,400 KB
testcase_42 AC 11 ms
6,400 KB
testcase_43 AC 10 ms
6,400 KB
testcase_44 AC 10 ms
6,400 KB
testcase_45 AC 10 ms
6,272 KB
testcase_46 AC 10 ms
6,400 KB
testcase_47 AC 9 ms
6,144 KB
testcase_48 AC 9 ms
6,272 KB
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
testcase_58 WA -
testcase_59 WA -
testcase_60 WA -
testcase_61 WA -
testcase_62 WA -
testcase_63 WA -
testcase_64 WA -
testcase_65 WA -
testcase_66 WA -
testcase_67 WA -
testcase_68 WA -
testcase_69 AC 196 ms
33,536 KB
testcase_70 AC 138 ms
25,728 KB
testcase_71 AC 85 ms
17,800 KB
testcase_72 AC 238 ms
39,108 KB
testcase_73 AC 98 ms
19,456 KB
testcase_74 AC 88 ms
18,560 KB
testcase_75 AC 93 ms
18,684 KB
testcase_76 AC 144 ms
25,216 KB
testcase_77 AC 132 ms
25,144 KB
testcase_78 AC 54 ms
13,312 KB
testcase_79 AC 78 ms
16,640 KB
testcase_80 AC 53 ms
12,544 KB
testcase_81 AC 22 ms
8,064 KB
testcase_82 AC 214 ms
37,120 KB
testcase_83 AC 100 ms
20,992 KB
testcase_84 AC 59 ms
13,568 KB
testcase_85 AC 243 ms
41,216 KB
testcase_86 AC 221 ms
37,504 KB
testcase_87 AC 26 ms
9,088 KB
testcase_88 AC 12 ms
6,656 KB
testcase_89 AC 158 ms
24,044 KB
testcase_90 AC 331 ms
45,664 KB
testcase_91 AC 306 ms
36,428 KB
testcase_92 AC 70 ms
13,832 KB
testcase_93 AC 244 ms
33,564 KB
testcase_94 AC 184 ms
31,616 KB
testcase_95 AC 200 ms
25,700 KB
testcase_96 AC 321 ms
44,784 KB
testcase_97 AC 280 ms
39,224 KB
testcase_98 AC 254 ms
38,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 10**9 + 7
m = input()
H = map(int, raw_input().split())
if H[0] == 0:
    print 1
else:
    cnt = m - (sum(H) + len(H)-1) + len(H)
    ans = 1
    fact = [1]*(m+1)
    rev = [1]*(m+1)
    for i in xrange(1, m+1):
        fact[i] = (fact[i-1]*i) % MOD
    print (fact[cnt]*pow(fact[len(H)], MOD-2, MOD)*pow(fact[cnt-len(H)], MOD-2, MOD)) % MOD
0