結果

問題 No.118 門松列(2)
ユーザー 👑 colognecologne
提出日時 2022-02-03 02:01:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 94 ms / 5,000 ms
コード長 409 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 87,228 KB
実行使用メモリ 91,728 KB
最終ジャッジ日時 2023-09-02 03:03:50
合計ジャッジ時間 4,009 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
76,132 KB
testcase_01 AC 92 ms
91,728 KB
testcase_02 AC 90 ms
91,508 KB
testcase_03 AC 94 ms
91,276 KB
testcase_04 AC 93 ms
91,408 KB
testcase_05 AC 92 ms
91,644 KB
testcase_06 AC 65 ms
71,504 KB
testcase_07 AC 69 ms
71,464 KB
testcase_08 AC 72 ms
75,992 KB
testcase_09 AC 90 ms
89,760 KB
testcase_10 AC 76 ms
77,656 KB
testcase_11 AC 78 ms
78,912 KB
testcase_12 AC 75 ms
76,212 KB
testcase_13 AC 75 ms
76,492 KB
testcase_14 AC 90 ms
89,712 KB
testcase_15 AC 76 ms
76,548 KB
testcase_16 AC 81 ms
83,008 KB
testcase_17 AC 73 ms
76,436 KB
testcase_18 AC 75 ms
78,968 KB
testcase_19 AC 81 ms
81,316 KB
testcase_20 AC 81 ms
82,396 KB
testcase_21 AC 88 ms
87,984 KB
testcase_22 AC 76 ms
77,904 KB
testcase_23 AC 85 ms
86,336 KB
testcase_24 AC 80 ms
79,552 KB
testcase_25 AC 80 ms
81,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys


def input(): return sys.stdin.readline().rstrip()


def main():
    int(input())  # N
    *A, = map(int, input().split())
    cnt = [0]*(max(A)+1)
    for i in A:
        cnt[i] += 1

    ans = 0
    for i in range(len(cnt)):
        for j in range(i):
            for k in range(j):
                ans += cnt[i]*cnt[j]*cnt[k]

    print(ans % (10**9+7))


if __name__ == '__main__':
    main()
0