結果

問題 No.118 門松列(2)
ユーザー pluto77pluto77
提出日時 2016-03-04 18:51:45
言語 PyPy2
(7.3.15)
結果
WA  
実行時間 -
コード長 387 bytes
コンパイル時間 324 ms
コンパイル使用メモリ 77,444 KB
実行使用メモリ 85,788 KB
最終ジャッジ日時 2023-10-24 19:49:35
合計ジャッジ時間 3,631 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
77,144 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 67 ms
75,916 KB
testcase_07 AC 66 ms
75,916 KB
testcase_08 AC 66 ms
75,916 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
#yuki_118

def fact(n):
 if n == 0:
  return 1
 elif n>0:
  return n*fact(n-1)

def r_outof_n(r,n):
 return fact(n)/(fact(r)*fact(n-r))

n=int(raw_input())
list=map(int,raw_input().split())
t=[(x, list.count(x)) for x in set(list)]
lt=len(t)

mul=1
for i in xrange(len(t)):
 mul=(mul*t[i][1])%(10**9+7)
rofn=r_outof_n(3,lt)
rofn=rofn%(10**9+7)
print (mul*rofn)%(10**9+7)
0