QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#797288#9806. Growing TreeNailongGroupTL 1184ms3836kbC++204.0kb2024-12-02 20:13:122024-12-02 20:13:13

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3764kb

input:

3
2
1 2 4 3 2 1
2
1 2 3 3 2 1
2
1 2 3 3 1 1

output:

1
2
-1

result:

ok 3 number(s): "1 2 -1"

Test #2:

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

input:

94
5
44 65 38 61 64 94 71 53 65 10 24 36 98 74 11 4 5 46 72 34 9 24 37 32 76 29 48 88 17 14 36 4 22 6 71 53 24 61 89 79 39 57 99 61 27 85 99 46 81 75 90 25 16 13 1 87 55 81 56 78 67 2
3
83 3 74 14 45 17 22 41 62 74 25 1 56 22
7
21 73 83 99 3 91 16 53 8 10 49 29 54 81 45 10 12 68 32 9 30 11 99 85 73 ...

output:

2
0
-1
2
0
1
-1
0
0
3
0
0
0
1
2
1
0
2
0
1
0
-1
0
-1
0
0
-1
-1
-1
-1
-1
4
-1
0
3
2
7
-1
-1
-1
1
2
4
0
0
2
7
1
6
0
-1
2
-1
0
0
0
-1
1
-1
-1
0
0
1
1
-1
0
1
2
0
-1
0
0
1
1
-1
0
-1
0
0
0
-1
3
-1
1
7
0
0
0
0
1
0
-1
3
3

result:

ok 94 numbers

Test #3:

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

input:

1
10
100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 10000...

output:

-1

result:

ok 1 number(s): "-1"

Test #4:

score: 0
Accepted
time: 4ms
memory: 3836kb

input:

1000
7
50000000 50000000 50000000 50000000 50000000 50000000 50000000 50000000 50000000 50000000 50000000 50000000 50000000 50000000 50000000 50000000 50000000 50000000 50000000 50000000 50000000 50000000 50000000 50000000 50000000 50000000 50000000 50000000 50000000 50000000 50000000 50000000 50000...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
...

result:

ok 1000 numbers

Test #5:

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

input:

1000
6
50000001 50000000 49999999 50000001 49999999 50000001 49999999 50000001 49999999 50000000 50000001 50000001 50000000 49999999 50000001 50000000 49999999 49999999 50000001 50000001 50000001 49999999 50000001 49999999 50000001 50000000 50000001 50000001 50000001 50000000 50000000 49999999 50000...

output:

-1
2
3
1
-1
-1
-1
-1
1
1
-1
-1
2
-1
0
0
0
-1
1
-1
-1
1
-1
0
1
-1
-1
2
-1
-1
-1
-1
1
-1
2
-1
-1
1
1
-1
1
0
2
-1
-1
-1
3
-1
-1
1
2
1
1
2
-1
-1
-1
3
-1
-1
-1
-1
3
-1
-1
-1
-1
1
-1
-1
-1
-1
2
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
2
2
-1
-1
-1
0
-1
-1
0
3
-1
-1
-1...

result:

ok 1000 numbers

Test #6:

score: 0
Accepted
time: 6ms
memory: 3616kb

input:

1000
7
50000001 50000001 50000001 49999999 50000002 49999999 49999999 50000001 49999999 49999998 50000002 50000000 50000000 50000002 49999998 50000000 50000001 49999999 50000001 49999998 50000000 49999998 49999999 49999998 50000001 50000000 49999999 49999999 49999998 49999999 50000000 49999999 50000...

output:

-1
-1
1
2
-1
-1
-1
0
-1
-1
-1
-1
-1
-1
-1
-1
-1
0
2
0
0
-1
1
1
-1
1
-1
2
0
-1
-1
-1
-1
0
-1
1
4
-1
3
-1
-1
2
-1
2
2
0
-1
0
-1
-1
-1
0
-1
1
-1
-1
-1
3
2
-1
3
1
-1
-1
-1
-1
-1
-1
-1
-1
1
1
2
1
1
-1
-1
-1
-1
0
-1
-1
0
4
-1
-1
1
-1
-1
-1
1
-1
-1
2
1
-1
-1
2
-1
1
1
-1
-1
0
-1
-1
3
-1
-1
0
-1
1
-1
-1
-1
-...

result:

ok 1000 numbers

Test #7:

score: 0
Accepted
time: 11ms
memory: 3620kb

input:

1000
1
50000002 50000004
6
49999995 49999996 50000000 49999998 49999997 49999998 50000002 49999998 50000003 49999998 49999995 50000001 49999998 50000005 49999999 50000001 49999995 49999995 49999996 50000002 49999997 50000005 49999998 49999996 49999998 50000002 50000003 49999996 50000004 49999998 500...

