QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#790596#9054. Ordered Problem SetdXqwq#AC ✓1ms6116kbC++231.1kb2024-11-28 13:52:092024-11-28 13:52:10

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 5836kb

input:

6
1
3
2
4
5
6

output:

2

result:

ok single line: '2'

Test #2:

score: 0
Accepted
time: 1ms
memory: 5756kb

input:

6
1
2
3
4
5
6

output:

2
3
6

result:

ok 3 lines

Test #3:

score: 0
Accepted
time: 1ms
memory: 5780kb

input:

6
6
5
4
3
2
1

output:

-1

result:

ok single line: '-1'

Test #4:

score: 0
Accepted
time: 1ms
memory: 5752kb

input:

4
1
2
3
4

output:

2
4

result:

ok 2 lines

Test #5:

score: 0
Accepted
time: 0ms
memory: 5808kb

input:

4
1
3
2
4

output:

-1

result:

ok single line: '-1'

Test #6:

score: 0
Accepted
time: 1ms
memory: 6004kb

input:

6
2
1
3
4
5
6

output:

2
3

result:

ok 2 lines

Test #7:

score: 0
Accepted
time: 1ms
memory: 6004kb

input:

6
1
2
3
6
5
4

output:

2

result:

ok single line: '2'

Test #8:

score: 0
Accepted
time: 1ms
memory: 5624kb

input:

6
4
3
5
6
1
2

output:

-1

result:

ok single line: '-1'

Test #9:

score: 0
Accepted
time: 1ms
memory: 5840kb

input:

17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

output:

17

result:

ok single line: '17'

Test #10:

score: 0
Accepted
time: 1ms
memory: 5636kb

input:

17
5
4
12
13
11
10
7
14
1
16
3
6
2
8
9
17
15

output:

-1

result:

ok single line: '-1'

Test #11:

score: 0
Accepted
time: 1ms
memory: 6116kb

input:

19
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

output:

19

result:

ok single line: '19'

Test #12:

score: 0
Accepted
time: 1ms
memory: 5584kb

input:

19
8
7
14
3
17
18
10
12
2
9
1
6
15
4
16
11
19
13
5

output:

-1

result:

ok single line: '-1'

Test #13:

score: 0
Accepted
time: 1ms
memory: 5836kb

input:

23
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

output:

23

result:

ok single line: '23'

Test #14:

score: 0
Accepted
time: 1ms
memory: 5560kb

input:

23
22
2
19
15
4
16
17
14
7
12
5
18
20
21
8
10
11
6
9
3
13
1
23

output:

-1

result:

ok single line: '-1'

Test #15:

score: 0
Accepted
time: 0ms
memory: 5752kb

input:

30
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

output:

2
3
5
6
10
15
30

result:

ok 7 lines

Test #16:

score: 0
Accepted
time: 1ms
memory: 5768kb

input:

30
2
1
4
3
5
6
8
7
10
9
12
11
13
14
15
16
17
18
20
19
21
22
23
24
26
25
28
27
30
29

output:

2
3
5
15

result:

ok 4 lines

Test #17:

score: 0
Accepted
time: 0ms
memory: 5832kb

input:

30
2
3
1
5
6
4
8
7
9
10
12
11
15
14
13
17
16
18
19
21
20
22
24
23
27
26
25
30
28
29

output:

2
5
10

result:

ok 3 lines

Test #18:

score: 0
Accepted
time: 0ms
memory: 5836kb

input:

30
5
1
3
4
2
8
10
9
6
7
12
15
11
13
14
16
20
19
18
17
25
24
22
23
21
30
28
27
29
26

output:

2
3
6

result:

ok 3 lines

Test #19:

score: 0
Accepted
time: 1ms
memory: 5752kb

input:

30
6
4
5
3
2
1
9
7
11
10
12
8
16
18
14
13
15
17
21
24
23
22
19
20
30
25
28
27
26
29

output:

5

result:

ok single line: '5'

Test #20:

score: 0
Accepted
time: 1ms
memory: 5828kb

input:

30
4
10
8
1
9
6
5
2
7
3
15
19
16
12
11
18
17
13
14
20
28
22
30
26
25
27
21
24
29
23

output:

3

result:

ok single line: '3'

Test #21:

score: 0
Accepted
time: 1ms
memory: 5752kb

input:

