QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#555596 | #8586. Party | mohamed_ioi | 0 | 9ms | 10696kb | Python3 | 196b | 2024-09-10 06:02:41 | 2024-09-10 06:02:42 |
Judging History
answer
n= int(input())
a = list(map(int, input().split(' ')))
dp = [0] * n
dp[0] = a[0]
dp[1] = max(a[1], a[0])
for i in range(2, n):
dp[i] = max(a[i] + dp[i - 2], a[i] + dp[i-1])
print(dp[n - 1])
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Dangerous Syscalls
Test #1:
score: 49
Accepted
time: 9ms
memory: 10696kb
input:
5 3 2 -1 4 5
output:
12
result:
ok single line: '12'
Test #2:
score: 0
Dangerous Syscalls
input:
1 10
output:
result:
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Skipped
Dependency #1:
0%