标签 - 解题记录

? 解题记录 ? ? LOJ ? ? 字典树 ?    2019-03-14 15:26:58    551    0    0
题目链接 题解:发现只需要分两段维护就可以了。 上一次排过序的前缀部分用字典树维护,并且对每一位记录nowxor" role="presentation">nowxornowxornow_xor表示按照当前的顺序,第i" role="presentation">iii位是否被翻转。后面的部分用一个前缀和维护。 这样的话,异或的时候维护偏移值,每一次排序我们就把后面的部分全部插入字典树,并且更新now&#x005F;xor" role="presentation">now_xornow_xornow\_xor。 #include<cstdio&g
? 解题记录 ? ? LOJ ? ? 树链剖分 ? ? FFT|NTT ? ? 动态规划 ?    2019-03-14 11:31:06    735    0    0
题目链接:传送门 题解:不难发现,我们有一个优秀的N2N^2的dpdp做法,记录f(i,j,0/1)f(i,j,0/1)表示ii子树内选jj个,当前根选没选。 我们要知道分治NTTNTT的复杂度:对于kk个总度数∑deg=k\sum deg=k的多项式来说,计算它们乘积的复杂度可以做到:O((∑deg)log(∑deg)logk)O((\sum deg)log(\sum deg)logk)。 因此,我们采用重链剖分,先转移所有轻链。 不难发现, g(u,0)=∏v∈son(g(v,0)+g(v,1))g(u,0)=\prod_{v\in son} (g(v,0)+g(v,1))
? 解题记录 ? ? Topcoder ? ? 构造 ? ? 二分答案 ? ? 贪心 ?    2019-03-09 09:17:46    628    0    0
Easy ForumPostEasy 题意:有一个论坛,告诉你一些文章发布的确切时间和模糊时间,让你推算当前可能的字典序最小的时间。 确切时间就是hh:mm:ss" role="presentation" style="position: relative;">hh:mm:sshh:mm:sshh:mm:ss表示时、分、秒。 模糊时间形如: few&#xA0;seconds&#xA0;ago" role="presentation" style="position: relative;">few seconds agofew s
? 解题记录 ? ? Topcoder ? ? 期望概率 ? ? 数位dp ?    2019-03-08 09:43:01    460    0    0
Easy ReconstructNumber 题意:要构造一个最小的没有前导0的数满足一些条件:对于每一个相邻的数位ai,ai+1" role="presentation" style="position: relative;">ai,ai+1ai,ai+1a_i,a_{i+1}会有&gt;,&lt;,=,!" role="presentation" style="position: relative;">>,<,=,!>,<,=,!>,四种条件分别表示ai" role="presentation" style="position:
? 解题记录 ? ? Topcoder ? ? 动态规划 ? ? 期望概率 ? ? 矩阵快速幂 ?    2019-03-07 21:11:33    455    0    0
Easy RainForecast 题意:n" role="presentation" style="position: relative;">nnn个人依次传递一个布尔变量,第i" role="presentation" style="position: relative;">iii个人有pi" role="presentation" style="position: relative;">pipip_i的概率传错,问最后结果正确的概率是多少。n&#x2264;50" role="presentation" style="position: relative;"&
? 解题记录 ? ? Topcoder ? ? 动态规划 ? ? 数位dp ? ? 亚线性筛 ?    2019-03-04 20:16:33    465    0    0
Easy DigitStringDiv1 题意:给一个串s" role="presentation" style="position: relative;">sss,给定数x" role="presentation" style="position: relative;">xxx,现在擦除s" role="presentation" style="position: relative;">sss的一些字符,问有多少种擦除方法使得s" role="presentation" style="position: relative;">sss组成的数字严格大于x" role=
TCO的神题真的做不动了 不如换换脑袋吧 E Palindromes in a Tree 题意:给你一棵N" role="presentation" style="position: relative;">NNN个点的树,每一个点有一个字母&#x2032;a&#x2032;&#x2212;&#x2032;t&#x2032;" role="presentation" style="position: relative;">′a′−′t′′a′−′t′'a'-'t',对每个点回答有多少经过它的路径是回文的。一条路径回文当且仅当它的
? 解题记录 ? ? Topcoder ? ? 三分法 ? ? 动态规划 ?    2019-03-04 09:40:00    378    0    0
Easy BalancingTrees 题意:给你一棵树,有N" role="presentation">NNN个点,称一棵树为平衡的当对于一棵树的每一个节点来说它的儿子的子树权值和都一样。现在每个点有个权值wi" role="presentation">wiwiw_i,每次可以把一个点的权值+x/&#x2212;x" role="presentation">+x/−x+x/−x+x/-x,代价为x" role="presentation">xxx。问最少花多少代价让这棵树平衡。x&#x2208;R,N&#x2264;250,wi&#x
? 解题记录 ? ? Topcoder ? ? 构造 ? ? 贪心 ? ? 状态压缩 ? ? 动态规划 ?    2019-03-02 10:12:10    598    0    0
Easy Lilypads 题意:一个n&#x00D7;m" role="presentation" style="position: relative;">n×mn×mn\times m的池塘,每一个格子有一片荷叶,一只青蛙从(x,y)" role="presentation" style="position: relative;">(x,y)(x,y)(x,y)开始跳,每一次可以向四个方向中的任何一个方向跳任意距离,但是不能两次往同一个方向跳,输出一种方案让青蛙经过每个格子恰好一次。 n,m&#x2264;50" role="presentation" sty
? 解题记录 ? ? Topcoder ? ? 贪心 ? ? 构造 ?    2019-03-01 19:55:13    337    0    0
Easy NextLuckyNumber 题意:给定整数x" role="presentation" style="position: relative;">xxx,找到比x" role="presentation" style="position: relative;">xxx大的数字d" role="presentation" style="position: relative;">ddd出现了a" role="presentation" style="position: relative;">aaa次的最小的整数。x&#x2264;1017,d&