30
8
11
15
12
3
7
4
9
13
5
10
6
14
2
1
16
22
18
25
24
17
27
30
19
23
21
28
29
20
26

output:

2

result:

ok single line: '2'

Test #22:

score: 0
Accepted
time: 1ms
memory: 5544kb

input:

30
17
3
25
22
21
26
29
13
19
20
28
4
10
18
2
11
8
23
30
24
16
12
27
5
14
9
1
6
15
7

output:

-1

result:

ok single line: '-1'

Test #23:

score: 0
Accepted
time: 1ms
memory: 5748kb

input:

32
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

output:

2
4
8
16
32

result:

ok 5 lines

Test #24:

score: 0
Accepted
time: 1ms
memory: 6004kb

input:

32
1
2
3
4
6
5
7
8
10
9
12
11
13
14
16
15
17
18
19
20
21
22
24
23
26
25
27
28
30
29
31
32

output:

2
4
8
16

result:

ok 4 lines

Test #25:

score: 0
Accepted
time: 0ms
memory: 5704kb

input:

32
2
1
4
3
7
8
6
5
10
11
12
9
15
14
13
16
17
18
20
19
23
24
22
21
27
28
25
26
30
31
29
32

output:

2
4
8

result:

ok 3 lines

Test #26:

score: 0
Accepted
time: 0ms
memory: 5832kb

input:

32
8
2
3
7
5
1
6
4
10
12
9
16
13
14
15
11
24
22
17
19
20
21
18
23
28
31
32
30
27
26
29
25

output:

2
4

result:

ok 2 lines

Test #27:

score: 0
Accepted
time: 1ms
memory: 6036kb

input:

32
3
11
1
5
15
16
13
7
10
14
8
2
4
12
6
9
30
26
29
22
31
24
27
20
21
23
25
32
19
18
28
17

output:

2

result:

ok single line: '2'

Test #28:

score: 0
Accepted
time: 1ms
memory: 5560kb

input:

32
27
26
31
10
30
1
8
16
22
9
32
15
25
3
23
4
13
12
28
24
7
5
6
2
11
20
19
18
29
14
21
17

output:

-1

result:

ok single line: '-1'

Test #29:

score: 0
Accepted
time: 0ms
memory: 5780kb

input:

36
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

output:

2
3
4
6
9
12
18
36

result:

ok 8 lines

Test #30:

score: 0
Accepted
time: 1ms
memory: 5744kb

input:

36
2
1
3
4
5
6
8
7
10
9
11
12
13
14
15
16
17
18
19
20
21
22
23
24
26
25
27
28
30
29
32
31
33
34
36
35

output:

2
3
6
9
18

result:

ok 5 lines

Test #31:

score: 0
Accepted
time: 1ms
memory: 5844kb

input:

36
1
3
2
5
6
4
7
9
8
11
12
10
14
13
15
17
16
18
20
19
21
22
24
23
26
25
27
29
30
28
31
32
33
36
35
34

output:

2
3
4
6
12

result:

ok 5 lines

Test #32:

score: 0
Accepted
time: 0ms
memory: 6004kb

input:

36
4
3
2
1
5
8
6
7
9
12
11
10
15
13
14
16
20
18
19
17
24
23
21
22
28
27
25
26
31
30
29
32
35
36
34
33

output:

3
9

result:

ok 2 lines

Test #33:

score: 0
Accepted
time: 1ms
memory: 6004kb

input:

36
2
4
3
6
1
5
8
7
11
10
12
9
14
15
18
17
16
13
23
21
20
24
19
22
25
29
30
28
27
26
32
36
35
31
33
34

output:

2
3
6

result:

ok 3 lines

Test #34:

score: 0
Accepted
time: 1ms
memory: 5752kb

input:

36
7
2
4
6
9
3
8
1
5
18
13
17
14
12
11
10
15
16
20
26
23
24
25
27
19
22
21
32
29
31
35
28
34
30
36
33

output:

2
4

result:

ok 2 lines

Test #35:

score: 0
Accepted
time: 1ms
memory: 5780kb

input:

36
4
6
7
8
1
2
12
11
3
5
10
9
18
17
22
16
24
19
15
14
23
21
20
13
25
30
35
31
26
28
33
29
27
32
34
36

output:

3

result:

ok single line: '3'

Test #36:

score: 0
Accepted
time: 1ms
memory: 5744kb

