【题解】CodeForces-1874/1875

发布时间 2023-10-08 16:43:43作者: SoyTony

CodeForces-1875A Jellyfish and Undertale

一定是等待降到 \(1\) 或者能补满到 \(a\) 时才使用工具,依题意模拟即可。

提交记录:Submission - CodeForces

CodeForces-1874A Jellyfish and Game

这种题目有点思路但是不是很会。

赛时第一发写得根据奇偶性判断,\(k\) 为偶数错了,然后感觉有循环节,写了一发 T 了,之后就改成暴力跑 \(2000\)\(2001\) 组就对了。

首先策略肯定是不换或者最小换最大,容易讨论并证明先手第一次操作可以得到最大值且将最小值换过去,这样后手下一次操作是一定的,之后就循环了。

提交记录:Submission - CodeForces

CodeForces-1875C Jellyfish and Green Apple

实际是要求一个 \(2^kn\bmod m=0\),由于 \(n\) 并不大,因此 \(k\) 应当是 \(O(\log n)\) 级别的,可以暴力算。

也存在无解的情况,这里判断可以二分。

提交记录:Submission - CodeForces

CodeForces-1875D Jellyfish and Mex

设当前的 \(\mathrm{mex}\)\(k\),删除一定删 \([0,k)\) 内的一个数 \(x\),且连续删完所有的 \(x\),删除 \(c\) 个的代价是 \((c-1)k+x\)

\(f_i\) 为当前 \(\mathrm{mex}\)\(i\) 时的最小代价,那么转移:

\[f_i=\min_{j=0}^{i-1}\{f_j+(cnt_j-1)\times i+j\} \]

提交记录:Submission - CodeForces

后面的以后再补。


CodeForces-1874B Jellyfish and Math

提交记录:Submission - CodeForces

CodeForces-1874C Jellyfish and EVA

提交记录:Submission - CodeForces

CodeForces-1874D Jellyfish and Miku

提交记录:Submission - CodeForces

CodeForces-1874E Jellyfish and Hack

提交记录:Submission - CodeForces

CodeForces-1874F Jellyfish and OEIS

提交记录:Submission - CodeForces

CodeForces-1874F Jellyfish and Inscryption

提交记录:Submission - CodeForces