結果

問題 No.1546 [Cherry 2nd Tune D] 思ったよりも易しくない
ユーザー convexineqconvexineq
提出日時 2021-06-11 23:35:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 281 ms / 2,000 ms
コード長 403 bytes
コンパイル時間 445 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 81,456 KB
最終ジャッジ日時 2024-05-08 20:04:46
合計ジャッジ時間 12,386 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,096 KB
testcase_01 AC 38 ms
52,096 KB
testcase_02 AC 39 ms
51,968 KB
testcase_03 AC 39 ms
52,224 KB
testcase_04 AC 39 ms
52,480 KB
testcase_05 AC 38 ms
51,968 KB
testcase_06 AC 37 ms
51,968 KB
testcase_07 AC 38 ms
52,096 KB
testcase_08 AC 37 ms
52,096 KB
testcase_09 AC 38 ms
51,968 KB
testcase_10 AC 39 ms
52,224 KB
testcase_11 AC 38 ms
52,096 KB
testcase_12 AC 39 ms
52,528 KB
testcase_13 AC 136 ms
78,032 KB
testcase_14 AC 229 ms
80,640 KB
testcase_15 AC 153 ms
78,720 KB
testcase_16 AC 152 ms
78,716 KB
testcase_17 AC 134 ms
78,336 KB
testcase_18 AC 187 ms
79,776 KB
testcase_19 AC 177 ms
79,172 KB
testcase_20 AC 198 ms
79,872 KB
testcase_21 AC 78 ms
76,564 KB
testcase_22 AC 180 ms
79,344 KB
testcase_23 AC 166 ms
78,748 KB
testcase_24 AC 94 ms
76,800 KB
testcase_25 AC 237 ms
81,024 KB
testcase_26 AC 245 ms
81,152 KB
testcase_27 AC 157 ms
78,720 KB
testcase_28 AC 241 ms
81,280 KB
testcase_29 AC 243 ms
81,152 KB
testcase_30 AC 238 ms
81,148 KB
testcase_31 AC 244 ms
81,280 KB
testcase_32 AC 244 ms
81,100 KB
testcase_33 AC 238 ms
81,408 KB
testcase_34 AC 242 ms
81,280 KB
testcase_35 AC 243 ms
80,896 KB
testcase_36 AC 248 ms
81,024 KB
testcase_37 AC 239 ms
81,152 KB
testcase_38 AC 238 ms
81,024 KB
testcase_39 AC 237 ms
81,408 KB
testcase_40 AC 236 ms
80,912 KB
testcase_41 AC 232 ms
81,072 KB
testcase_42 AC 235 ms
81,024 KB
testcase_43 AC 237 ms
81,232 KB
testcase_44 AC 235 ms
81,152 KB
testcase_45 AC 232 ms
81,456 KB
testcase_46 AC 231 ms
81,408 KB
testcase_47 AC 237 ms
80,972 KB
testcase_48 AC 281 ms
81,444 KB
testcase_49 AC 241 ms
80,896 KB
testcase_50 AC 39 ms
51,968 KB
testcase_51 AC 38 ms
51,840 KB
testcase_52 AC 38 ms
51,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 998244353
n = int(input())
T = [0]*n
V = [0]*n
for i in range(n):
    T[i],V[i] = map(int,input().split())
for i in range(1,n):
    T[i] += T[i-1]
    T[i] %= MOD
for i in range(n):
    T[i] -= 1

M = T[-1]+1
def f(n):
    return (n+1)*(n+2)%MOD*(n+3)%MOD*(4*M-3*n)%MOD

ans = 0
for i in range(n):
    c = f(T[i])
    if i: c -= f(T[i-1])
    ans += V[i]*c
    ans %= MOD

print(ans*291154603%MOD)
0