input:

36
4
1
11
17
3
13
5
12
6
7
10
18
14
16
9
15
8
2
24
36
35
30
31
22
21
29
23
34
20
25
33
32
27
26
19
28

output:

2

result:

ok single line: '2'

Test #37:

score: 0
Accepted
time: 1ms
memory: 5808kb

input:

36
34
22
10
16
7
24
17
5
3
26
20
18
2
11
23
4
33
15
21
36
35
12
1
27
9
8
30
6
19
14
29
31
13
25
28
32

output:

-1

result:

ok single line: '-1'

Test #38:

score: 0
Accepted
time: 1ms
memory: 5752kb

input:

39
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

output:

3
13
39

result:

ok 3 lines

Test #39:

score: 0
Accepted
time: 1ms
memory: 6004kb

input:

39
2
3
1
6
4
5
9
7
8
10
11
12
14
13
15
17
16
18
21
19
20
23
24
22
25
26
27
29
28
30
33
31
32
35
36
34
37
39
38

output:

13

result:

ok single line: '13'

Test #40:

score: 0
Accepted
time: 1ms
memory: 5752kb

input:

39
10
1
11
12
3
7
2
8
5
4
9
6
13
17
16
26
23
19
22
18
14
20
15
25
21
24
27
29
31
37
35
39
34
28
38
30
33
36
32

output:

3

result:

ok single line: '3'

Test #41:

score: 0
Accepted
time: 1ms
memory: 5844kb

input:

39
39
4
2
5
26
28
34
36
20
1
9
35
29
22
19
32
14
27
24
3
8
33
15
21
16
30
6
18
23
11
17
10
13
25
7
31
38
37
12

output:

-1

result:

ok single line: '-1'

Test #42:

score: 0
Accepted
time: 1ms
memory: 5708kb

input:

40
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

output:

2
4
5
8
10
20
40

result:

ok 7 lines

Test #43:

score: 0
Accepted
time: 1ms
memory: 5764kb

input:

40
1
2
3
4
6
5
7
8
9
10
11
12
14
13
15
16
18
17
19
20
21
22
24
23
25
26
28
27
29
30
32
31
34
33
35
36
38
37
39
40

output:

2
4
5
10
20

result:

ok 5 lines

Test #44:

score: 0
Accepted
time: 1ms
memory: 5772kb

input:

40
1
4
3
2
6
7
5
8
10
9
12
11
14
13
16
15
20
18
17
19
23
22
24
21
25
28
27
26
31
29
30
32
35
34
33
36
37
38
40
39

output:

2
5
10

result:

ok 3 lines

Test #45:

score: 0
Accepted
time: 1ms
memory: 5752kb

input:

40
3
5
4
1
2
7
8
10
9
6
13
11
15
14
12
19
18
20
17
16
22
24
23
21
25
27
29
30
28
26
33
35
34
31
32
37
39
36
38
40

output:

2
4
8

result:

ok 3 lines

Test #46:

score: 0
Accepted
time: 1ms
memory: 5768kb

input:

40
5
2
8
6
1
4
3
7
16
11
14
13
9
15
12
10
22
18
19
17
23
21
20
24
31
29
27
30
26
28
32
25
39
37
34
33
35
36
40
38

output:

5

result:

ok single line: '5'

Test #47:

score: 0
Accepted
time: 1ms
memory: 5752kb

input:

40
7
2
8
4
10
1
6
5
9
3
13
20
18
17
14
16
19
12
15
11
25
22
23
21
28
29
24
27
30
26
38
37
35
40
32
31
34
39
33
36

output:

2
4

result:

ok 2 lines

Test #48:

score: 0
Accepted
time: 1ms
memory: 6112kb

input:

40
11
18
1
9
12
14
5
8
7
6
4
2
13
3
15
17
19
10
16
20
40
39
34
24
30
27
21
35
26
33
36
28
29
37
22
38
23
32
25
31

output:

2

result:

ok single line: '2'

Test #49:

score: 0
Accepted
time: 1ms
memory: 5620kb

input:

40
29
37
34
11
36
25
32
14
6
4
16
28
13
5
8
2
31
15
21
18
1
20
40
24
10
7
38
9
30
39
19
22
12
27
35
33
23
3
26
17

output:

-1

result:

ok single line: '-1'

Test #50:

