QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#318898 | #5585. Creative Accounting | Pranav624 | WA | 11ms | 10028kb | Python3 | 778b | 2024-02-01 10:04:44 | 2024-02-01 10:04:44 |
Judging History
answer
nums = input().split()
n = int(nums[0])
l = int(nums[1])
h = int(nums[2])
d = []
for i in range(n):
d.append(int(input()))
min_segments = 99999999999999999999
max_segments = 0
for i in range(l,h):
for start in range(0,l):
temp = d
segments_list = []
segments_list.append(sum(temp[0:start]))
temp = temp[start:]
while len(temp) > i:
segments_list.append(sum(temp[0:i]))
temp = temp[i:]
if len(temp) > 0:
segments_list.append(sum(temp))
profits = 0
for segment in segments_list:
if segment > 0:
profits += 1
max_segments = max(profits, max_segments)
min_segments = min(profits, min_segments)
print(min_segments, max_segments)
详细
Test #1:
score: 100
Accepted
time: 11ms
memory: 10028kb
input:
10 3 5 3 2 -7 5 4 1 3 0 -3 5
output:
2 4
result:
ok single line: '2 4'
Test #2:
score: -100
Wrong Answer
time: 9ms
memory: 10028kb
input:
1 1 1 1
output:
99999999999999999999 0
result:
wrong answer 1st lines differ - expected: '1 1', found: '99999999999999999999 0'