QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#318901#5585. Creative AccountingPranav624WA 204ms9964kbPython3780b2024-02-01 10:07:252024-02-01 10:07:26

Judging History

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

  • [2024-02-01 10:07:26]
  • 评测
  • 测评结果:WA
  • 用时:204ms
  • 内存:9964kb
  • [2024-02-01 10:07:25]
  • 提交

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+1):
    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)

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 7ms
memory: 9524kb

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: 10ms
memory: 9464kb

input:

1 1 1
1

output:

1 1

result:

ok single line: '1 1'

Test #3:

score: 0
Accepted
time: 10ms
memory: 9564kb

input:

3 1 3
3
3
3

output:

1 3

result:

ok single line: '1 3'

Test #4:

score: 0
Accepted
time: 10ms
memory: 9528kb

input:

10 1 5
0
0
0
0
0
0
0
0
0
0

output:

0 0

result:

ok single line: '0 0'

Test #5:

score: 0
Accepted
time: 8ms
memory: 9452kb

input:

60 1 20
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-10000
-1000...

output:

0 0

result:

ok single line: '0 0'

Test #6:

score: 0
Accepted
time: 34ms
memory: 9932kb

input:

5000 1 1
10000
9998
9996
9994
9992
9990
9988
9986
9984
9982
9980
9978
9976
9974
9972
9970
9968
9966
9964
9962
9960
9958
9956
9954
9952
9950
9948
9946
9944
9942
9940
9938
9936
9934
9932
9930
9928
9926
9924
9922
9920
9918
9916
9914
9912
9910
9908
9906
9904
9902
9900
9898
9896
9894
9892
9890
9888
9886
...

output:

5000 5000

result:

ok single line: '5000 5000'

Test #7:

score: 0
Accepted
time: 46ms
memory: 9908kb

input:

5000 1 2
-10000
-9998
-9996
-9994
-9992
-9990
-9988
-9986
-9984
-9982
-9980
-9978
-9976
-9974
-9972
-9970
-9968
-9966
-9964
-9962
-9960
-9958
-9956
-9954
-9952
-9950
-9948
-9946
-9944
-9942
-9940
-9938
-9936
-9934
-9932
-9930
-9928
-9926
-9924
-9922
-9920
-9918
-9916
-9914
-9912
-9910
-9908
-9906
-9...

output:

0 0

result:

ok single line: '0 0'

Test #8:

score: -100
Wrong Answer
time: 204ms
memory: 9964kb

input:

5000 1 500
0
1
-2
3
-4
5
-6
7
-8
9
-10
11
-12
13
-14
15
-16
17
-18
19
-20
21
-22
23
-24
25
-26
27
-28
29
-30
31
-32
33
-34
35
-36
37
-38
39
-40
41
-42
43
-44
45
-46
47
-48
49
-50
51
-52
53
-54
55
-56
57
-58
59
-60
61
-62
63
-64
65
-66
67
-68
69
-70
71
-72
73
-74
75
-76
77
-78
79
-80
81
-82
83
-84
85...

output:

6 2501

result:

wrong answer 1st lines differ - expected: '2 2501', found: '6 2501'