用户工具

站点工具


2022-2023:teams:kunkunkun:2022-nowcoder-4

这是本文档旧的修订版!


2022 牛客暑期多校训练营4

A

B-2D Internet Angel

给出两个同心圆,内圆给出 $𝑛$ 个切点构成的凸多边形,现在在凸多边形与外圆之间随机均匀地选择一个点,求出这个点到这 $𝑛$ 个切点之中最小的距离(路径不跨过任何边界)$𝑋$,求 $𝐸(X^2)$

将图根据原点到凸多边形的每个顶点所作出的射线划分区域,每个区域的点所对应的切点是对应的,求出两条射线的夹角 $\theta_1,\theta_2$ ,以及对应切点夹角 $\alpha$ 即可将每种情况转化为 $\theta_1^\prime=\theta_1-\alpha<0<\theta_2-\alpha=\theta_2^\prime$ 的情况,设当前区域中一点 $(r,\theta)$,此时 $X^2=r^2+R_1^2-2rR_1\cos\theta$,于是有积分 $$ \begin{aligned} A_i=&\int_{\theta_1}^{\theta_2}\mathrm d\theta\int_{R_1\sec\theta}^{R_2} (r^2+R_1^2-2rR_1\cos\theta)\cdot r\,\mathrm dr\\ =&\int_{\theta_1}^{\theta_2}\left[\dfrac14r^4-\dfrac23R_1\cos\theta r^3+\dfrac12R_1^2r^2 \right]_{R_1\sec\theta}^{R_2} \,\mathrm d\theta\\ =&\left(\dfrac14R_2^4+\dfrac12R_1^2R_2^2 \right)(\theta_2-\theta_1)+\int_{\theta_1}^{\theta_2}\left(-\dfrac23R_1R_2^3\cos\theta-\dfrac14R_1^4\sec^4\theta+\dfrac16R_1^4\sec^2\theta\right)\,\mathrm d\theta\\ =&\left(\dfrac14R_2^4+\dfrac12R_1^2R_2^2 \right)(\theta_2-\theta_1)+\left(-\dfrac23R_1R_2^3\right)(\sin\theta_2-\sin\theta_1)+(-\dfrac1{12}R_1^4)(\tan\theta_2\sec^2\theta_2-\tan\theta_1\sec^2\theta_1) \end{aligned} $$ 最后答案即为 $\dfrac{\sum A_i}{S}$,$S$ 为区域总面积。
时间复杂度 $O(n)$

L-Black Hole

求边长为 $𝑎$ 的凸正 $𝑛$ 面体收缩 $𝑘$ 次后的面数和边长。 一次收缩定义为作该几何体所有面中心的三维凸包。

正 $n$ 面体只有五种,每次收缩后有对应关系:$4\rightarrow 4,6\rightarrow 8,8\rightarrow 6,12\rightarrow 20,20\rightarrow 12$
所有的收缩比例都可以通过计算二面角以及正多边形中心到边的距离得到。对任意一个正多面体,用一个平面在恰当的方向去截这个正多面体的一个角,可以得到一个正棱锥,由于每个侧面都是全等的,很容易计算出二面角的三角函数值,稍加运算即可得到收缩比例,即 $$ 4\rightarrow4:\dfrac13,\, 6\rightarrow8:\dfrac{\sqrt{2}}2,\, 8\rightarrow6:\dfrac{\sqrt{2}}3,\, 12\rightarrow20:\dfrac{\sqrt{5}+5}{10},\, 20\rightarrow12:\dfrac{\sqrt{5}+1}6,\, $$ 时间复杂度 $O(Tk)$

2022-2023/teams/kunkunkun/2022-nowcoder-4.1659266887.txt.gz · 最后更改: 2022/07/31 19:28 由 sd_ltt