結果
| 問題 | No.118 門松列(2) |
| コンテスト | |
| ユーザー |
はむ吉🐹
|
| 提出日時 | 2016-03-01 18:36:31 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 56 ms / 5,000 ms |
| + 168µs | |
| コード長 | 499 bytes |
| 記録 | |
| コンパイル時間 | 60 ms |
| コンパイル使用メモリ | 15,104 KB |
| 実行使用メモリ | 16,728 KB |
| 最終ジャッジ日時 | 2026-09-12 11:20:00 |
| 合計ジャッジ時間 | 2,768 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 26 |
ソースコード
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import collections
import itertools
MODULUS = 10 ** 9 + 7
def main():
_ = input()
counter = collections.Counter(map(int, input().split()))
num_distinct_heights = len(counter)
answer = 0
if num_distinct_heights >= 3:
for key1, key2, key3 in itertools.combinations(counter.keys(), 3):
answer += counter[key1] * counter[key2] * counter[key3]
print(answer % MODULUS)
if __name__ == '__main__':
main()
はむ吉🐹