The determinant of a matrix $A=a_{i,j}$,$1 \le i,j \le n$ is given by (where $S_n$ is the set of all permutations of $\{1,\ldots,n\}$ and $\operatorname{sgn}(\sigma)$ is the sign of a permutation $\sigma \in S_n$ ($-1$ for odd, $1$ for even)
$$\det(A)=\sum_{\sigma \in S_n}\operatorname{sgn}(\sigma) \prod_{i=1}^n a_{i, \sigma(i)}$$
so an alternating sum of terms, which are each products of $n$ terms.
All these product terms are $0$ or $1$, so the greatest value is achieved when all even permutations yield $1$ while odd permutations yield $0$, e.g. So $\frac{n!}{2}$ is best (not sure if it's reachable though).
With $1,-1$ it's more complicated. Maybe check out this question or this reference
number-theory? – José Carlos Santos Dec 29 '19 at 15:13