結果

問題 No.1546 [Cherry 2nd Tune D] 思ったよりも易しくない
ユーザー roarisroaris
提出日時 2021-06-11 22:55:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,583 ms / 2,000 ms
コード長 390 bytes
コンパイル時間 458 ms
コンパイル使用メモリ 86,896 KB
実行使用メモリ 98,924 KB
最終ジャッジ日時 2023-08-21 13:44:28
合計ジャッジ時間 52,491 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,248 KB
testcase_01 AC 74 ms
71,128 KB
testcase_02 AC 74 ms
71,148 KB
testcase_03 AC 76 ms
71,096 KB
testcase_04 AC 75 ms
71,348 KB
testcase_05 AC 75 ms
71,136 KB
testcase_06 AC 74 ms
71,088 KB
testcase_07 AC 72 ms
71,472 KB
testcase_08 AC 71 ms
71,280 KB
testcase_09 AC 70 ms
71,320 KB
testcase_10 AC 70 ms
71,244 KB
testcase_11 AC 68 ms
71,412 KB
testcase_12 AC 71 ms
71,412 KB
testcase_13 AC 619 ms
82,544 KB
testcase_14 AC 1,398 ms
93,796 KB
testcase_15 AC 762 ms
84,084 KB
testcase_16 AC 745 ms
84,472 KB
testcase_17 AC 585 ms
82,276 KB
testcase_18 AC 1,026 ms
88,088 KB
testcase_19 AC 950 ms
86,968 KB
testcase_20 AC 1,157 ms
90,148 KB
testcase_21 AC 122 ms
77,564 KB
testcase_22 AC 1,041 ms
88,268 KB
testcase_23 AC 864 ms
85,428 KB
testcase_24 AC 234 ms
78,820 KB
testcase_25 AC 1,434 ms
93,936 KB
testcase_26 AC 1,516 ms
97,068 KB
testcase_27 AC 762 ms
84,032 KB
testcase_28 AC 1,527 ms
96,952 KB
testcase_29 AC 1,526 ms
96,992 KB
testcase_30 AC 1,496 ms
96,992 KB
testcase_31 AC 1,519 ms
97,112 KB
testcase_32 AC 1,583 ms
97,124 KB
testcase_33 AC 1,535 ms
96,888 KB
testcase_34 AC 1,532 ms
96,968 KB
testcase_35 AC 1,523 ms
97,108 KB
testcase_36 AC 1,514 ms
97,220 KB
testcase_37 AC 1,523 ms
97,292 KB
testcase_38 AC 1,534 ms
97,000 KB
testcase_39 AC 1,523 ms
96,968 KB
testcase_40 AC 1,513 ms
97,016 KB
testcase_41 AC 1,515 ms
97,204 KB
testcase_42 AC 1,529 ms
97,032 KB
testcase_43 AC 1,489 ms
97,980 KB
testcase_44 AC 1,476 ms
98,168 KB
testcase_45 AC 1,449 ms
98,160 KB
testcase_46 AC 1,445 ms
97,436 KB
testcase_47 AC 1,457 ms
97,856 KB
testcase_48 AC 1,560 ms
98,924 KB
testcase_49 AC 1,511 ms
96,848 KB
testcase_50 AC 69 ms
71,260 KB
testcase_51 AC 69 ms
71,228 KB
testcase_52 AC 69 ms
71,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

def f(a, b):
    return (3*a**4-2*a**3*(2*S+3)-3*a**2+a*(4*S+6)-b*(b**2+3*b+2)*(3*b-4*S-3))//24

N = int(input())
S = 0
TV = []

for _ in range(N):
    T, V = map(int, input().split())
    S += T
    TV.append((T, V))

ans = 0
acc = 1
MOD = 998244353

for T, V in TV:
    ans += f(acc, acc+T-1)*V
    ans %= MOD
    acc += T
    acc %= MOD

print(ans)
0