結果

問題 No.118 門松列(2)
ユーザー ぴろず
提出日時 2015-01-06 23:30:48
言語 Java
(openjdk 23)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 445 bytes
コンパイル時間 4,020 ms
コンパイル使用メモリ 73,860 KB
実行使用メモリ 59,444 KB
最終ジャッジ日時 2024-06-13 02:46:57
合計ジャッジ時間 14,551 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

package no118;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[100];
		for(int i=0;i<n;i++) {
			a[sc.nextInt()-1]++;
		}
		long ans = 0;
		for(int i=0;i<100;i++) {
			for(int j=i+1;j<100;j++) {
				for(int k=j+1;k<100;k++) {
					ans += a[i] * a[j] * a[k];
				}
			}
		}
		System.out.println(ans % 1000000007);
	}

}
0