UNLOCK PROBLEM(C++ STL challenge)

After submitting my code the interface doesn’t show whether testcase is pased or not.After i remove long long type, only 1 case is passed .
LINK for my code is https://ide.codingblocks.com/s/144419

There is no need to use long long since all the numbers are in range.
Also i can see your code fails for the test case like:
3 2
1 2 3
where best permutation can be formed by less than k swaps. Checkout