Submission #18299069


Source Code Expand

Copy
n = int(input())

p = list(map(int, input().split()))

dp = [ [0 for _ in range(10010)] for _ in range(n+1)]
dp[0][0]=1

for i in range(n):
  for j in range(10010):
    if j >= p[i]:
      if dp[i][j-p[i]]+dp[i][j]>= 1:
        dp[i+1][j] = 1
    else:
      dp[i+1][j] = dp[i][j]
print(sum(dp[n]))

Submission Info

Submission Time
Task A - コンテスト
User kaleido
Language PyPy3 (7.3.0)
Score 2
Code Size 314 Byte
Status AC
Exec Time 84 ms
Memory 76776 KB

Judge Result

Set Name All
Score / Max Score 2 / 2
Status
AC × 5
Set Name Test Cases
All 00, 01, 02, 90, 91
Case Name Status Exec Time Memory
00 AC 77 ms 67968 KB
01 AC 73 ms 72372 KB
02 AC 84 ms 76776 KB
90 AC 61 ms 67988 KB
91 AC 64 ms 67760 KB