結果

問題 No.2625 Bouns Ai
ユーザー ニックネームニックネーム
提出日時 2024-02-09 22:42:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 532 ms / 2,000 ms
コード長 299 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 221,520 KB
最終ジャッジ日時 2024-02-09 22:43:09
合計ジャッジ時間 11,837 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
62,188 KB
testcase_01 AC 46 ms
61,164 KB
testcase_02 AC 69 ms
69,724 KB
testcase_03 AC 413 ms
219,364 KB
testcase_04 AC 424 ms
219,356 KB
testcase_05 AC 419 ms
219,352 KB
testcase_06 AC 385 ms
219,364 KB
testcase_07 AC 406 ms
219,356 KB
testcase_08 AC 491 ms
221,504 KB
testcase_09 AC 500 ms
219,364 KB
testcase_10 AC 403 ms
219,356 KB
testcase_11 AC 52 ms
65,004 KB
testcase_12 AC 481 ms
221,508 KB
testcase_13 AC 486 ms
221,488 KB
testcase_14 AC 524 ms
221,504 KB
testcase_15 AC 471 ms
221,500 KB
testcase_16 AC 514 ms
221,472 KB
testcase_17 AC 474 ms
221,488 KB
testcase_18 AC 469 ms
221,520 KB
testcase_19 AC 500 ms
221,472 KB
testcase_20 AC 507 ms
221,484 KB
testcase_21 AC 504 ms
221,488 KB
testcase_22 AC 515 ms
221,468 KB
testcase_23 AC 516 ms
221,488 KB
testcase_24 AC 532 ms
221,468 KB
testcase_25 AC 489 ms
221,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input()); m = 10**5; mod = 998244353
a = list(map(int,input().split()))+[0]
dp = [1]*(m+1)
for i in range(n):
    eq = [0]*(m+1)
    for j in range(m+1):
        if j>=a[i]-a[i-1]: eq[j] = dp[j-max(a[i]-a[i-1],0)]
    for j in range(m): eq[j+1] = (eq[j+1]+eq[j])%mod
    dp = eq
print(dp[m])
0