QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#865301#8446. Factor-Full Treeucup-team1005#WA 1ms3712kbC++141.6kb2025-01-21 16:34:082025-01-21 16:34:08

詳細信息

Test #1:

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

input:

5
1 2
1 3
3 4
3 5

output:

1 5 2 6 4

result:

ok correct

Test #2:

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

input:

3
1 3
3 2

output:

1 4 2

result:

ok correct

Test #3:

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

input:

4
2 4
4 1
3 4

output:

1 6 4 2

result:

ok correct

Test #4:

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

input:

5
5 3
2 1
4 5
3 1

output:

1 3 2 8 4

result:

ok correct

Test #5:

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

input:

1

output:

1

result:

ok correct

Test #6:

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

input:

2
2 1

output:

1 2

result:

ok correct

Test #7:

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

input:

60
60 57
41 11
6 11
3 25
26 31
59 25
28 48
15 49
22 34
49 3
1 34
2 12
23 9
20 48
39 52
38 46
57 29
7 36
17 16
56 9
48 25
40 1
18 59
8 3
27 8
44 33
35 25
10 25
14 25
33 26
36 16
58 3
16 1
32 9
4 58
52 54
31 14
53 47
5 27
37 1
11 16
45 57
24 25
54 49
13 24
29 12
55 39
30 15
46 49
12 25
51 9
34 14
47 4...

output:

1 15416 16 1936 5488 944201 907889 112 12508 248 9167 328 10952 4 96 89 8633 1768 195112 2888 1352 158 762988 296 8 11236 784 3496 13448 288 212 888068 595508 2 232 8989 109 800 256 83 980869 7921 15476 31561924 22606088 160 704969 152 32 6728 737972 128 62742241 64 512 838036 551368 176 104 23708824

result:

ok correct

Test #8:

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

input:

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

output:

1 61504 180848704 1376 32 16 896 73408 1696 1408 1504 42632 944 316 4608 256 628864 512 2185454 206 27556 128 2048 1664 36992 15488 194 2287148 584 2544224 976 189833284 2624 332 4096 1536 8 4 1984 1024 1472 33856 536 1280 702848 107584 4410944 29548 10690688 20402 64 59168 1856 202 89888 2176 21218...

result:

ok correct

Test #9:

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

input:

59
3 21
28 35
2 50
29 1
52 38
24 41
13 21
7 43
4 58
32 19
31 46
48 22
46 35
53 11
54 32
45 35
12 46
23 5
19 35
41 11
49 8
39 19
6 8
11 21
57 46
40 44
44 21
30 2
58 44
9 19
34 37
8 45
27 10
25 38
1 5
10 31
33 44
21 35
56 9
16 39
5 31
50 47
17 53
20 19
59 35
37 24
43 48
55 39
15 16
22 6
36 13
26 12
47...

output:

1 5726576 20336 51496208 2 128 2048 64 1904 332 15376 584 21328 4096 38416 5488 21049744 30256 112 2128 496 256 178 14776336 59248 42632 27556 80 97 406586896 4 1456 1375408 14200058896 16 917104 458066416 2576 784 1235536 476656 833776 1024 23312 32 8 1136 512 192 80656 71824 74704 568912 18928 862...

result:

ok correct

Test #10:

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

input:

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

output:

1 262144 6291456 26851025384539 80494592 47 8 541696 16384 12459008 851968 8192 256 23552 32768 1423104345380567 4734976 82 2209 65536 1119130473102767 635973704411 11075584 3362 278528 26214400 74 10779215329 3670016 506623120463 2097152 43 5242880 512 4879681 131072 128 155648 2 107648 23811286661...

result:

ok correct

Test #11:

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

input:

60
42 46
49 47
54 4
38 49
50 60
39 2
30 22
57 32
55 45
19 46
12 33
26 47
3 20
53 15
22 32
9 50
1 12
40 58
46 50
17 7
60 48
35 24
16 19
33 30
59 51
43 59
24 8
2 38
6 23
8 36
41 35
45 7
13 11
28 5
25 49
21 60
14 40
10 1
52 44
56 41
58 13
34 13
7 16
31 37
48 41
5 39
51 52
44 17
18 31
37 5
23 33
15 28
2...

