1 2 3 4 5 6 7 8 9 10 11 12 13
|
int main()
{
std::vector A1{ 4,3,2,1,5 }, B1{ 0, 1, 0,0,0 };
std::vector A2{ 4,3,2,1,5 }, B2{ 1,1,0,1,0};
std::vector A3{ 4,7,3,1,5,6,2 }, B3{ 0,1,1,0,1,0,1};
std::vector A4{ 5,3,1,9,2,4,6,7,8,10 }, B4{ 0,1,0,0,0,1,1,0,0,1 };
std::vector A5{3,5,2,4,1,7,6}, B5{1,0,1,0,0,1,1};
std::cout << solution(A1,B1) << '\n'; // prints 2
std::cout << solution(A2,B2) << '\n'; // prints 3
std::cout << solution(A3, B3) << '\n'; // prints 5
std::cout << solution(A4, B4) << '\n'; // prints 6
std::cout << solution(A5, B5) << '\n'; // prints 5
}
|