QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#527130#8889. Ice Cream Machinesahihi123441 27ms19928kbC++141.8kb2024-08-22 10:33:592024-08-22 10:34:00

详细

Subtask #1:

score: 7
Accepted

Test #1:

score: 7
Accepted
time: 6ms
memory: 17632kb

input:

1000 10 1
3
6
6
8
4
7
4
10
1
6
6
2
1
8
4
10
5
9
3
4
7
5
9
6
2
8
8
7
1
1
1
9
8
6
4
6
5
4
8
8
2
3
1
7
7
10
4
10
5
5
2
7
5
1
6
8
7
9
10
4
9
2
4
5
7
8
10
9
1
5
1
7
10
4
10
10
5
10
10
10
5
3
5
5
7
4
6
6
10
6
9
5
6
3
3
3
7
10
7
4
5
10
6
4
2
4
8
7
6
9
7
5
6
9
9
7
4
5
8
8
10
6
1
4
9
3
9
10
1
7
3
4
8
1
3
9
5...

output:

899

result:

ok 1 number(s): "899"

Test #2:

score: 7
Accepted
time: 6ms
memory: 17016kb

input:

1000 1 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1...

output:

1

result:

ok 1 number(s): "1"

Test #3:

score: 7
Accepted
time: 9ms
memory: 17692kb

input:

751 8 1
8
6
5
4
7
8
2
6
4
7
4
2
2
5
3
7
7
3
7
2
5
3
4
8
6
8
1
4
3
8
4
1
3
3
5
3
6
6
8
8
1
4
6
8
8
3
5
7
5
7
1
1
1
2
8
1
8
6
4
5
1
2
7
5
5
5
7
4
3
1
4
3
8
6
5
3
1
7
5
7
8
3
8
2
6
8
6
5
4
1
1
5
1
4
7
7
5
2
6
8
4
3
2
6
5
7
7
4
4
5
1
7
2
2
2
6
7
6
2
4
7
3
2
6
2
3
2
1
4
8
8
7
6
3
4
7
2
4
3
1
7
2
7
1
3
6
...

output:

655

result:

ok 1 number(s): "655"

Test #4:

score: 7
Accepted
time: 4ms
memory: 18020kb

input:

857 3 1
1
3
1
3
2
1
1
2
2
2
1
3
3
3
2
2
3
1
3
1
1
3
1
3
3
2
1
3
1
3
1
1
3
2
2
1
1
3
1
1
2
3
1
1
2
1
3
3
3
3
3
1
1
2
2
3
1
1
2
2
2
3
2
1
2
2
2
3
2
1
3
3
2
2
1
2
3
1
1
1
3
2
3
3
3
1
3
2
2
2
1
3
3
3
2
2
3
1
1
1
1
3
1
3
3
3
1
2
1
3
1
3
2
3
3
3
1
1
1
3
1
3
3
2
2
1
3
3
1
1
3
1
2
1
1
1
2
1
2
2
3
2
2
2
2
3
...

output:

565

result:

ok 1 number(s): "565"

Test #5:

score: 7
Accepted
time: 4ms
memory: 17820kb

input:

888 3 1
2
1
1
3
2
3
2
2
2
1
2
2
1
3
2
1
1
1
2
3
3
1
2
3
1
3
3
3
2
2
1
2
2
1
1
1
2
2
1
3
1
3
3
3
3
2
2
1
3
3
1
1
1
3
3
2
1
2
3
3
2
2
1
3
3
2
1
1
1
1
1
2
2
2
2
3
3
2
1
1
2
3
2
2
1
3
3
1
2
1
2
1
1
2
1
2
1
3
2
2
3
1
3
3
1
1
1
3
1
2
3
2
1
1
1
2
3
2
2
1
2
1
3
3
3
2
3
1
2
2
3
1
1
3
3
3
2
3
2
1
1
3
1
2
3
1
...

output:

599

result:

ok 1 number(s): "599"

Test #6:

score: 7
Accepted
time: 8ms
memory: 17788kb

input:

