結果

問題 No.118 門松列(2)
ユーザー kuuso1
提出日時 2015-01-07 00:15:39
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 56 ms / 5,000 ms
コード長 1,179 bytes
コンパイル時間 2,030 ms
コンパイル使用メモリ 112,032 KB
実行使用メモリ 30,972 KB
最終ジャッジ日時 2024-10-09 06:49:58
合計ジャッジ時間 3,973 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 26
権限があれば一括ダウンロードができます
コンパイルメッセージ
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[101];
		for(int i=0;i<N;i++)D[A[i]]++;
		long cnt=0;
		for(int i=0;i<101;i++){
			if(D[i]!=0)cnt++;
		}
		
		long ans=0;
		long mod=(long)(1e9+7);
		for(int i=0;i<101;i++){
			for(int j=i+1;j<101;j++){
				for(int k=j+1;k<101;k++){
					ans+=D[i]*D[j]*D[k];
					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