
容斥原理
lqybzx
123
展开
-
bzoj 3622: 已经没有什么好害怕的了
DescriptionInputOutputSample Input4 25 35 15 4540 20 10 30Sample Output4HINT学姐走好_(:з」∠)_容斥+DPf[i][j]表示前i个有j对大于药片。剩下i-j对情况随意的种数f[i][j]=f[原创 2014-11-30 11:51:25 · 852 阅读 · 0 评论 -
2016中国大学生程序设计竞赛 - 网络选拔赛 1007 Mountain hdu5838
Problem DescriptionZhu found a map which is a N∗M rectangular grid.Each cell has a height and there are no two cells which have the same height. But this map is too old to get the clear informat原创 2016-08-15 17:30:57 · 762 阅读 · 0 评论 -
bzoj 2669: [cqoi2012]局部极小值
Description有一个n行m列的整数矩阵,其中1到nm之间的每个整数恰好出现一次。如果一个格子比所有相邻格子(相邻是指有公共边或公共顶点)都小,我们说这个格子是局部极小值。给出所有局部极小值的位置,你的任务是判断有多少个可能的矩阵。Input输入第一行包含两个整数n和m(1nmn行每行m个字符,其中“X”表示局部极小值,“.”表示非局部极小值。 Out原创 2016-08-15 17:42:17 · 620 阅读 · 0 评论 -
2016多校训练Contest4: 1005 Lucky7 hdu5768
Problem DescriptionWhen ?? was born, seven crows flew in and stopped beside him. In its childhood, ?? had been unfortunately fall into the sea. While it was dying, seven dolphins arched its body a原创 2016-07-30 22:16:30 · 436 阅读 · 0 评论 -
2017多校训练Contest2: 1009 TrickGCD hdu6053
Problem DescriptionYou are given an array A , and Zhu wants to know there are how many different array B satisfy the following conditions?* 1≤Bi≤Ai* For each pair( l , r ) (1≤l≤r≤n) ,原创 2017-08-16 15:49:23 · 305 阅读 · 0 评论