QOJ.ac

QOJ

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

Judging History

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

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

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'