結果
| 問題 |
No.118 門松列(2)
|
| ユーザー |
kuuso1
|
| 提出日時 | 2015-01-06 23:44:37 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,137 bytes |
| コンパイル時間 | 943 ms |
| コンパイル使用メモリ | 106,880 KB |
| 実行使用メモリ | 24,192 KB |
| 最終ジャッジ日時 | 2024-06-13 02:48:32 |
| 合計ジャッジ時間 | 2,784 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 WA * 3 RE * 19 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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));}
}
kuuso1