output:

0
-1
-1
-1
0
1
-1
0
-1
-1
-1
0
2
3
-1
-1
-1
4
-1
-1
0
-1
0
-1
-1
1
0
-1
3
2
1
0
3
0
-1
-1
0
1
0
2
-1
-1
-1
0
3
1
0
0
3
-1
-1
2
-1
-1
-1
0
1
1
1
1
1
-1
2
-1
-1
-1
2
-1
0
-1
-1
0
2
-1
0
-1
2
1
2
-1
-1
-1
1
-1
0
-1
-1
-1
-1
4
-1
-1
-1
-1
-1
-1
4
0
-1
-1
-1
-1
0
2
2
-1
0
-1
-1
0
0
1
0
-1
0
0
-1
0
0
3
-1...

result:

ok 1000 numbers

Test #8:

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

input:

1000
7
50000005 50000000 50000005 49999994 49999998 49999996 50000002 49999998 49999999 49999999 50000004 49999995 50000009 49999995 49999997 50000000 49999992 50000006 50000003 50000008 50000003 49999991 49999998 50000001 49999997 49999990 50000007 49999998 50000007 49999999 50000009 49999998 49999...

output:

-1
-1
0
-1
1
-1
-1
0
-1
3
-1
0
-1
0
0
0
-1
2
0
-1
-1
-1
0
1
0
2
-1
0
0
-1
-1
0
0
-1
4
-1
1
1
-1
3
2
0
5
-1
-1
1
-1
0
-1
0
-1
-1
-1
0
1
2
0
-1
0
-1
1
-1
-1
0
-1
0
-1
4
-1
3
-1
1
3
3
-1
2
-1
-1
-1
2
-1
5
0
0
0
-1
-1
2
-1
5
0
-1
-1
0
0
-1
2
0
-1
0
-1
4
0
-1
0
2
0
0
-1
0
-1
-1
1
-1
-1
1
-1
-1
1
1
0
-1
0...

result:

ok 1000 numbers

Test #9:

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

input:

1000
7
49999988 49999986 50000013 50000001 49999982 50000000 50000010 49999984 50000019 50000011 50000001 50000012 50000016 50000009 49999984 49999985 49999989 50000000 50000015 49999981 50000002 50000013 50000001 50000019 50000009 50000007 50000014 49999999 49999997 49999997 49999998 49999996 50000...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
...

result:

ok 1000 numbers

Test #10:

score: 0
Accepted
time: 1184ms
memory: 3816kb

input:

1000
7
49999953 49999968 49999984 49999956 50000008 50000033 49999983 49999989 50000027 49999958 50000036 50000043 50000038 49999957 50000026 49999952 49999955 50000028 49999983 50000008 50000036 50000049 49999985 49999959 49999955 50000012 49999993 49999969 49999997 49999966 50000017 50000022 50000...

output:

-1
-1
-1
-1
6
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
6
-1
-1
-1
6
-1
6
5
-1
-1
-1
7
-1
6
6
-1
-1
6
6
-1
7
-1
6
-1
-1
-1
-1
6
-1
-1
-1
6
-1
-1
6
-1
-1
-1
-1
6
5
-1
-1
5
-1
-1
-1
-1
6
-1
-1
-1
-1
-1
-1
7
-1
7
-1
-1
6
-1
6
6
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
6
-1
6
5
6
-1
4
7
-1
-1
-1
-1
-1
...

result:

ok 1000 numbers

Test #11:

score: -100
Time Limit Exceeded

input:

1000
7
50000069 49999968 49999970 50000014 50000066 50000093 50000078 50000045 49999984 50000042 49999980 49999981 50000100 49999934 49999964 49999984 50000023 49999950 49999929 50000057 49999965 50000095 50000059 49999910 50000014 50000006 50000060 49999991 50000014 49999946 50000072 49999919 49999...

output:

6
4
4
7
4
4
5
4
5
4
4
6
5
6
3
5
6
5
3
4
-1
6
3
4
-1
4
5
4
5
4
6
3
-1
4
3
3
5
5
6
5
5
-1
5
5
3
4
6
5
-1
5
4
-1
5
4
4
6
4
4
3
6
4
2
5
3
4
7
3
5
4
5
4
5
6
6
5
7
-1
4
6
-1
3
6
6
5
-1
3
4
6
5
7
3
5
5
6
3
-1
-1
4
5
5
5
6
-1
4
4
4
3
6
7
5
7
4
4
6
5
-1
-1
4
5
5
7
4
6
4
6
5
6
5
6
4
-1
6
5
6
-1
-1
5
4
5
6
5
5...

result: