Skip to content

Gondola

UnratedFunction
English

Language

Contribute a translation
Time limit
1000 ms
Memory limit
256 MB (no extra memory)
Submissions
0
Correct
0
Solved by
0
AC rate
—

Statement

Gondola: original English statement, page 1

Gondola: original English statement, page 2

Gondola: original English statement, page 3

Gondola: original English statement, page 4

Examples

Sample input 1
1
30
16 26 18 19 20 13 22 21 24 25 17 27 28 29 30 1 2 3 11 5 6 8 7 9 10 12 4 23 14 15
Sample output 1
0
Sample input 2
2
6
3 4 5 6 1 2
Sample output 2
1
Sample input 3
3
7
1 2 3 4 5 6 5
Sample output 3
0
Sample input 4
4
2
3 2
Sample output 4
1 1
Sample input 5
5
14
12 13 14 1 2 3 4 5 6 7 8 9 10 11
Sample output 5
0 
Sample input 6
6
50
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 51 47 48 49 50 1 2 3
Sample output 6
1 46
Sample input 7
7
11
4 5 6 7 8 9 10 11 1 2 3
Sample output 7
1
Sample input 8
8
14
6 94 8 9 10 93 12 13 95 1 2 3 4 5
Sample output 8
224280120
Sample input 9
9
4
1 2 7 6
Sample output 9
2
Sample input 10
10
4
4 7 4 7
Sample output 10
0

Tags

No tags yet

Source

This problem accepts only these languages.

C++20