結果

問題 No.118 門松列(2)
ユーザー ぴろずぴろず
提出日時 2015-01-06 23:30:48
言語 Java19
(openjdk 21)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 445 bytes
コンパイル時間 2,993 ms
コンパイル使用メモリ 70,944 KB
実行使用メモリ 62,344 KB
最終ジャッジ日時 2023-09-03 22:08:14
合計ジャッジ時間 13,369 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 505 ms
60,352 KB
testcase_02 AC 454 ms
60,376 KB
testcase_03 AC 500 ms
60,812 KB
testcase_04 AC 474 ms
60,644 KB
testcase_05 AC 479 ms
60,604 KB
testcase_06 AC 138 ms
55,656 KB
testcase_07 AC 134 ms
55,752 KB
testcase_08 AC 137 ms
55,768 KB
testcase_09 AC 495 ms
60,144 KB
testcase_10 AC 275 ms
60,076 KB
testcase_11 AC 310 ms
59,796 KB
testcase_12 AC 268 ms
60,104 KB
testcase_13 AC 234 ms
59,196 KB
testcase_14 AC 454 ms
60,488 KB
testcase_15 AC 203 ms
59,036 KB
testcase_16 AC 406 ms
60,352 KB
testcase_17 AC 233 ms
59,196 KB
testcase_18 AC 311 ms
60,336 KB
testcase_19 AC 390 ms
58,168 KB
testcase_20 AC 370 ms
62,344 KB
testcase_21 AC 464 ms
60,208 KB
testcase_22 AC 300 ms
60,048 KB
testcase_23 AC 415 ms
60,060 KB
testcase_24 AC 345 ms
60,300 KB
testcase_25 AC 381 ms
60,596 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 += a[i] * a[j] * a[k];
				}
			}
		}
		System.out.println(ans % 1000000007);
	}

}
0