Call a function$$\mathbb{N}\times \mathbb{N}\to \{0, 1\}, \quad (n, m)\to f(n, m)$$computable in polynomial time in $\log n+\log m$ a PTIME family.

Given a PTIME family $f$ call a computable function $g:\mathbb{N}\to \mathbb{N}$ such that $f(n, g(n))=1$ for all $n\in \mathbb{N}$ a solution of $f$.

Is there a PTIME family $f$ that has at least one solution and such that for each solution $g$ and each polynomial $P$ there exists $n\in \mathbb{N}$ such that the running time of $g$ on $n$ is more than $P(\log n+\log g(n))$?

The reason for taking $\log n+\log g(n)$ is to ensure that neither input nor output dominates the running time of the algorithm.

$\log 0=0$ by convention.