結果

問題 No.118 門松列(2)
ユーザー kenkooookenkoooo
提出日時 2015-04-07 01:05:47
言語 Java21
(openjdk 21)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 619 bytes
コンパイル時間 2,052 ms
コンパイル使用メモリ 71,924 KB
実行使用メモリ 62,400 KB
最終ジャッジ日時 2023-09-17 06:22:17
合計ジャッジ時間 12,324 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 496 ms
60,548 KB
testcase_02 AC 460 ms
60,388 KB
testcase_03 AC 501 ms
60,588 KB
testcase_04 AC 482 ms
60,344 KB
testcase_05 AC 473 ms
60,420 KB
testcase_06 AC 134 ms
55,812 KB
testcase_07 AC 138 ms
55,924 KB
testcase_08 AC 136 ms
56,292 KB
testcase_09 AC 468 ms
60,556 KB
testcase_10 AC 294 ms
59,984 KB
testcase_11 AC 311 ms
62,400 KB
testcase_12 AC 264 ms
60,356 KB
testcase_13 AC 240 ms
59,544 KB
testcase_14 AC 456 ms
60,624 KB
testcase_15 AC 202 ms
58,556 KB
testcase_16 AC 404 ms
60,148 KB
testcase_17 AC 234 ms
59,736 KB
testcase_18 AC 314 ms
60,312 KB
testcase_19 AC 396 ms
59,944 KB
testcase_20 AC 369 ms
60,628 KB
testcase_21 AC 457 ms
60,436 KB
testcase_22 AC 300 ms
60,252 KB
testcase_23 AC 416 ms
60,272 KB
testcase_24 AC 319 ms
60,560 KB
testcase_25 AC 383 ms
60,396 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main {
	private static final int MOD = 1000000007;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] kado_kinds = new int[101];

		for (int i = 0; i < N; i++) {
			int length = sc.nextInt();
			kado_kinds[length]++;
		}
		sc.close();

		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++) {
					int kake = kado_kinds[i] * kado_kinds[j] * kado_kinds[k];
					ans = ans + kake;
					ans = ans % MOD;
				}
			}
		}
		System.out.println(ans);

	}
}
0