結果
問題 |
No.118 門松列(2)
|
ユーザー |
![]() |
提出日時 | 2015-04-07 00:35:32 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 705 bytes |
コンパイル時間 | 2,121 ms |
コンパイル使用メモリ | 74,188 KB |
実行使用メモリ | 59,664 KB |
最終ジャッジ日時 | 2024-07-04 03:29:24 |
合計ジャッジ時間 | 13,753 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 WA * 23 |
ソースコード
import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner koko = new Scanner(System.in); int n = koko.nextInt(); int[] a = new int[n]; for(int i = 0; i<n; i++){ a[i] = koko.nextInt(); } Arrays.sort(a); int kind = 1; int same = 1; int kake = 1; for(int i = 1; i<n; i++){ if(a[i]==a[i-1]){ same = same + 1; }else{ kind = kind + 1; kake = kake*same; same = 1; } } long kado = (kake*same*kind*(kind-1)*(kind-2)/6)%1000000007; System.out.println(kado); } }