998 4 1
2
4
1
1
3
4
3
3
2
2
1
2
3
3
4
4
3
3
1
1
1
4
2
1
2
2
2
2
3
2
2
1
2
2
4
3
3
3
3
2
2
3
3
2
3
4
3
4
3
2
4
2
1
2
3
3
2
3
2
4
1
4
1
4
1
4
1
2
3
1
4
3
1
2
2
3
3
2
1
3
3
3
4
2
1
3
2
3
3
4
3
4
1
4
3
4
3
3
1
4
2
3
2
1
4
2
1
1
4
3
4
2
4
4
3
4
4
1
3
4
4
1
2
3
2
1
1
3
3
1
3
3
4
3
1
3
2
4
1
4
4
2
4
2
2
4
...

output:

731

result:

ok 1 number(s): "731"

Test #7:

score: 7
Accepted
time: 9ms
memory: 17804kb

input:

1000 10 1
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9...

output:

1000

result:

ok 1 number(s): "1000"

Subtask #2:

score: 12
Accepted

Dependency #1:

100%
Accepted

Test #8:

score: 12
Accepted
time: 4ms
memory: 17884kb

input:

1000 10 2
5
1
5
10
1
10
9
10
3
9
7
6
4
3
1
10
7
9
5
9
5
4
2
7
7
8
4
4
4
3
10
8
4
2
5
7
5
10
9
2
6
1
4
7
9
5
6
3
4
3
5
4
3
9
2
6
3
2
6
9
8
4
5
5
2
9
10
2
6
1
7
3
6
6
7
4
10
7
8
5
8
8
2
7
8
10
5
2
8
4
2
10
3
9
7
8
6
7
9
7
9
2
5
4
5
10
2
4
3
9
2
3
7
9
3
10
8
4
1
8
9
10
8
10
2
6
3
2
2
5
5
2
8
7
9
5
7
7
...

output:

629

result:

ok 1 number(s): "629"

Test #9:

score: 12
Accepted
time: 9ms
memory: 17852kb

input:

1000 2 2
2
2
2
2
1
2
1
1
1
2
1
1
1
1
2
1
1
2
2
2
2
2
1
1
2
2
1
1
1
2
1
2
1
2
1
1
1
2
1
1
2
2
2
2
2
2
1
1
2
2
1
2
2
2
1
2
1
1
2
1
2
1
2
2
2
1
1
1
1
1
1
1
2
1
2
2
1
1
2
2
1
2
2
2
1
2
1
2
1
2
1
2
1
1
1
2
1
1
1
1
1
1
1
2
1
2
1
1
1
2
2
2
1
1
2
2
1
1
2
2
1
2
2
2
2
2
2
2
2
1
1
1
1
2
2
1
2
2
2
1
1
1
2
1
2
1...

output:

2

result:

ok 1 number(s): "2"

Test #10:

score: 12
Accepted
time: 9ms
memory: 17032kb

input:

933 8 2
6
1
4
2
6
3
6
6
8
5
8
6
1
8
5
4
8
2
8
1
8
2
2
4
2
1
1
5
7
1
8
6
1
3
6
6
7
5
3
6
5
6
6
5
5
1
3
7
2
5
7
1
8
7
5
2
8
3
5
6
3
8
8
7
6
4
3
8
8
1
7
6
1
6
2
6
3
4
3
3
4
2
8
5
4
8
1
2
6
4
1
3
2
8
2
4
6
2
8
8
7
6
7
2
6
8
4
2
6
6
5
1
8
2
4
7
3
8
3
6
5
7
4
2
1
4
7
2
8
1
5
5
5
7
6
7
2
3
5
6
4
5
8
7
4
7
...

output:

556

result:

ok 1 number(s): "556"

Test #11:

score: 12
Accepted
time: 3ms
memory: 17284kb

input:

62 6 2
1
3
1
5
6
4
4
1
4
2
4
2
2
4
1
2
1
6
2
5
6
5
2
2
6
6
4
3
6
3
6
6
5
1
5
1
1
3
4
6
4
3
6
3
5
6
5
2
5
5
1
6
1
1
3
3
6
3
4
3
6
3

output:

25

result:

ok 1 number(s): "25"

Test #12:

score: 12
Accepted
time: 4ms
memory: 17564kb

input:

