結果

問題 No.118 門松列(2)
コンテスト
ユーザー もちふわゆるゆる
提出日時 2023-09-10 01:42:42
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 44 ms / 5,000 ms
コード長 415 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 203 ms
コンパイル使用メモリ 85,248 KB
実行使用メモリ 83,072 KB
最終ジャッジ日時 2026-03-15 19:29:45
合計ジャッジ時間 2,167 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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