結果

問題 No.1325 Subsequence Score
コンテスト
ユーザー jensen
提出日時 2021-01-03 22:10:20
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 398 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 509 ms
コンパイル使用メモリ 20,824 KB
実行使用メモリ 1,311,576 KB
最終ジャッジ日時 2026-05-01 02:55:45
合計ジャッジ時間 7,461 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2 TLE * 1
other MLE * 2 -- * 26
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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