Description
Problem F
Coupons
Input: standard input
Output: standard output
Time Limit: 2 seconds
Memory Limit: 32 MB
Coupons in cereal boxes are numbered 1 to n, and a set of one of each...
分类:
其他好文 时间:
2014-09-04 20:56:10
阅读次数:
536
Radio 和 check boxes是form表单中的一部分,允许用户通过鼠标简单点击就可以选择。当与元素的一般JavaScript操纵相比较,这些表单控件(form controls)的JavaScript操纵可以说是大不相同。一个radio(单选框)与一个复选框(checkbox)的区别在我们...
分类:
编程语言 时间:
2014-09-04 16:32:29
阅读次数:
338
题目大意:有n个独立的磁铁(1-n标号)放在桌上,一个人对这个n堆进行移动操作,然后另外一个人进行询问。
规则:M a b 编号为a的磁铁放在编号为b的磁铁的顶端’
:C a 询问在磁铁a下面的磁铁的数目!
分析:利用并查集,每一堆磁铁看作一个集合,“M a b”就是将a归并到b的上面,每个集合都是有序的,设定三个变量
f:根节点,初始化时...
分类:
其他好文 时间:
2014-09-03 14:59:56
阅读次数:
196
Description
Box Game
There are two identical boxes. One of them contains n balls, while the other box contains one ball. Alice and Bob invented a game with the boxes and bal...
分类:
其他好文 时间:
2014-08-28 09:41:09
阅读次数:
189
这题感觉和POJ 1988 Cube Stacking 很像,在路径压缩的同时递归出来的时候跟新distant数组 1 //#define LOCAL 2 #include 3 #include 4 using namespace std; 5 6 const int maxn = 20000...
分类:
Web程序 时间:
2014-08-24 19:22:02
阅读次数:
211
题意:有编号为1~N的N个小木块,有两种操作M x y 将木块x所在的堆放到木块y所在的堆的上面C x 询问木块x下面有多少块木块代码巧妙就巧妙在GetParent函数中在进行路径压缩的同时,也计算好了该木块对应的under值这个需要好好体会 1 //#define LOCAL 2 #include...
分类:
其他好文 时间:
2014-08-24 10:13:22
阅读次数:
168
题目:uva103 - Stacking Boxes(DAG)
题目大意:给出N个boxes, 并且给出这些箱子的维度,要求找一个最长的序列,能够使得下面的箱子一定能够有个维度序列大于上面的那个箱子的维度序列。例如:A箱子(2 3 4),B箱子(3 4 5),因为有个序列2 3 4 , 3 4 5使得B每个维度的值都大于A,所以A可以在B上面 。
解题思路:DAG。将这些箱子哪...
分类:
其他好文 时间:
2014-08-23 21:42:31
阅读次数:
192
|line-height与line boxes高度撑开行高度的是line-height(line-boxes),而不是字体大小 代码: 效果: 注:如果元素内没有内容,则不会撑开高度,因为line-boxes为0,即使指定了line-height也是不行的,只要有内容,行高就生效(...
分类:
其他好文 时间:
2014-08-19 12:51:44
阅读次数:
245
roblem F
Coupons
Input: standard input
Output: standard output
Time Limit: 2 seconds
Memory Limit: 32 MB
Coupons in cereal boxes are numbered 1 to n, and a set of one of each is...
分类:
其他好文 时间:
2014-08-14 14:04:18
阅读次数:
271
这道题的思路,就是每次记下该点到父结点的个数,并记录下其下的结点个数。之后,每次"C"时,将总的减去它所压的方块,即答案!!!(也是参考别人的~-?)#include#includeusing namespace std;#define max 30010struct node{ int paren...
分类:
其他好文 时间:
2014-08-13 12:57:16
阅读次数:
174