結果

問題 No.118 門松列(2)
ユーザー kuuso1kuuso1
提出日時 2015-01-06 23:44:37
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 1,137 bytes
コンパイル時間 2,390 ms
コンパイル使用メモリ 107,912 KB
実行使用メモリ 26,624 KB
最終ジャッジ日時 2023-09-03 22:10:03
合計ジャッジ時間 5,585 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
21,168 KB
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 AC 57 ms
20,708 KB
testcase_07 AC 57 ms
22,752 KB
testcase_08 AC 56 ms
20,656 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 WA -
testcase_14 RE -
testcase_15 WA -
testcase_16 RE -
testcase_17 WA -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections;
using System.Collections.Generic;
 
class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		long[] D=new long[10001];
		for(int i=0;i<N;i++)D[A[i]]++;
		long cnt=0;
		for(int i=0;i<10001;i++){
			if(D[i]!=0)cnt++;
		}
		
		long mod=(long)(1e9+7);
		long ans=(cnt*(cnt-1)*(cnt-2)/6)%mod;
		for(int i=0;i<N;i++){
			if(D[i]!=0){
				ans*=D[i];
				ans%=mod;
			}
		}
		Console.WriteLine(ans);
		
		
	} 
	int N;
	int[] A;
	public Sol(){
		N=ri();
		A=ria();
	}


	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(){return Console.ReadLine().Split(' ');}
	static int[] ria(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>int.Parse(e));}
	static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));}
	static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));}
}
0