摘要: Prob. 1 Desc. & Link. 行走的形式是比较自由的,因为只要走到了最优答案处就可以不管了,所以不需要考虑游戏的结束。 考虑二分答案。 然后预处理出每个节点到 \(s\)(另一棵树就是 \(t\))的距离。 判断答案合法性: 首先枚举 \(A\) 树的每个节点(节点编号小于当前二分的答 阅读全文
posted @ 2020-12-01 16:32 cirnovsky 阅读(147) 评论(0) 推荐(1)
摘要: Prob. 1 Desc. & Link. 暴力为 \(\Theta(NK)\)。 正解(也许): 把每一个全为正整数的子段找出来。 然后判断一下中间连接的情况即可。 但是这样决策情况太多了。 我们需要考虑贪心。 把所有整数段的个数记为 \(totP\),每个子段的区间记为 \([posL_{i}, 阅读全文
posted @ 2020-11-28 16:52 cirnovsky 阅读(101) 评论(0) 推荐(1)
摘要: Problem. 1 Junior - Thinking Desc. & Link. 注意到值域乘范围刚好能过。 然后就存两个桶即可。。。(数组开小飞了半天才调出来。。。) Problem. 2 Junior / Senior - Thinking Desc. & Link. 考虑一次反转后对整个序 阅读全文
posted @ 2020-11-27 21:03 cirnovsky 阅读(71) 评论(0) 推荐(0)
摘要: Description Link. 定义一条链的价值为链上点权乘积除以节链上点数,求一条价值最小的链。 Solution 结论:答案链上最多包含一个 \(2\)(其余全为 \(1\)),并且不在链的两端点。 证明:我们问题分成两个 \(\texttt{pass}\)。 \(\texttt{pass 阅读全文
posted @ 2020-11-25 13:19 cirnovsky 阅读(118) 评论(0) 推荐(2)
摘要: Description Link. 求满足 \(\prod _{i=2}^{k} \binom{a_{b_{i-1}}}{a_{b_i}} \mod 2 = \binom{a_{b_1}}{a_{b_2}} \times \binom{a_{b_2}}{a_{b_3}} \times \cdots 阅读全文
posted @ 2020-11-25 13:03 cirnovsky 阅读(115) 评论(0) 推荐(1)
摘要: Description Link. 求 \(\begin{Bmatrix}n \\ m\end{Bmatrix}\bmod2\) Solution 求 \[ \begin{aligned} \begin{Bmatrix}n \\ m\end{Bmatrix}\bmod2 &=\left(\begin 阅读全文
posted @ 2020-11-25 13:02 cirnovsky 阅读(88) 评论(0) 推荐(1)
摘要: Craft Prob. 1 Desc. & Link. 有想法。 printf( "nan" ); Prob.2 Desc. & Link. 没读懂 Prob. 3 Desc. & Link. 定义 \(f_{i,j,0/1}\) 表示个寂寞。 \[ f_{i,i,0/1}=|a_{i}|\time 阅读全文
posted @ 2020-11-21 13:31 cirnovsky 阅读(122) 评论(0) 推荐(1)
摘要: LOC 2020.11.20 - Prob. 1 Desc. & Link. \(C=2^{k}\bmod(a+b+c)\) #include <cstdio> typedef long long LL; int A, B, C, K; int Qkpow( int base, int indx, 阅读全文
posted @ 2020-11-20 21:36 cirnovsky 阅读(146) 评论(0) 推荐(0)
摘要: Part. 1 Stirling Number / FK. Def. 定义 \(\begin{bmatrix}n \\ m\end{bmatrix}\) 表示将 \(n\) 个元素分成 \(m\) 个环的方案数。 递推式为 \[ \begin{bmatrix}n \\ m\end{bmatrix}= 阅读全文
posted @ 2020-11-20 14:12 cirnovsky 阅读(101) 评论(0) 推荐(1)
摘要: Problem. 1 - Junior Julian 模拟模拟模拟摸死 CTR 的母。 考场代码: #include<cstdio> namespace solveIt { void read(int &x) { x=0; char c=getchar(); int f=1; while(c<'0' 阅读全文
posted @ 2020-11-10 21:33 cirnovsky 阅读(216) 评论(0) 推荐(1)