757 6 2
4
6
6
1
3
4
4
3
3
3
6
6
1
3
5
6
1
4
2
3
6
6
6
4
1
3
6
5
5
6
4
5
5
6
5
4
5
3
3
5
3
4
2
5
5
1
2
4
4
1
4
5
3
5
4
4
4
3
6
6
3
4
3
2
5
5
5
1
3
5
6
3
5
5
6
1
2
3
1
3
6
3
2
5
5
2
4
4
4
5
4
1
6
3
6
6
2
2
4
3
2
1
1
3
6
2
3
1
5
2
5
3
5
2
3
1
3
6
1
2
1
6
2
5
3
2
1
5
5
2
1
1
6
1
3
2
3
2
5
6
4
1
2
5
1
5
...

output:

374

result:

ok 1 number(s): "374"

Test #13:

score: 12
Accepted
time: 6ms
memory: 17216kb

input:

956 6 2
4
5
2
4
6
2
1
2
2
2
6
6
4
6
3
3
4
6
4
2
5
1
5
3
6
6
6
1
5
5
2
4
1
2
6
2
2
3
6
2
4
1
6
3
3
5
6
3
4
3
5
3
5
6
5
4
6
2
4
1
2
3
4
6
1
5
6
1
4
4
6
6
4
6
6
3
3
3
6
3
5
4
3
6
1
1
4
4
2
2
2
6
3
2
2
6
3
6
2
3
3
1
3
5
6
6
4
5
5
2
4
4
5
2
6
2
3
3
5
1
1
1
2
5
3
5
3
1
1
6
5
1
6
4
2
1
2
2
1
6
6
1
6
4
6
3
...

output:

472

result:

ok 1 number(s): "472"

Test #14:

score: 12
Accepted
time: 9ms
memory: 18040kb

input:

1000 10 2
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9...

output:

890

result:

ok 1 number(s): "890"

Subtask #3:

score: 22
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Test #15:

score: 22
Accepted
time: 23ms
memory: 19904kb

input:

1000 10 5
10
4
1
7
3
7
4
9
7
5
3
7
2
1
2
8
9
10
5
9
8
10
4
7
7
7
9
2
3
4
6
7
9
4
9
4
1
1
8
3
9
3
2
6
4
5
2
3
9
6
9
3
5
9
6
4
7
7
2
5
7
9
6
8
7
10
7
6
10
7
5
10
2
8
10
10
5
3
2
5
10
1
4
5
3
4
7
10
8
8
9
5
2
8
2
2
1
7
4
7
6
1
2
4
10
5
2
5
5
4
9
10
3
3
8
9
5
7
5
10
1
2
4
1
6
6
2
1
8
7
8
3
10
1
1
6
8
10...

output:

284

result:

ok 1 number(s): "284"

Test #16:

score: 22
Accepted
time: 9ms
memory: 17184kb

input:

1000 5 5
1
3
1
1
1
4
3
5
5
3
3
5
1
2
5
4
5
3
1
1
2
3
5
1
3
5
3
3
5
5
5
3
4
3
2
1
1
3
3
3
1
3
3
5
5
4
3
4
3
5
2
1
3
3
1
1
3
1
1
5
1
2
1
4
4
2
5
1
2
4
1
5
4
2
4
4
3
5
2
5
5
3
3
3
4
2
4
3
4
3
3
2
3
2
2
4
1
1
1
2
1
5
2
1
3
3
4
1
2
5
2
4
3
1
2
4
4
1
1
3
3
2
5
5
5
4
1
5
5
1
1
5
5
5
5
5
2
3
3
4
4
5
2
3
2
3...

output:

5

result:

ok 1 number(s): "5"

Test #17:

score: 22
Accepted
time: 4ms
memory: 17864kb

input:

614 9 3
3
1
6
7
8
8
8
8
1
7
8
8
9
1
3
3
5
8
4
1
8
9
7
2
3
2
2
5
5
3
9
7
3
7
6
8
4
4
8
5
9
4
4
7
4
8
5
6
4
7
7
9
1
7
2
5
1
5
1
5
6
6
9
4
9
2
7
7
4
2
1
6
6
8
7
4
1
8
5
5
5
9
8
7
8
5
9
5
4
9
7
2
8
8
9
1
9
2
1
8
1
8
4
6
1
5
1
3
3
3
7
5
5
3
4
8
1
2
9
8
6
7
1
8
1
9
5
5
9
2
5
1
6
3
2
5
5
8
9
1
2
1
7
8
4
3
...

