QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#503790#5382. Disastrous Downtimexiaowuc1AC ✓182ms58036kbJava81.8kb2024-08-04 01:13:112024-08-04 01:13:11

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 39ms
memory: 37508kb

input:

2 1
0
1000

output:

1

result:

ok single line: '1'

Test #2:

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

input:

3 2
1000
1010
1999

output:

2

result:

ok single line: '2'

Test #3:

score: 0
Accepted
time: 31ms
memory: 38636kb

input:

5 3
5
9
10
16
17

output:

2

result:

ok single line: '2'

Test #4:

score: 0
Accepted
time: 182ms
memory: 56008kb

input:

99997 444
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

output:

3

result:

ok single line: '3'

Test #5:

score: 0
Accepted
time: 91ms
memory: 42700kb

input:

25000 91
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0...

output:

275

result:

ok single line: '275'

Test #6:

score: 0
Accepted
time: 117ms
memory: 47248kb

input:

50000 48
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0...

output:

1042

result:

ok single line: '1042'

Test #7:

score: 0
Accepted
time: 117ms
memory: 46656kb

input:

25000 52
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
1000...

output:

481

result:

ok single line: '481'

Test #8:

score: 0
Accepted
time: 140ms
memory: 51232kb

input:

50000 11
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
100000
1000...

output:

4546

result:

ok single line: '4546'

Test #9:

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

input:

1000 10
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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:

100

result:

ok single line: '100'

Test #10:

score: 0
Accepted
time: 50ms
memory: 39340kb

input:

2999 7
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0...

output:

429

result:

ok single line: '429'

Test #11:

score: 0
Accepted
time: 57ms
memory: 37680kb

input:

3998 63
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
...

output:

64

result:

ok single line: '64'

Test #12:

score: 0
Accepted
time: 62ms
memory: 37780kb

input:

4997 95
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
2
2
2
2
3
3
3
3
3
3
3
3
3
3
4
4
4
4
4
4
5
5
5
5
5
5
5
5
5
5
5
5
5
5
6
6
6
6
6
6
6
7
7
7
7
7
7
7
7
8
8
8
8
8
8
8
8
8
8
8
9
9
9
9
9
9
9
9
9
9
9
9
10
10
10
10
10
10
10
10
10
10
11
11
11
11
11
11
11
11
12
12
12
12
12
12
13
13
13
13
13
14
14
14
...

output:

53

result:

ok single line: '53'

Test #13:

score: 0
Accepted
time: 47ms
memory: 38656kb

input:

1996 7
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
999
999
999
999
999
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1001
1001
1998
1999
1999
1999
1999
1999
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2000
2001
2998
2999
2999
2999
2999
2999
2999
3000
3000
3000
3000
300...

output:

4

result:

ok single line: '4'

Test #14:

score: 0
Accepted
time: 33ms
memory: 37008kb

input:

10 96
5
8
31
58
61
61
67
74
84
95

output:

1

result:

ok single line: '1'

Test #15:

score: 0
Accepted
time: 52ms
memory: 39272kb

input:

2995 12
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
999
999
999
999
999
999
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1001
1001
1001
1001
1998
1999
1999
1999
1999
1999
1999
1999
2000
2000
2000
2000
2000
2000
2000
2000
2000
200...

output:

3

result:

ok single line: '3'

Test #16:

score: 0
Accepted
time: 58ms
memory: 39468kb

input:

3994 4
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
999
999
999
999
999
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1001
1001
1001
1001
1001
1999
1999
1999
199...

output:

12

result:

ok single line: '12'

Test #17:

score: 0
Accepted
time: 65ms
memory: 38396kb

input:

4993 118
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
999
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000
1000...

output:

1

result:

ok single line: '1'

Test #18:

score: 0
Accepted
time: 36ms
memory: 36992kb

input:

1 1
0

output:

1

result:

ok single line: '1'

Test #19:

score: 0
Accepted
time: 31ms
memory: 37484kb

input:

1 1
100000

output:

1

result:

ok single line: '1'

Test #20:

score: 0
Accepted
time: 37ms
memory: 37348kb

input:

15 5
0
1
3
4
5
7
9
10
11
12
13
13
17
17
20

output:

3

result:

ok single line: '3'

Test #21:

score: 0
Accepted
time: 167ms
memory: 55236kb

input:

100000 237
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
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:

422

result:

ok single line: '422'

Test #22:

score: 0
Accepted
time: 172ms
memory: 55520kb

input:

100000 2
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0...

output:

50000

result:

ok single line: '50000'

Test #23:

score: 0
Accepted
time: 182ms
memory: 56076kb

input:

100000 20
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

output:

5000

result:

ok single line: '5000'

Test #24:

score: 0
Accepted
time: 165ms
memory: 58036kb

input:

100000 32384
0
0
0
4
9
9
9
13
13
13
14
14
15
17
18
18
21
21
22
23
24
24
25
25
26
26
26
26
27
27
31
32
33
33
33
34
35
35
36
37
39
40
40
42
42
43
43
45
46
48
48
48
48
52
53
54
54
55
55
56
56
57
57
58
58
60
60
61
62
63
63
64
64
65
66
67
68
73
73
75
76
77
79
80
80
81
81
83
83
83
84
84
85
85
86
88
88
88
...

output:

1

result:

ok single line: '1'

Test #25:

score: 0
Accepted
time: 92ms
memory: 42700kb

input:

12345 23
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
999
999
999
999
999
999
999
999
999
999
999
9...

output:

7

result:

ok single line: '7'

Test #26:

score: 0
Accepted
time: 114ms
memory: 46248kb

input:

23456 23
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0...

output:

13

result:

ok single line: '13'