結果

問題 No.118 門松列(2)
ユーザー もちふわゆるゆるもちふわゆるゆる
提出日時 2023-09-10 01:42:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 123 ms / 5,000 ms
コード長 415 bytes
コンパイル時間 373 ms
コンパイル使用メモリ 87,256 KB
実行使用メモリ 90,332 KB
最終ジャッジ日時 2023-09-10 01:42:48
合計ジャッジ時間 5,225 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
78,184 KB
testcase_01 AC 122 ms
90,304 KB
testcase_02 AC 123 ms
90,284 KB
testcase_03 AC 122 ms
90,020 KB
testcase_04 AC 122 ms
90,316 KB
testcase_05 AC 121 ms
90,332 KB
testcase_06 AC 104 ms
77,488 KB
testcase_07 AC 104 ms
77,564 KB
testcase_08 AC 105 ms
77,312 KB
testcase_09 AC 118 ms
88,772 KB
testcase_10 AC 108 ms
78,776 KB
testcase_11 AC 111 ms
79,636 KB
testcase_12 AC 109 ms
77,892 KB
testcase_13 AC 107 ms
78,092 KB
testcase_14 AC 122 ms
88,844 KB
testcase_15 AC 108 ms
77,768 KB
testcase_16 AC 114 ms
83,180 KB
testcase_17 AC 106 ms
78,160 KB
testcase_18 AC 109 ms
79,780 KB
testcase_19 AC 115 ms
82,280 KB
testcase_20 AC 113 ms
82,832 KB
testcase_21 AC 119 ms
87,264 KB
testcase_22 AC 110 ms
78,952 KB
testcase_23 AC 116 ms
85,932 KB
testcase_24 AC 111 ms
80,416 KB
testcase_25 AC 114 ms
82,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, math
input = lambda: sys.stdin.readline()[:-1]
def MI(): return map(int, input().split())
inf = 10**18
mod = 10**9+7
from collections import *

n = int(input())
a = list(MI())

cnt = [0] * 101
for i in a:
    cnt[i] += 1

ans = 0
for b1 in range(1, 101):
    for b2 in range(b1+1, 101):
        for b3 in range(b2+1, 101):
            ans += cnt[b1] * cnt[b2] * cnt[b3]
            ans %= mod
print(ans)
0