output:

269

result:

ok 1 number(s): "269"

Test #18:

score: 22
Accepted
time: 4ms
memory: 18096kb

input:

352 6 4
5
4
1
3
3
3
5
2
2
5
3
1
5
5
2
2
2
1
2
1
1
5
2
5
5
3
5
6
3
1
5
6
6
1
2
1
4
4
2
4
5
4
1
3
3
5
2
2
5
5
1
1
1
6
6
1
5
1
1
1
3
3
3
3
4
3
5
1
3
3
5
6
2
1
6
6
2
1
2
2
1
4
4
1
4
2
5
2
4
6
2
4
3
3
3
4
3
2
3
1
3
4
1
5
4
1
4
1
5
2
5
5
6
3
2
1
1
5
6
4
1
4
2
5
4
1
2
2
3
6
6
6
3
2
3
1
2
5
4
5
3
2
4
1
6
5
...

output:

64

result:

ok 1 number(s): "64"

Test #19:

score: 22
Accepted
time: 9ms
memory: 17432kb

input:

881 5 3
4
2
5
1
3
2
1
5
3
2
4
2
3
4
3
5
1
2
2
4
2
1
5
4
5
3
2
4
2
2
2
4
2
5
3
4
5
4
2
5
2
2
4
4
4
5
1
4
5
5
4
2
2
2
2
1
5
1
2
2
4
1
4
5
5
2
4
2
4
4
3
2
4
5
1
2
1
2
2
5
2
1
1
4
3
3
5
1
3
4
1
2
4
5
2
2
2
3
2
3
3
2
5
4
4
3
2
4
4
3
4
3
2
1
2
5
1
1
3
3
1
4
3
1
2
5
5
4
2
1
1
5
2
2
4
5
1
3
1
1
2
1
4
5
2
3
...

output:

222

result:

ok 1 number(s): "222"

Test #20:

score: 22
Accepted
time: 8ms
memory: 17664kb

input:

395 8 3
4
5
6
5
7
3
3
2
4
2
3
6
5
2
7
1
2
3
4
1
5
8
5
8
5
4
5
1
5
5
3
4
6
4
7
2
4
5
4
1
4
8
3
2
5
7
4
3
3
1
7
8
1
3
2
3
7
7
4
5
2
4
1
1
1
3
2
1
7
1
1
2
6
1
2
5
4
8
8
4
6
4
6
1
5
2
4
5
8
5
8
4
2
7
5
6
2
2
3
5
4
3
3
7
1
5
4
8
4
2
4
5
3
3
4
6
1
7
8
1
5
1
6
6
1
3
4
3
2
6
8
7
6
2
8
8
1
2
3
8
5
4
1
8
5
4
...

output:

169

result:

ok 1 number(s): "169"

Test #21:

score: 22
Accepted
time: 9ms
memory: 17376kb

input:

1000 5 5
1
2
3
4
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5...

output:

5

result:

ok 1 number(s): "5"

Test #22:

score: 22
Accepted
time: 9ms
memory: 17800kb

input:

1000 2 2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2...

output:

2

result:

ok 1 number(s): "2"

Test #23:

score: 22
Accepted
time: 27ms
memory: 19412kb

input:

1000 10 5
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9...

output:

560

result:

ok 1 number(s): "560"

Subtask #4:

score: 0
Wrong Answer

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Test #24:

score: 0
Wrong Answer
time: 17ms
memory: 19928kb

input:

1000 200 100
125
25
197
45
187
19
77
114
143
176
87
180
3
10
92
95
22
170
50
133
76
157
200
144
73
185
127
140
133
29
40
39
54
166
56
76
151
200
188
9
60
199
112
28
188
87
68
100
74
85
60
68
187
5
105
1
35
198
150
150
24
148
14
40
159
173
25
181
176
88
138
42
78
51
130
190
180
19
127
98
28
172
135
1...

output:

1061109567

result:

wrong answer 1st numbers differ - expected: '290', found: '1061109567'

Subtask #5:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

0%

Subtask #6:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

0%

Subtask #7:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

0%