結果

問題 No.118 門松列(2)
ユーザー c-yanc-yan
提出日時 2021-04-01 23:36:24
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 120 ms / 5,000 ms
コード長 317 bytes
コンパイル時間 72 ms
コンパイル使用メモリ 10,664 KB
実行使用メモリ 15,916 KB
最終ジャッジ日時 2023-08-23 06:53:02
合計ジャッジ時間 3,477 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
8,508 KB
testcase_01 AC 120 ms
15,916 KB
testcase_02 AC 112 ms
15,436 KB
testcase_03 AC 118 ms
15,732 KB
testcase_04 AC 114 ms
15,720 KB
testcase_05 AC 116 ms
15,712 KB
testcase_06 AC 18 ms
8,544 KB
testcase_07 AC 18 ms
8,476 KB
testcase_08 AC 18 ms
8,428 KB
testcase_09 AC 113 ms
15,408 KB
testcase_10 AC 87 ms
9,824 KB
testcase_11 AC 93 ms
10,348 KB
testcase_12 AC 89 ms
9,552 KB
testcase_13 AC 85 ms
8,972 KB
testcase_14 AC 116 ms
15,296 KB
testcase_15 AC 90 ms
8,740 KB
testcase_16 AC 97 ms
12,236 KB
testcase_17 AC 86 ms
8,888 KB
testcase_18 AC 92 ms
10,304 KB
testcase_19 AC 101 ms
11,792 KB
testcase_20 AC 95 ms
11,872 KB
testcase_21 AC 107 ms
14,016 KB
testcase_22 AC 92 ms
9,984 KB
testcase_23 AC 110 ms
13,600 KB
testcase_24 AC 87 ms
10,700 KB
testcase_25 AC 97 ms
11,536 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter

m = 1000000007

N, *A = map(int, open(0).read().split())

d = list(Counter(A).values())
result = 0
for i in range(len(d) - 2):
    for j in range(i + 1, len(d) - 1):
        for k in range(j + 1, len(d)):
            result += d[i] * d[j] * d[k]
            result %= m
print(result)
0