結果

問題 No.829 成長関数インフレ中
ユーザー suzu2424__suzu2424__
提出日時 2019-05-11 16:09:55
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 583 bytes
コンパイル時間 103 ms
コンパイル使用メモリ 10,708 KB
実行使用メモリ 816,352 KB
最終ジャッジ日時 2023-09-14 18:12:01
合計ジャッジ時間 4,655 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,276 KB
testcase_01 AC 257 ms
50,908 KB
testcase_02 AC 16 ms
8,196 KB
testcase_03 AC 16 ms
8,132 KB
testcase_04 AC 43 ms
13,040 KB
testcase_05 AC 16 ms
8,196 KB
testcase_06 AC 278 ms
50,944 KB
testcase_07 AC 16 ms
8,264 KB
testcase_08 AC 16 ms
8,068 KB
testcase_09 AC 16 ms
8,276 KB
testcase_10 AC 16 ms
8,268 KB
testcase_11 AC 16 ms
8,256 KB
testcase_12 MLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import itertools

def main():
    n, b = map(int, input().split(' '))
    input_list = list(map(int, input().split(' ')))
    result = 0
    pattern_list = list(itertools.permutations(input_list, n))
    for a_list in pattern_list:
        max_score = -1
        count = 0
        for each in a_list:
            if max_score < each:
                max_score = each
                count += 1
        result += (count * (b ** count))
    print(result % (10 ** 9 + 7))



if __name__ == '__main__':
    import sys
    sys.exit(main())
0