結果

問題 No.1325 Subsequence Score
ユーザー chineristACchineristAC
提出日時 2020-12-22 13:03:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 730 bytes
コンパイル時間 484 ms
コンパイル使用メモリ 81,816 KB
実行使用メモリ 174,844 KB
最終ジャッジ日時 2023-10-21 12:53:05
合計ジャッジ時間 6,555 ms
ジャッジサーバーID
(参考情報)
judge15 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,288 KB
testcase_01 AC 75 ms
71,288 KB
testcase_02 AC 74 ms
71,288 KB
testcase_03 AC 84 ms
73,968 KB
testcase_04 AC 77 ms
71,288 KB
testcase_05 AC 80 ms
73,968 KB
testcase_06 AC 76 ms
71,288 KB
testcase_07 AC 79 ms
73,968 KB
testcase_08 AC 77 ms
71,288 KB
testcase_09 AC 75 ms
71,288 KB
testcase_10 AC 73 ms
71,288 KB
testcase_11 AC 75 ms
71,288 KB
testcase_12 AC 76 ms
71,288 KB
testcase_13 AC 249 ms
174,136 KB
testcase_14 AC 132 ms
109,012 KB
testcase_15 AC 236 ms
164,064 KB
testcase_16 AC 247 ms
174,844 KB
testcase_17 AC 157 ms
113,336 KB
testcase_18 AC 125 ms
106,108 KB
testcase_19 AC 242 ms
173,976 KB
testcase_20 AC 104 ms
96,604 KB
testcase_21 AC 138 ms
115,188 KB
testcase_22 AC 159 ms
116,140 KB
testcase_23 AC 245 ms
174,240 KB
testcase_24 AC 242 ms
173,976 KB
testcase_25 AC 247 ms
173,976 KB
testcase_26 AC 250 ms
173,976 KB
testcase_27 AC 247 ms
173,976 KB
testcase_28 AC 72 ms
71,288 KB
testcase_29 AC 73 ms
71,288 KB
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def cmb(n, r, mod):#コンビネーションの高速計算 
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 998244353 #出力の制限
N = 5*10**5
g1 = [1]*(N+1) # 元テーブル
g2 = [1]*(N+1) #逆元テーブル
inverse = [1]*(N+1) #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1[i]=( ( g1[i-1] * i ) % mod )
    inverse[i]=( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2[i]=( (g2[i-1] * inverse[i]) % mod )
inverse[0]=0

N = int(input())
A = list(map(int,input().split()))

if N==1:
    exit(print(A[0]))

a = pow(2,N-2,mod)
b = pow(2,N-1,mod)
res = 0
for i in range(N):
    res += A[i] * i * a + A[i] * b
    res %= mod

print(res)
0