結果

問題 No.1325 Subsequence Score
ユーザー BQZetBQZet
提出日時 2020-12-23 03:29:26
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 639 bytes
コンパイル時間 214 ms
コンパイル使用メモリ 11,880 KB
実行使用メモリ 823,868 KB
最終ジャッジ日時 2023-10-21 15:02:05
合計ジャッジ時間 5,013 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 MLE -
testcase_01 AC 24 ms
10,236 KB
testcase_02 AC 1,432 ms
147,672 KB
testcase_03 MLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import combinations


def combination_index(N):
    N_combi = []
    N_list = list(range(N))
    for i in range(1, N+1):
        N_combi_temp = list(combinations(N_list, i))
        for j in N_combi_temp:
            N_combi.append(j)
    
    return N_combi

def sum_calc(N_combi, a):
    sum = 0
    for i in N_combi:
        line_sum = 0
        for num, j in enumerate(i):
            line_sum += a[j] * (num + 1)
        sum += line_sum
    print(sum % 998244353)



if __name__ == "__main__":
    N = int(input())
    a = list(map(int, input().split()))
    
    N_combi = combination_index(N)
    sum_calc(N_combi, a)
0