QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#318900#5585. Creative AccountingPranav624WA 11ms10028kbPython3800b2024-02-01 10:06:032024-02-01 10:06:04

Judging History

你现在查看的是最新测评结果

  • [2024-02-01 10:06:04]
  • 评测
  • 测评结果:WA
  • 用时:11ms
  • 内存:10028kb
  • [2024-02-01 10:06:03]
  • 提交

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'