output:

1 32 17179869184 6728 128 2301289 4194304 4096 3407872 2 536870912 37 1073741824 12884901888 67712 2097152 8388608 1024 1048576 8589934592 2228224 1874161 56129 8192 232 124 34359738368 2944 43 50653 512 69343957 1369 5368709120 16384 2048 256 16 64 4294967296 32768 5767168 268435456 16777216 293601...

result:

ok correct

Test #12:

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

input:

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

output:

1 1162261467 33554432 64 131072 4 9 268435456 262144 137438953472 17179869184 2048 6561 43046721 2 129140163 16777216 68719476736 8589934592 34359738368 387420489 536870912 59049 27 3486784401 4294967296 549755813888 2147483648 512 32768 16 1048576 67108864 32 256 2097152 2187 4096 8192 1024 65536 1...

result:

ok correct

Test #13:

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

input:

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

output:

1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576 2097152 4194304 8388608 16777216 33554432 67108864 134217728 268435456 536870912 1073741824 2147483648 4294967296 8589934592 17179869184 34359738368 68719476736 137438953472 274877906944 549755813888 1099...

result:

ok correct

Test #14:

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

input:

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

output:

1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576 2097152 4194304 8388608 16777216 33554432 67108864 134217728 268435456 536870912 1073741824 3221225472 5368709120 7516192768 11811160064 13958643712 18253611008 20401094656 24696061952 31138512896 3328599...

result:

ok correct

Test #15:

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

input:

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

output:

1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576 2097152 4194304 8388608 16777216 33554432 67108864 134217728 268435456 536870912 1073741824 3221225472 5368709120 7516192768 11811160064 13958643712 18253611008 20401094656 24696061952 31138512896 3328599...

result:

ok correct

Test #16:

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

input:

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

output:

1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576 2097152 4194304 8388608 16777216 33554432 100663296 167772160 234881024 369098752 436207616 570425344 637534208 771751936 973078528 1040187392 1241513984 1375731712 1442840576 1577058304 1778384896 197971...

result:

ok correct

Test #17:

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

input:

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

output:

1 2 4 12 20 28 44 52 68 76 92 116 124 148 164 172 188 212 236 244 268 284 292 316 332 356 388 404 412 428 436 8 452 508 524 548 556 596 604 628 652 668 692 716 724 764 772 788 796 844 892 908 916 932 956 964 1004 21316 16 257

result:

ok correct

Test #18:

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

input:

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

output:

1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576 2097152 4194304 8388608 16777216 33554432 67108864 134217728 268435456 536870912 1073741824 2147483648 4294967296 8589934592 17179869184 34359738368 68719476736 137438953472 274877906944 549755813888 1099...

result:

ok correct

Test #19:

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

input:

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

output:

1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576 2097152 4194304 8388608 16777216 33554432 67108864 134217728 268435456 536870912 1073741824 2147483648 4294967296 8589934592 17179869184 34359738368 68719476736 137438953472 274877906944 549755813888 1099...

result:

ok correct

Test #20:

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

input:

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

output:

1 2 6 18 54 162 486 1458 4374 13122 39366 118098 354294 1062882 3188646 9565938 28697814 86093442 258280326 774840978 2324522934 6973568802 20920706406 62762119218 188286357654 564859072962 1694577218886 5083731656658 15251194969974 45753584909922 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 3...

result:

ok correct

Test #21:

score: -100
Wrong Answer
time: 0ms
memory: 3712kb

input:

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

output:

1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576 2097152 4194304 8388608 16777216 33554432 67108864 134217728 268435456 5 25 125 625 3125 15625 78125 390625 1953125 9765625 48828125 244140625 1220703125 6103515625 30517578125 152587890625 762939453125 3...

result:

wrong answer Integer 1490116119384765625 violates the range [1, 10^18]