結果

問題 No.118 門松列(2)
ユーザー ぴろずぴろず
提出日時 2016-02-18 15:43:40
言語 Java21
(openjdk 21)
結果
AC  
実行時間 533 ms / 5,000 ms
コード長 452 bytes
コンパイル時間 5,101 ms
コンパイル使用メモリ 73,868 KB
実行使用メモリ 48,112 KB
最終ジャッジ日時 2024-04-17 13:53:11
合計ジャッジ時間 13,438 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 224 ms
45,920 KB
testcase_01 AC 533 ms
48,056 KB
testcase_02 AC 487 ms
47,972 KB
testcase_03 AC 440 ms
46,628 KB
testcase_04 AC 530 ms
48,076 KB
testcase_05 AC 521 ms
48,108 KB
testcase_06 AC 149 ms
41,592 KB
testcase_07 AC 126 ms
40,480 KB
testcase_08 AC 127 ms
41,072 KB
testcase_09 AC 527 ms
48,080 KB
testcase_10 AC 270 ms
47,664 KB
testcase_11 AC 317 ms
47,764 KB
testcase_12 AC 240 ms
47,192 KB
testcase_13 AC 233 ms
46,232 KB
testcase_14 AC 505 ms
47,960 KB
testcase_15 AC 187 ms
43,392 KB
testcase_16 AC 456 ms
48,080 KB
testcase_17 AC 233 ms
46,372 KB
testcase_18 AC 335 ms
47,960 KB
testcase_19 AC 448 ms
47,896 KB
testcase_20 AC 349 ms
46,652 KB
testcase_21 AC 398 ms
46,472 KB
testcase_22 AC 271 ms
47,244 KB
testcase_23 AC 392 ms
46,548 KB
testcase_24 AC 336 ms
47,912 KB
testcase_25 AC 398 ms
48,112 KB
権限があれば一括ダウンロードができます

ソースコード

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 += (long) a[i] * a[j] * a[k];
				}
			}
		}
		System.out.println(ans % 1000000007);
	}

}
0