[题解]无码专场

\[\color{red}{\text{校长者,真神人也,左马桶,右永神,会执利笔破邪炁,何人当之?}} \\ \begin{array}{|} \hline \color{pink}{\text{The principal is really a god}} \\ \color{pink}{\text{with a closestool on the left and Yongshen on the right}} \\ \color{pink}{\text{holding a sharp pen to pierce the truth}} \\ \color{pink}{\text{Who can resist him? }} \\ \hline \end{array} \\ \begin{array}{|} \hline \color{green}{\text{校長は本当に神であり、左側にトイレ、右側にヨンシェンがあり}} \\ \color{green}{\text{鋭いペンを持って真実を突き刺している。誰が彼に抵抗できるだろうか? }} \\ \hline \end{array} \\ \begin{array}{|} \hline \color{lightblue}{\text{Le principal est vraiment un dieu}} \\ \color{lightblue}{\text{avec des toilettes à gauche et Yongshen à droite}} \\ \color{lightblue}{\text{tenant un stylo pointu pour percer la vérité}} \\ \color{lightblue}{\text{Qui peut lui résister ? }} \\ \hline \end{array} \\ \begin{array}{|} \hline \color{purple}{\text{Der Direktor ist wirklich ein Gott}} \\ \color{purple}{\text{mit einer Toilette links und Yongshen rechts}} \\ \color{purple}{\text{der einen spitzen Stift hält}} \\ \color{purple}{\text{um die Wahrheit zu durchdringen.}} \\ \color{purple}{\text{Wer kann ihm widerstehen? }} \\ \hline \end{array} \\ \begin{array}{|} \hline \color{cyan}{\text{Principalis deus est, Yongshen a dextris cum latrina}} \\ \color{cyan}{\text{acuto stylo ad perforandum veritatem: quis resistet ei? }} \\ \hline \end{array} \\ \color{red}{\text{对曰:“无人,狗欲当之,还请赐教!”}} \\ \newcommand\brak[1]{\left({#1}\right)} \newcommand\Brak[1]{\left\{{#1}\right\}} \newcommand\d[0]{\text{d}} \newcommand\string[2]{\genfrac{\{}{\}}{0pt}{}{#1}{#2}} \newcommand\down[2]{{#1}^{\underline{#2}}} \newcommand\ddiv[2]{\left\lfloor\frac{#1}{#2}\right\rfloor} \newcommand\udiv[2]{\left\lceil\frac{#1}{#2}\right\rceil} \newcommand\lcm[0]{\operatorname{lcm}} \newcommand\set[1]{\left\{{#1}\right\}} \newcommand\ceil[1]{\left\lceil{#1}\right\rceil} \newcommand\floor[1]{\left\lfloor{#1}\right\rfloor} \newcommand\rhs[1]{\;\text{Rhs}\;#1} \newcommand\lhs[1]{\;\text{Lhs}\;#1} \newcommand\Vec[1]{\vec{\mathbf{#1}}} \newcommand\rank[0]{\text{rank}} \]




  \(\mathcal{Back\;To\;The\;Menu}\).

2022-02-23 无码专场

  结果就最后一个题可做一些......这场比赛无码,可恶!

定位系统 / Location

  一个特殊情况:\(n=1\) 时答案为 \(0\),这着实很智障了......

  先随便拿一个点当根,那么所有城市都能被区分的条件是,每个点至多有一个儿子内部没有信号发射器。那么我们可以写出一个很好的 DP,设 \(f(i)\) 表示点 \(i\) 以及其子树能够被区分时,安装的最少监视器个数,那么存在 DP 转移

\[f(u)=\sum_{v\in son}\max\set{f(v),1}-[\brak{\prod_{v\in son} f(v)}=0] \]

  这个东西可以用 DDP 维护,写一发 LCT 就行了,但是这是无码专题。

签到题 / Juice

  劳资签尼玛的到。

  \(40\%\) 的分就是建出来最小割树暴力跑,至于为什么它可以跑过 \(n\le 3000\),是因为这个图天然限定了最大流不超过 \(3\).

  剩下的分我还没想😅

卷王 / Tree

  显然当 \(|S|>3\) 时无解,因为一个点到最远点的距离只有可能为直径的左右两个端点,或者是当两个端点距离相等时为 -1.

  然后我们分成 \(|S|=1,2,3\) 分开构造就行了,具体构造可以看题解。一个比较好的实现是 \(n\) 较小的时候,使用暴力,这样在我们使用构造算法的时候,就可以避免点不够用而出现的特判情况。

posted @ 2022-03-14 22:04  Arextre  阅读(377)  评论(0编辑  收藏  举报