![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
计数
文章平均质量分 74
丿残念灬
这个作者很懒,什么都没留下…
展开
-
LightOJ-1284 Lights inside 3D Grid (概率&计数)
J - Lights inside 3D Grid LightOJ - 1284 题解:概率计数。因为是求期望值,考虑每个点对答案的贡献:对每个点是亮着的概率求和就是所求期望。 那么每个点亮着的概率为多少呢?根据题意,对于点(x,y,z)只有当被选中的2个点(x1,y1,z1),(x2,y2,z2), 满足x1<=x<=x2且y1<=y<=y...原创 2017-01-22 14:41:28 · 539 阅读 · 0 评论 -
HDU-6338 Problem G. Depth-First Search(计数)
Problem G. Depth-First Search Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 378 Accepted Submission(s): 73 Problem Description Kaz...原创 2018-08-03 01:49:21 · 695 阅读 · 0 评论 -
CodeForces-815B Karen and Test(组合数)
B. Karen and Test time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output Karen has just arrived at school, and she has a math test today...原创 2018-07-28 10:54:09 · 240 阅读 · 0 评论 -
CodeForces-712D Memory and Scores(计数)
D. Memory and Scores time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output Memory and his friend Lexa are competing to get higher score...原创 2018-07-28 10:20:58 · 175 阅读 · 0 评论 -
HDU-6314 Matrix(计数)
Matrix Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 332768/332768 K (Java/Others) Total Submission(s): 449 Accepted Submission(s): 107 Problem Description Samwell Tarly is learning ...原创 2018-07-27 15:23:37 · 354 阅读 · 0 评论 -
HDU-6044 Limited Permutation(计数)
传送门:点这里~题意:对于有n个元素的全排列的合法性定义为:有n个区间,对于第i个区间[li,ri]有li<=i<=ri,对于任意1<=L<=i<=R<=n,当前仅当li<=L<=i<=R<=ri时P[i]=min(P[L],P[L+1],...,P[R])。现在给出序列和相应的区间,问区间是否合法?题解:首先要理解题意:当前仅当li&l...原创 2017-07-26 15:00:04 · 2218 阅读 · 1 评论 -
HDU-6093 Rikka with Number(计数/数位dp)
传送门:HDU-6093 题意:如果一个数在某一进制d下所有位是0~d-1的排列,则称这个数为“好数”,问[L,R]之间有多少个“好数” 题解:计数/数位dp 由于L和R很大(L,R 首先可以猜一个结论:每一个数之多只在一个d进制下能形成0~d-1的全排列。其证明也很简单:如果一个数在d进制下是“好数”,那么这个数一定在(d^(d-1),d^d]之间,因此d进制和d-1进制的区间是原创 2017-08-09 19:46:42 · 336 阅读 · 0 评论 -
HDU-6058 Kanade's sum(计数)
传送门:HDU-6058 题意:一个1~n的全排列,定义f(i,j,k)为在区间[i,j]内第k大的数,求 ∑nl=1∑nr=lf(l,r,k) 题解:对于每个数求自己对答案的贡献,首先要知道Ai在某个数有贡献当且仅当区间内只有k-1个数比Ai大,于是可以从大到小遍历,这样当枚举到A时,比Ai大的数的位置都已知道,这个可以用set进行保存,然后分别枚举Ai左右两边比Ai大的数的个数以及区原创 2017-08-01 19:57:26 · 534 阅读 · 0 评论 -
51Nod-1677 treecent(计数)
给定一棵n个节点的树,从1到n标号。选择k个点,你需要选择一些边使得这k个点通过选择的边联通,目标是使得选择的边数最少。 现需要计算对于所有选择k个点的情况最小选择边数的总和为多少。 样例解释: 一共有三种可能:(下列配图蓝色点表示选择的点,红色边表示最优方案中的边) 选择点{1,2}:至少要选择第一条边使得1和2联通。 选择点{1,3}:至少要选择第二原创 2017-06-20 22:50:22 · 274 阅读 · 0 评论 -
xtu-1265 Longest Common Subsequence(字符串/计数)
Longest Common Subsequence Accepted : 11 Submit : 105 Time Limit : 3000 MS Memory Limit : 65536 KB Longest Common Subsequence Bobo has a sequence A=(a 1 ,a 2原创 2017-05-17 21:41:40 · 315 阅读 · 0 评论 -
Codeforces-788B Weird journey(计数/欧拉回路)
B. Weird journey time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Little boy Igor wants to become a travelle原创 2017-03-31 22:27:43 · 1028 阅读 · 0 评论 -
Nowcoder-2018ACM多校训练营(第五场)D inv
时间限制:C/C++ 2秒,其他语言4秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 题目描述 Kanade has an even number n and a permutation b of all of the even numbers in [1,n] Let a denote an array [1,3,5....n...原创 2018-08-03 15:54:10 · 220 阅读 · 0 评论