結果

問題 No.2625 Bouns Ai
ユーザー ああいいああいい
提出日時 2024-02-12 11:38:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 693 ms / 2,000 ms
コード長 500 bytes
コンパイル時間 233 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 251,564 KB
最終ジャッジ日時 2024-02-12 11:38:16
合計ジャッジ時間 14,373 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
62,124 KB
testcase_01 AC 40 ms
60,304 KB
testcase_02 AC 76 ms
77,436 KB
testcase_03 AC 494 ms
245,148 KB
testcase_04 AC 510 ms
247,428 KB
testcase_05 AC 438 ms
247,316 KB
testcase_06 AC 469 ms
247,384 KB
testcase_07 AC 443 ms
247,316 KB
testcase_08 AC 444 ms
247,316 KB
testcase_09 AC 459 ms
245,276 KB
testcase_10 AC 540 ms
247,428 KB
testcase_11 AC 53 ms
65,920 KB
testcase_12 AC 660 ms
247,428 KB
testcase_13 AC 590 ms
249,452 KB
testcase_14 AC 618 ms
249,484 KB
testcase_15 AC 603 ms
249,516 KB
testcase_16 AC 617 ms
249,424 KB
testcase_17 AC 607 ms
249,452 KB
testcase_18 AC 657 ms
249,484 KB
testcase_19 AC 630 ms
249,424 KB
testcase_20 AC 673 ms
249,488 KB
testcase_21 AC 616 ms
249,456 KB
testcase_22 AC 662 ms
251,564 KB
testcase_23 AC 635 ms
249,416 KB
testcase_24 AC 693 ms
251,532 KB
testcase_25 AC 636 ms
249,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

P = 998244353
C = 10 ** 5 + 1
dp = [0] * C
for i in range(A[0],C):
    dp[i] = 1
for i in range(1,N):
    a = A[i]
    bef = A[i-1]
    nx = [0] * C
    S = [0] * C
    S[0] = dp[0]
    for j in range(1,C):
        S[j] = S[j-1] + dp[j]
        S[j] %= P
    for j in range(a,C):
        b = j - a
        v = min(bef + b,j)
        if v < bef:continue
        else:
            t = S[v]
            nx[j] = t
    dp = nx
S = sum(dp)
print(S % P)
0