score: 0
Accepted
time: 1ms
memory: 6032kb

input:

42
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

output:

2
3
6
7
14
21
42

result:

ok 7 lines

Test #51:

score: 0
Accepted
time: 1ms
memory: 5768kb

input:

42
1
2
3
4
6
5
8
7
9
10
12
11
13
14
15
16
18
17
20
19
22
21
24
23
26
25
27
28
30
29
31
32
33
34
36
35
38
37
39
40
42
41

output:

3
7
21

result:

ok 3 lines

Test #52:

score: 0
Accepted
time: 1ms
memory: 5748kb

input:

42
2
3
1
5
6
4
8
7
9
12
11
10
15
13
14
17
18
16
20
21
19
23
22
24
27
26
25
28
30
29
33
32
31
36
34
35
39
37
38
40
41
42

output:

2
7
14

result:

ok 3 lines

Test #53:

score: 0
Accepted
time: 1ms
memory: 5832kb

input:

42
4
6
2
5
1
3
7
8
12
9
10
11
17
13
18
14
15
16
19
23
22
21
20
24
26
27
30
29
25
28
31
34
35
36
33
32
39
38
42
37
40
41

output:

7

result:

ok single line: '7'

Test #54:

score: 0
Accepted
time: 1ms
memory: 6036kb

input:

42
2
4
6
3
1
7
5
8
9
13
14
12
11
10
15
18
19
17
21
20
16
27
24
28
22
23
26
25
31
30
33
35
32
29
34
40
37
38
41
36
42
39

output:

2
3
6

result:

ok 3 lines

Test #55:

score: 0
Accepted
time: 1ms
memory: 6036kb

input:

42
10
1
9
11
3
7
5
6
8
4
14
12
2
13
21
25
16
27
26
18
23
28
20
19
15
17
24
22
39
42
36
33
41
31
32
34
37
38
29
40
35
30

output:

3

result:

ok single line: '3'

Test #56:

score: 0
Accepted
time: 1ms
memory: 6004kb

input:

42
15
5
1
3
10
9
8
13
16
7
19
21
18
12
4
20
11
6
2
17
14
26
37
28
27
39
42
30
41
29
33
40
35
23
32
22
38
36
31
34
25
24

output:

2

result:

ok single line: '2'

Test #57:

score: 0
Accepted
time: 1ms
memory: 5576kb

input:

42
20
6
26
19
24
23
13
34
1
27
41
40
35
9
2
11
30
32
10
15
8
36
38
29
7
21
42
18
14
12
3
28
17
25
31
22
5
39
37
33
4
16

output:

-1

result:

ok single line: '-1'

Test #58:

score: 0
Accepted
time: 1ms
memory: 5776kb

input:

45
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

output:

3
5
9
15
45

result:

ok 5 lines

Test #59:

score: 0
Accepted
time: 1ms
memory: 6108kb

input:

45
3
1
2
6
5
4
7
9
8
11
10
12
14
15
13
17
16
18
19
20
21
23
24
22
26
25
27
28
30
29
31
33
32
35
36
34
39
38
37
41
40
42
43
44
45

output:

3
5
15

result:

ok 3 lines

Test #60:

score: 0
Accepted
time: 1ms
memory: 5752kb

input:

45
2
1
3
4
5
10
8
9
7
6
13
11
15
12
14
19
20
16
17
18
21
23
22
25
24
26
30
29
27
28
35
31
33
34
32
36
40
39
37
38
41
45
43
42
44

output:

3
9

result:

ok 2 lines

Test #61:

score: 0
Accepted
time: 1ms
memory: 6036kb

input:

45
5
3
2
4
6
8
1
7
9
18
13
15
12
17
11
14
10
16
26
25
27
24
22
23
21
20
19
33
30
36
28
32
31
35
29
34
42
44
39
43
38
37
45
41
40

output:

5

result:

ok single line: '5'

Test #62:

score: 0
Accepted
time: 1ms
memory: 6004kb

input:

45
2
8
10
14
4
13
12
3
7
11
9
15
1
5
6
27
28
30
23
18
24
16
20
29
25
19
26
21
22
17
43
32
44
34
31
33
40
42
36
35
45
41
38
39
37

output:

3

result:

ok single line: '3'

Test #63:

score: 0
Accepted
time: 1ms
memory: 5632kb

input:

