
动态规划
文章平均质量分 87
「已注销」
这个作者很懒,什么都没留下…
展开
-
TC SRM673 DIV2 T3 BearPermutations2
前言最近打TC,做到DP的题很多,以树型DP为主。觉得这些题都挺好的,解出来也是用了不少时间。因此,决定写几篇题解在巩固一下。题意给出两个数NNN和MODMODMOD,对于NNN的所有全排列,对于每个全排列建笛卡尔树TTT,定义TTT的分值为其所有有两个子节点的节点两子节点在原排列中索引的差值(非负值)之和。求这个所有TTT的分值之和XXX对MODMODMOD取模后的值。约...原创 2018-07-27 20:10:18 · 252 阅读 · 0 评论 -
TC SRM674 DIV2 T3 VampireTreeDiv2
题面You are a genealogist specializing in family trees of vampires. Vampire family trees differ from human family trees. In particular, there are two ways how a vampire can be “born”:A living human...原创 2018-07-27 21:17:53 · 288 阅读 · 0 评论 -
CF 439E Devu and Birthday Celebration
题目描述给你qqq组询问,对于每组询问给出正整数n,fn,fn,f,求将nnn拆分成fff个正整数相加的形式的方案数,且这fff个正整数的最大公约数为111。答案对109+7109+710^9+7取模。数据范围1≤q≤105,1≤f≤n≤1051≤q≤105,1≤f≤n≤1051\leq q\leq 10^5,\,\, 1\leq f\leq n\leq 10^5分析...原创 2018-08-10 08:58:40 · 321 阅读 · 0 评论 -
TC SRM681 DIV2 T3 XorLists
题意有一个序列AAA,矩阵SSS表示AAA中的元素两两的异或值。即Si,j=AixorAj,0≤i,j≤NSi,j=AixorAj,0≤i,j≤NS_{i,j}=A_i xor A_j,0 \leq i,j \leq N,NNN为序列的元素个数。你的任务是对于给定的SSS,求出满足条件的AAA的个数,满足对于∀Ai∀Ai\forall A_i,都有0≤Ai≤M0≤Ai≤M0 \leq A_i ...原创 2018-08-06 10:24:35 · 248 阅读 · 0 评论 -
HDU4917 Permutation
题目描述 bobo has a permutation p1,p2,...,pnp1,p2,...,pnp_1,p_2,...,p_n of 1,2,...,n1,2,...,n1,2,...,n. Knowingmmmextra constraints of form pai<pbipai<pbip_{a_i}109+7109+710^9+7. It is g...原创 2018-08-06 20:08:07 · 311 阅读 · 0 评论 -
TC SRM566 DIV2 T3 FencingPenguinsEasy
前言头一道计算几何题,现学现用… 题目描述 En Paco collects penguins. His penguins like to play and run around on the ice where he lives. In order to keep his penguins safe he decided to construct a single ...原创 2018-08-27 07:44:01 · 350 阅读 · 0 评论