QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#318900 | #5585. Creative Accounting | Pranav624 | WA | 11ms | 10028kb | Python3 | 800b | 2024-02-01 10:06:03 | 2024-02-01 10:06:04 |
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
if l == h:
h += 1
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: 5ms
memory: 9844kb
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: 0
Accepted
time: 4ms
memory: 10028kb
input:
1 1 1 1
output:
1 1
result:
ok single line: '1 1'
Test #3:
score: -100
Wrong Answer
time: 11ms
memory: 9932kb
input:
3 1 3 3 3 3
output:
2 3
result:
wrong answer 1st lines differ - expected: '1 3', found: '2 3'