結果

問題 No.1682 Unfair Game
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2021-09-17 22:39:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 475 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 10,896 KB
実行使用メモリ 16,144 KB
最終ジャッジ日時 2023-09-12 08:39:53
合計ジャッジ時間 11,211 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
8,372 KB
testcase_01 AC 17 ms
8,320 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 661 ms
16,012 KB
testcase_08 WA -
testcase_09 AC 652 ms
15,748 KB
testcase_10 WA -
testcase_11 AC 537 ms
14,324 KB
testcase_12 AC 667 ms
16,024 KB
testcase_13 WA -
testcase_14 AC 18 ms
8,228 KB
testcase_15 AC 17 ms
8,336 KB
testcase_16 AC 17 ms
8,200 KB
testcase_17 AC 25 ms
8,348 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 670 ms
15,936 KB
testcase_21 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 10**9 + 7
N = int(input())
p = list(map(int,input().split()))
p = [i - 50 for i in p]
dp = [[0]*10002 for _ in range(N)]

def f(x):
    if x>= 0:
        return x
    else:
        return 10002+x
dp[0][f(p[0])] = 1
for i in range(N):
    dp[i][0] = 1

for i in range(N-1):
    a = p[i+1]
    for j in range(-4950,5001):
        dp[i+1][f(j)] += dp[i][f(j - a)]
        dp[i+1][f(j)] %= mod
ans = 0
for i in range(1,5001):
    ans += dp[N-1][i]
    ans %= mod
print(ans)
0