ii. $n \geqslant 5$ is a positive integer, $a_{1}, a_{2}, \ldots, a_{n}, b_{1}, b_{2}, \ldots, b_{n} \geqslant 0$. It is known that
$$
\sum_{i=1}^{n} a_{i}^{2}=1, \sum_{i=1}^{n} b_{i}=1
$$

Find
$$
\sum_{i=1}^{n} a_{i}^{1+b_{i}}
$$

the maximum value.
Solution: The maximum value is $\sqrt{n-1}$.
Lemma: If $x_{1}, x_{2}, y_{1}, y_{2} \geqslant 0$, then
$$
x_{1}^{1+y_{1}}+x_{2}^{1+y_{2}} \leqslant \max \left\{x_{1}^{1+y_{1}+y_{2}}+x_{2}, x_{1}+x_{2}^{1+y_{1}+y_{2}}\right\}
$$

Proof of the lemma: If $x_{1}=0$ or $x_{2}=0$, the lemma is obviously true. Assume $x_{1} \neq 0, x_{2} \neq 0$.
Let $f(t)=x_{1}^{1+y_{1}+t}+x_{2}^{1+y_{2}-t}$, then
$$
f^{\prime \prime}(t)=x_{1}^{1+y_{1}+t}\left(\ln x_{1}\right)^{2}+x_{2}^{1+y_{2}-t}\left(\ln x_{2}\right)^{2} \geqslant 0
$$

Thus, $f$ is a convex function, and its maximum value on $\left[-y_{1}, y_{2}\right]$ must be attained at the endpoints.
$$
\therefore f(0) \leqslant \max \left\{f\left(-y_{1}\right), f\left(y_{2}\right)\right\}
$$

That is, $x_{1}^{1+y_{1}}+x_{2}^{1+y_{2}} \leqslant \max \left\{x_{1}^{1+y_{1}+y_{2}}+x_{2}, x_{1}+x_{2}^{1+y_{1}+y_{2}}\right\}$, the lemma is proved.
By the lemma, $a_{1}^{1+b_{1}}+a_{2}^{1+b_{2}}+\ldots+a_{n}^{1+b_{n}}$
$\leqslant \max \left\{a_{1}^{1+b_{1}+b_{2}}+a_{2}, a_{1}+a_{2}^{1+b_{1}+b_{2}}\right\}+a_{3}^{1+b_{3}}+\ldots+a_{n}^{1+b_{n}}$
$=\max \left\{a_{1}^{1+b_{1}+b_{2}}+a_{2}+a_{3}^{1+b_{3}}, a_{1}+a_{2}^{1+b_{1}+b_{2}}+a_{3}^{1+b_{3}}\right\}+a_{4}^{1+b_{4}}+\ldots+a_{n}^{1+b_{n}}$
$\leqslant \max \left\{a_{1}^{1+b_{1}+b_{2}+b_{3}}+a_{2}+a_{3}, a_{1}+a_{2}^{1+b_{1}+b_{2}+b_{3}}+a_{3}, a_{1}+a_{2}+a_{3}^{1+b_{1}+b_{2}+b_{3}}\right\}+a_{4}^{1+b_{4}}+\ldots+a_{n}^{1+b_{n}}$
$\leqslant \ldots$
$\leqslant \max \left\{a_{1}^{1+\sum_{i=1}^{n} b_{i}}+a_{2}+\ldots+a_{n}, a_{1}+a_{2}^{1+\sum_{i=1}^{n} b_{i}}+\ldots+a_{n}, \ldots, a_{1}+a_{2}+\ldots+a_{n}^{1+\sum_{i=1}^{n} b_{i}}\right\}$ $=\max \left\{a_{1}^{2}+a_{2}+\ldots+a_{n}, a_{1}+a_{2}^{2}+\ldots+a_{n}, \ldots, a_{1}+a_{2}+\ldots+a_{n}^{2}\right\}$
Next, we prove $a_{1}+a_{2}+\ldots+a_{n-1}+a_{n}^{2} \leqslant \sqrt{n-1}$:
$a_{1}+a_{2}+\ldots+a_{n-1}+a_{n}^{2} \leqslant \sqrt{(n-1)\left(a_{1}^{2}+\ldots+a_{n-1}^{2}\right)}+a_{n}^{2}=\sqrt{n-1} \sqrt{1-a_{n}^{2}}+a_{n}^{2}$
Let $g(x)=\sqrt{n-1} \sqrt{1-x}+x, x \in[0,1]$
$$
\begin{array}{c}
g^{\prime}(x)=1-\frac{\sqrt{n-1}}{2 \sqrt{1-x}} \leqslant 1-\frac{\sqrt{n-1}}{2} \leqslant 0 \\
\therefore a_{1}+a_{2}+\ldots+a_{n-1}+a_{n}^{2} \leqslant \sqrt{n-1} \sqrt{1-a_{n}^{2}}+a_{n}^{2}=g\left(a_{n}^{2}\right) \leqslant g(0)=\sqrt{n-1}
\end{array}
$$

Similarly, $a_{1}^{2}+a_{2}+\ldots+a_{n} \leqslant \sqrt{n-1}, a_{1}+a_{2}^{2}+\ldots+a_{n} \leqslant \sqrt{n-1}, \ldots, a_{1}+a_{2}+\ldots+a_{n}^{2} \leqslant \sqrt{n-1}$
$$
\begin{array}{l}
\therefore a_{1}^{1+b_{1}}+a_{2}^{1+b_{2}}+\ldots+a_{n}^{1+b_{n}} \\
\leqslant \max \left\{a_{1}^{2}+a_{2}+\ldots+a_{n}, a_{1}+a_{2}^{2}+\ldots+a_{n}, \ldots, a_{1}+a_{2}+\ldots+a_{n}^{2}\right\} \\
\leqslant \sqrt{n-1} \\
a_{1}=a_{2}=\ldots=a_{n-1}=\frac{1}{\sqrt{n-1}}, a_{n}=0, b_{1}=b_{2}=\ldots=b_{n-1}=0, b_{n}=1 \text { when, } \\
\qquad \sum_{i=1}^{n} a_{i}^{1+b_{i}}=\sqrt{n-1}
\end{array}
$$