QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#779067#5277. Limited SwapsZhaoZiLongWA 1ms3836kbC++201.6kb2024-11-24 17:19:092024-11-24 17:19:10

詳細信息

Test #1:

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

input:

5
1 3 5 2 4
3 5 1 4 2

output:

3
1 2 4 

result:

ok OK, found solution, n = 5, ops = 3

Test #2:

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

input:

4
1 2 3 4
4 3 2 1

output:

-1

result:

ok OK, no solution

Test #3:

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

input:

1
1
1

output:

0

result:

ok OK, found solution, n = 1, ops = 0

Test #4:

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

input:

2
1 2
2 1

output:

-1

result:

ok OK, no solution

Test #5:

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

input:

2
1 2
1 2

output:

0

result:

ok OK, found solution, n = 2, ops = 0

Test #6:

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

input:

3
3 2 1
3 1 2

output:

-1

result:

ok OK, no solution

Test #7:

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

input:

3
1 2 3
1 2 3

output:

0

result:

ok OK, found solution, n = 3, ops = 0

Test #8:

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

input:

4
4 2 3 1
3 4 2 1

output:

-1

result:

ok OK, no solution

Test #9:

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

input:

4
3 2 4 1
3 2 1 4

output:

1
3 

result:

ok OK, found solution, n = 4, ops = 1

Test #10:

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

input:

5
4 3 2 1 5
4 1 5 2 3

output:

-1

result:

ok OK, no solution

Test #11:

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

input:

5
3 2 4 5 1
3 4 2 5 1

output:

1
2 

result:

ok OK, found solution, n = 5, ops = 1

Test #12:

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

input:

6
6 3 2 1 4 5
3 6 1 5 4 2

output:

-1

result:

ok OK, no solution

Test #13:

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

input:

6
6 5 2 4 3 1
6 2 5 4 3 1

output:

1
2 

result:

ok OK, found solution, n = 6, ops = 1

Test #14:

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

input:

7
7 2 5 1 4 6 3
6 2 7 3 4 5 1

output:

-1

result:

ok OK, no solution

Test #15:

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

input:

7
6 3 5 2 4 7 1
6 7 3 5 2 1 4

output:

7
5 4 3 2 4 3 6 

result:

wrong answer Trying to swap elements 3 and 2 on 0-based indices 2 and 3 on step 5