That to understand the compiler behaviour it is important to reference to the following quote from the C++ Standard
2 A using-directive specifies that the names in the nominated namespace can be used in the scope in which the using-directive appears after the using-directive. During unqualified name lookup (3.4.1), the names appear as if they were declared in the nearest enclosing namespace which contains both the using-directive and the nominated namespace. [ Note: In this context, “contains” means “contains directly or indirectly”. —end note ]
In your example "the nearest enclosing namespace which contains both the using-directive and the nominated namespace." is namespace A. That is functions
void f(double x){cout<<"A::f(double)\n";}
void f(string s){cout<<"A::f(string)\n";}
are not members of namespace B for the purpose of the unqualified lookup.
Accotding to other quote from the C++ Standard
1 A name can be hidden by an explicit declaration of that same name in a nested declarative region or derived class (10.2).
these function declarations are hidden by the explicit declaration of f in namespace B. So the compiler found name f in namespace B and it stopped the further search of the name.