45
13
31
29
39
27
32
44
33
34
38
5
22
4
6
14
16
18
25
7
3
24
21
43
19
12
2
40
1
36
45
10
37
23
42
20
26
35
9
17
41
30
11
8
28
15

output:

-1

result:

ok single line: '-1'

Test #64:

score: 0
Accepted
time: 1ms
memory: 5772kb

input:

47
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

output:

47

result:

ok single line: '47'

Test #65:

score: 0
Accepted
time: 1ms
memory: 5780kb

input:

47
12
10
33
38
20
7
42
35
32
31
27
41
30
15
13
17
5
14
28
37
47
4
6
25
2
24
45
16
40
36
29
22
3
46
21
23
9
44
34
26
43
19
11
8
39
18
1

output:

-1

result:

ok single line: '-1'

Test #66:

score: 0
Accepted
time: 0ms
memory: 5812kb

input:

48
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

output:

2
3
4
6
8
12
16
24
48

result:

ok 9 lines

Test #67:

score: 0
Accepted
time: 0ms
memory: 5756kb

input:

48
2
1
3
4
6
5
8
7
10
9
11
12
13
14
16
15
17
18
20
19
22
21
24
23
26
25
27
28
30
29
31
32
34
33
36
35
38
37
39
40
42
41
43
44
45
46
48
47

output:

2
3
4
6
8
12
24

result:

ok 7 lines

Test #68:

score: 0
Accepted
time: 0ms
memory: 5836kb

input:

48
3
2
1
4
5
6
9
8
7
12
10
11
14
13
15
18
17
16
19
21
20
23
24
22
27
26
25
28
29
30
31
32
33
36
34
35
37
38
39
40
42
41
45
43
44
46
48
47

output:

2
4
8
16

result:

ok 4 lines

Test #69:

score: 0
Accepted
time: 1ms
memory: 5812kb

input:

48
3
4
1
2
6
5
8
7
12
9
10
11
14
15
13
16
19
18
20
17
22
23
21
24
25
27
26
28
29
30
31
32
34
35
36
33
39
40
37
38
42
44
41
43
45
47
46
48

output:

2
3
4
6
12

result:

ok 5 lines

Test #70:

score: 0
Accepted
time: 1ms
memory: 5768kb

input:

48
3
1
4
2
6
5
8
10
7
9
11
12
15
17
16
13
18
14
21
22
19
20
23
24
28
26
30
25
29
27
34
31
32
36
33
35
42
37
39
40
38
41
43
47
46
48
44
45

output:

2
4
8

result:

ok 3 lines

Test #71:

score: 0
Accepted
time: 1ms
memory: 6004kb

input:

48
4
1
8
2
6
3
5
7
11
15
9
16
12
10
13
14
19
21
24
22
20
23
18
17
31
29
25
26
30
32
27
28
33
38
39
35
40
34
36
37
43
44
46
42
45
48
41
47

output:

2
3
6

result:

ok 3 lines

Test #72:

score: 0
Accepted
time: 1ms
memory: 5752kb

input:

48
5
6
7
12
1
10
11
9
4
8
2
3
20
17
15
18
22
23
21
24
19
16
13
14
33
28
35
26
25
31
36
34
32
29
27
30
38
42
44
45
47
46
39
41
40
48
43
37

output:

2
4

result:

ok 2 lines

Test #73:

score: 0
Accepted
time: 1ms
memory: 6112kb

input:

48
11
6
8
1
7
9
2
4
15
3
16
10
14
13
5
12
20
30
19
18
23
22
17
27
32
28
21
24
31
26
29
25
35
44
39
36
40
42
46
34
43
41
37
47
38
45
33
48

output:

3

result:

ok single line: '3'

Test #74:

score: 0
Accepted
time: 1ms
memory: 5812kb

input:

48
8
24
15
2
20
1
23
6
13
4
10
5
22
21
17
16
11
3
7
14
12
19
9
18
33
48
29
43
45
42
39
30
47
31
32
38
36
44
40
46
35
26
25
28
34
41
27
37

output:

2

result:

ok single line: '2'

Test #75:

score: 0
Accepted
time: 1ms
memory: 5632kb

input:

48
9
15
41
30
4
20
43
44
6
37
3
7
8
27
21
12
39
47
16
23
36
17
18
19
32
2
24
13
34
26
29
22
45
25
38
28
10
14
40
33
31
46
5
11
35
42
1
48

