結果

問題 No.118 門松列(2)
ユーザー tanimani364
提出日時 2021-03-24 15:17:58
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 456 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 82,544 KB
実行使用メモリ 87,284 KB
最終ジャッジ日時 2024-11-26 23:09:45
合計ジャッジ時間 2,882 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4 WA * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
#coding:utf-8

import math
import string
from sys import stdin
# import numpy as np
# from matplotlib import pyplot as plt

	
def main():
	read=stdin.readline

	#edit here!
	m=1000000000+7
	n=int(read())
	a=list(map(int,read().split()))
	mp=dict()
	for i in a:
		mp[i]=0
	for i in a:
		mp[i]+=1

	num=len(mp)
	ans=num*(num-1)*(num-2)//6
	ans%=m
	for i in mp.values():
		ans*=i
		ans%=m
	print(ans)
if __name__ == '__main__':
	main()
0