Binary Tree Traversals Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 16273 Accepted Submission( ...
分类:
其他好文 时间:
2020-04-25 10:36:06
阅读次数:
49
题目 不超过 $n$ 个球放入 $m$ 个盒子方案数,盒子可以为空,求方案数。 题解 网上有很多使用公式推导的方法,这里介绍一种纯隔板法分析的思路。 首先分析一个子问题:将 $x$ 个球放进 $y$ 个盒子的方案数,盒子可以为空。 由于 $y 1$ 个板隔开 $y$ 段,那么 $y$ 个盒子等价于 ...
分类:
其他好文 时间:
2020-04-22 21:27:50
阅读次数:
78
题目描述 #define xhxj (Xin Hang senior sister(学姐))If you do not know xhxj, then carefully reading the entire description is very important.As the stronges ...
分类:
其他好文 时间:
2020-04-22 11:33:54
阅读次数:
83
F - F HDU - 2647 拓扑排序,从上往下回溯,挺好奇差分约束为啥就不对。拓扑排序有明显的优先级。 #include<bits/stdc++.h> using namespace std; #define pb push_back typedef long long ll; const i ...
分类:
其他好文 时间:
2020-04-22 00:02:10
阅读次数:
67
D D HDU 3282 思路 题意:给我一个奇数长度为n的序列,从左到右依次输出 1~当前技术位置的 这个子区间内的中位数。 思路 1 .法一: 维护一个最小根堆、最大根堆(注意less 在priority_queue 中的数字排列的顺序是按从头部top 按数字大小逐渐递减,而gerater 在p ...
分类:
其他好文 时间:
2020-04-21 12:54:09
阅读次数:
59
I I HDU 3466Proud Merchants(贪心+01背包) Recently, iSea went to an ancient country. For such a long time, it was the most wealthy and powerful kingdom in ...
分类:
其他好文 时间:
2020-04-20 14:04:37
阅读次数:
77
Paths on the treeProblem Descriptionbobo has a tree, whose vertices are conveniently labeled by 1,2,…,n.** There are m paths on the tree. bobo would l ...
分类:
其他好文 时间:
2020-04-19 18:07:45
阅读次数:
62
1.列出所有文件的绝对路径 ls | sed "s:^:`pwd`/:" find $PWD | xargs ls -ld | grep ^- | awk -F' ' '{print $9}' find $PWD | xargs ls -ld 2.查看某个文件的绝对路径 pwd|awk '{prin ...
分类:
系统相关 时间:
2020-04-18 16:02:45
阅读次数:
512
题目链接:Garden of Eden 题意:给定一颗n个节点的树,每个节点有一种颜色,颜色有k种,求树上有多少条路径包含这k种颜色,n<=50000,k<=10 思路:树上路径问题,用点分治求解,又由于k<=10,所以可以用二进制状态表示一条路径上包含的颜色集合,比如状态8转换成二进制为1000, ...
分类:
其他好文 时间:
2020-04-17 00:30:13
阅读次数:
53
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2553 Problem Description 在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。你的任务是,对于给定的 ...
分类:
其他好文 时间:
2020-04-16 19:23:08
阅读次数:
70