結果

問題 No.2625 Bouns Ai
ユーザー 👑 rin204rin204
提出日時 2024-02-10 00:41:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 424 ms / 2,000 ms
コード長 350 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 236,616 KB
最終ジャッジ日時 2024-02-10 00:41:26
合計ジャッジ時間 10,047 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
63,536 KB
testcase_01 AC 39 ms
61,876 KB
testcase_02 AC 56 ms
74,544 KB
testcase_03 AC 423 ms
234,116 KB
testcase_04 AC 370 ms
233,988 KB
testcase_05 AC 398 ms
234,116 KB
testcase_06 AC 424 ms
236,140 KB
testcase_07 AC 408 ms
234,116 KB
testcase_08 AC 411 ms
236,140 KB
testcase_09 AC 417 ms
236,108 KB
testcase_10 AC 402 ms
234,116 KB
testcase_11 AC 48 ms
68,032 KB
testcase_12 AC 372 ms
236,096 KB
testcase_13 AC 364 ms
236,528 KB
testcase_14 AC 404 ms
235,984 KB
testcase_15 AC 380 ms
235,960 KB
testcase_16 AC 366 ms
235,976 KB
testcase_17 AC 377 ms
235,992 KB
testcase_18 AC 373 ms
235,936 KB
testcase_19 AC 375 ms
236,020 KB
testcase_20 AC 379 ms
236,028 KB
testcase_21 AC 420 ms
235,984 KB
testcase_22 AC 382 ms
236,452 KB
testcase_23 AC 382 ms
236,524 KB
testcase_24 AC 401 ms
236,400 KB
testcase_25 AC 375 ms
236,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 998244353

M = 10**5
n = int(input())
A = list(map(int, input().split()))

dp = [0] * (M + 1)
dp[0] = 1
b = 0
for a in A:
    for i in range(M):
        dp[i + 1] = (dp[i] + dp[i + 1]) % MOD
    add = max(0, b - a)
    dp = [0] * add + dp[: M + 1 - add]
    for i in range(M - a + 1, M + 1):
        dp[i] = 0

    b = a


print(sum(dp) % MOD)
0