結果

問題 No.118 門松列(2)
ユーザー YamaKasa
提出日時 2018-07-11 00:32:01
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 616 bytes
コンパイル時間 2,134 ms
コンパイル使用メモリ 75,072 KB
実行使用メモリ 48,244 KB
最終ジャッジ日時 2024-09-14 04:56:40
合計ジャッジ時間 13,437 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5 WA * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		long []cnt = new long[101];
		Arrays.fill(cnt, 0);
		for(int i = 0; i < N; i++) {
			cnt[scan.nextInt()]++;
		}
		scan.close();

		long d = 1000000007;
		long ans = 0;
		for(int i = 1; i <= 100; i++) {
			for(int j = i + 1; j <= 100; j++) {
				for(int k = j + 1; k <= 100; k++) {
					if(cnt[i] != 0 && cnt[j] != 0 && cnt[k] != 0) {
						ans += (cnt[i] * cnt[j] * cnt[k]) % d;
					}
				}
			}
		}
		System.out.println(ans);

	}
}
0