結果

問題 No.1325 Subsequence Score
ユーザー jensen
提出日時 2021-01-03 22:10:20
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 398 bytes
コンパイル時間 177 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 66,016 KB
最終ジャッジ日時 2024-10-13 15:59:34
合計ジャッジ時間 5,334 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2 TLE * 1
other -- * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import combinations
n=int(input())
a=list(map(int,input().split()))
point=0

def score(l):
    score=0
    for i in range(len(l)):
        score+=l[i]*(i+1)
    return score

for i in range(1,n+1):
    m=list(combinations(range(n),i))
    for j in m:
        p=[]
        for k in range(len(j)):
            p.append(a[j[k]])   
        point+=score(p)
print(point%998244353)
print()
0