output:

-1

result:

ok single line: '-1'

Test #76:

score: 0
Accepted
time: 1ms
memory: 5752kb

input:

49
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

output:

7
49

result:

ok 2 lines

Test #77:

score: 0
Accepted
time: 1ms
memory: 6008kb

input:

49
3
1
5
4
6
2
7
11
10
13
14
12
9
8
18
17
19
15
21
16
20
22
24
25
26
27
23
28
31
35
32
33
30
29
34
41
39
40
37
42
38
36
44
47
45
49
43
46
48

output:

7

result:

ok single line: '7'

Test #78:

score: 0
Accepted
time: 1ms
memory: 5612kb

input:

49
48
31
8
42
44
10
37
26
39
6
1
11
18
36
27
15
45
46
13
5
49
3
40
4
22
30
38
47
29
16
14
7
35
23
41
32
28
17
24
43
25
34
20
9
33
19
2
21
12

output:

-1

result:

ok single line: '-1'

Test #79:

score: 0
Accepted
time: 1ms
memory: 6112kb

input:

50
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

output:

2
5
10
25
50

result:

ok 5 lines

Test #80:

score: 0
Accepted
time: 1ms
memory: 6116kb

input:

50
2
1
3
4
6
5
7
8
10
9
11
12
14
13
15
16
18
17
19
20
22
21
23
24
26
25
28
27
30
29
31
32
34
33
36
35
38
37
39
40
41
42
43
44
46
45
48
47
49
50

output:

5
25

result:

ok 2 lines

Test #81:

score: 0
Accepted
time: 1ms
memory: 5772kb

input:

50
3
5
1
2
4
8
9
6
10
7
11
14
15
13
12
20
17
16
18
19
25
21
23
22
24
29
30
26
27
28
31
33
35
32
34
38
36
37
40
39
44
41
45
43
42
47
46
50
48
49

output:

2
5
10

result:

ok 3 lines

Test #82:

score: 0
Accepted
time: 1ms
memory: 6036kb

input:

50
3
2
5
10
1
9
4
8
7
6
16
14
20
12
13
17
11
15
19
18
24
27
25
29
22
28
23
21
30
26
32
36
38
34
35
39
40
33
37
31
45
42
46
43
41
47
49
50
48
44

output:

5

result:

ok single line: '5'

Test #83:

score: 0
Accepted
time: 1ms
memory: 5816kb

input:

50
14
9
25
1
15
19
13
10
5
4
6
8
17
20
18
3
11
2
21
23
16
7
12
22
24
31
27
43
40
39
45
33
26
36
34
38
47
46
29
32
37
35
41
42
28
49
48
44
30
50

output:

2

result:

ok single line: '2'

Test #84:

score: 0
Accepted
time: 1ms
memory: 5584kb

input:

50
19
39
43
34
27
18
14
30
4
24
15
38
29
16
6
33
41
49
46
2
36
8
32
5
11
17
10
28
45
12
31
3
47
22
35
26
13
44
9
37
21
25
20
42
7
48
23
1
50
40

output:

-1

result:

ok single line: '-1'

Test #85:

score: 0
Accepted
time: 1ms
memory: 5776kb

input:

2
2
1

output:

-1

result:

ok single line: '-1'

Test #86:

score: 0
Accepted
time: 1ms
memory: 5744kb

input:

2
1
2

output:

2

result:

ok single line: '2'

Test #87:

score: 0
Accepted
time: 0ms
memory: 6112kb

input:

3
1
2
3

output:

3

result:

ok single line: '3'

Test #88:

score: 0
Accepted
time: 1ms
memory: 5580kb

input:

3
1
3
2

output:

-1

result:

ok single line: '-1'

Test #89:

score: 0
Accepted
time: 1ms
memory: 5628kb

input:

3
2
1
3

output:

-1

result:

ok single line: '-1'

Test #90:

score: 0
Accepted
time: 0ms
memory: 5632kb

input:

3
2
3
1

output:

-1

result:

ok single line: '-1'

Test #91:

score: 0
Accepted
time: 1ms
memory: 5552kb

input:

3
3
1
2

output:

-1

result:

ok single line: '-1'

Test #92:

score: 0
Accepted
time: 0ms
memory: 5584kb

input:

3
3
2
1

output:

-1

result:

ok single line: '-1'