QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#584964#9182. Infinite RaceZhangYiDe29 36ms4484kbC++20365b2024-09-23 18:03:212024-09-23 18:03:23

詳細信息

Subtask #1:

score: 29
Accepted

Test #1:

score: 29
Accepted
time: 0ms
memory: 3544kb

input:

2
1
1

output:

0

result:

ok single line: '0'

Test #2:

score: 29
Accepted
time: 0ms
memory: 3508kb

input:

2
2
1
-1

output:

0

result:

ok single line: '0'

Test #3:

score: 29
Accepted
time: 0ms
memory: 3548kb

input:

2
5
-1
-1
-1
-1
1

output:

0

result:

ok single line: '0'

Test #4:

score: 29
Accepted
time: 21ms
memory: 3640kb

input:

2
200000
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:

50154

result:

ok single line: '50154'

Test #5:

score: 29
Accepted
time: 21ms
memory: 3636kb

input:

2
200000
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:

50172

result:

ok single line: '50172'

Test #6:

score: 29
Accepted
time: 21ms
memory: 3628kb

input:

2
200000
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:

49713

result:

ok single line: '49713'

Test #7:

score: 29
Accepted
time: 21ms
memory: 3552kb

input:

2
200000
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:

49564

result:

ok single line: '49564'

Test #8:

score: 29
Accepted
time: 0ms
memory: 3548kb

input:

2
100
-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:

16

result:

ok single line: '16'

Test #9:

score: 29
Accepted
time: 0ms
memory: 3504kb

input:

2
2
1
1

output:

1

result:

ok single line: '1'

Test #10:

score: 29
Accepted
time: 17ms
memory: 3632kb

input:

2
200000
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:

199999

result:

ok single line: '199999'

Test #11:

score: 29
Accepted
time: 0ms
memory: 3628kb

input:

2
100
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:

99

result:

ok single line: '99'

Test #12:

score: 29
Accepted
time: 19ms
memory: 3624kb

input:

2
200000
-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:

0

result:

ok single line: '0'

Test #13:

score: 29
Accepted
time: 0ms
memory: 3504kb

input:

2
100
-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:

0

result:

ok single line: '0'

Test #14:

score: 29
Accepted
time: 21ms
memory: 3704kb

input:

2
200000
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:

50402

result:

ok single line: '50402'

Test #15:

score: 29
Accepted
time: 0ms
memory: 3624kb

input:

2
100
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:

27

result:

ok single line: '27'

Test #16:

score: 29
Accepted
time: 21ms
memory: 3512kb

input:

2
200000
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:

49885

result:

ok single line: '49885'

Test #17:

score: 29
Accepted
time: 0ms
memory: 3560kb

input:

2
100
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:

84

result:

ok single line: '84'

Test #18:

score: 29
Accepted
time: 17ms
memory: 3624kb

input:

2
200000
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:

199987

result:

ok single line: '199987'

Test #19:

score: 29
Accepted
time: 0ms
memory: 3512kb

input:

2
4
1
1
1
1

output:

3

result:

ok single line: '3'

Test #20:

score: 29
Accepted
time: 0ms
memory: 3560kb

input:

2
5
1
-1
1
-1
-1

output:

0

result:

ok single line: '0'

Subtask #2:

score: 0
Wrong Answer

Test #21:

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

input:

2
2
1
1

output:

1

result:

ok single line: '1'

Test #22:

score: 34
Accepted
time: 17ms
memory: 3560kb

input:

2
200000
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:

199999

result:

ok single line: '199999'

Test #23:

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

input:

2
100
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:

99

result:

ok single line: '99'

Test #24:

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

input:

100
100
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
1

output:

1

result:

ok single line: '1'

Test #25:

score: 34
Accepted
time: 36ms
memory: 4484kb

input:

200000
200000
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
86
87
88
89
90
91
92
93
94
95
96
97
98
9...

output:

1

result:

ok single line: '1'

Test #26:

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

input:

200000
1
182487

output:

0

result:

ok single line: '0'

Test #27:

score: 0
Wrong Answer
time: 18ms
memory: 3624kb

input:

3
200000
1
2
1
2
2
2
1
1
1
2
2
2
1
2
2
2
2
1
1
2
2
1
2
2
1
2
2
1
2
1
1
2
2
2
2
2
1
2
2
2
1
1
2
1
1
2
2
1
2
2
1
2
2
1
1
2
2
2
2
2
2
1
2
1
1
1
2
1
1
2
1
1
1
2
1
1
2
2
2
1
1
1
1
2
1
2
2
1
2
1
2
1
2
1
2
2
2
1
2
2
2
1
1
1
1
2
1
1
2
2
2
2
1
2
1
2
1
1
2
2
1
1
1
1
1
1
2
2
1
1
1
1
1
1
1
2
2
2
2
2
2
1
1
1
2
2...

output:

199998

result:

wrong answer 1st lines differ - expected: '133415', found: '199998'

Subtask #3:

score: 0
Wrong Answer

Test #45:

score: 22
Accepted
time: 0ms
memory: 3556kb

input:

2
1
1

output:

0

result:

ok single line: '0'

Test #46:

score: 22
Accepted
time: 0ms
memory: 3636kb

input:

2
2
1
-1

output:

0

result:

ok single line: '0'

Test #47:

score: 22
Accepted
time: 0ms
memory: 3628kb

input:

2
5
-1
-1
-1
-1
1

output:

0

result:

ok single line: '0'

Test #48:

score: 22
Accepted
time: 0ms
memory: 3704kb

input:

2
100
-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:

16

result:

ok single line: '16'

Test #49:

score: 22
Accepted
time: 0ms
memory: 3504kb

input:

2
2
1
1

output:

1

result:

ok single line: '1'

Test #50:

score: 22
Accepted
time: 0ms
memory: 3632kb

input:

2
100
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:

99

result:

ok single line: '99'

Test #51:

score: 22
Accepted
time: 0ms
memory: 3508kb

input:

2
100
-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:

0

result:

ok single line: '0'

Test #52:

score: 22
Accepted
time: 0ms
memory: 3596kb

input:

2
100
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:

27

result:

ok single line: '27'

Test #53:

score: 22
Accepted
time: 0ms
memory: 3704kb

input:

2
100
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:

84

result:

ok single line: '84'

Test #54:

score: 22
Accepted
time: 0ms
memory: 3632kb

input:

100
100
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
1

output:

1

result:

ok single line: '1'

Test #55:

score: 0
Wrong Answer
time: 0ms
memory: 3696kb

input:

100
100
92
24
44
6
56
47
78
13
79
24
86
40
7
40
3
33
1
63
9
82
73
40
4
92
88
1
9
77
24
27
22
74
55
26
49
99
64
28
20
49
62
11
78
10
69
76
93
96
18
65
20
2
91
4
81
61
41
29
18
3
93
6
31
7
91
58
78
46
56
69
92
46
96
36
22
84
4
8
62
64
61
38
91
2
87
46
27
63
35
55
10
7
74
60
73
45
83
94
40
70

output:

39

result:

wrong answer 1st lines differ - expected: '7', found: '39'

Subtask #4:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

0%