結果
| 問題 |
No.118 門松列(2)
|
| ユーザー |
YamaKasa
|
| 提出日時 | 2018-07-11 00:30:33 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 614 bytes |
| コンパイル時間 | 3,640 ms |
| コンパイル使用メモリ | 74,384 KB |
| 実行使用メモリ | 61,292 KB |
| 最終ジャッジ日時 | 2024-09-14 04:54:27 |
| 合計ジャッジ時間 | 15,045 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 WA * 22 |
ソースコード
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();
int []cnt = new int[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);
}
}
YamaKasa