結果

問題 No.118 門松列(2)
コンテスト
ユーザー pluto77
提出日時 2016-03-04 18:51:45
言語 PyPy2
(7.3.20)
コンパイル:
pypy2 -m py_compile _filename_
実行:
/usr/bin/pypy2 Main.pyc
結果
WA  
実行時間 -
コード長 387 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 871 ms
コンパイル使用メモリ 80,896 KB
実行使用メモリ 89,728 KB
最終ジャッジ日時 2026-04-11 18:11:26
合計ジャッジ時間 3,342 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4 WA * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

# 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