HDU 2052 Picture】的更多相关文章

http://acm.hdu.edu.cn/showproblem.php?pid=2052 Problem Description Give you the width and height of the rectangle,darw it.   Input Input contains a number of test cases.For each case ,there are two numbers n and m (0 < n,m < 75)indicate the width an…
问题: 開始直接用输入的数作为宽和高,但实际上要多出两行边框,所以要加一个2. 还有题目要求最后要输出一个空行没有注意到. Picture Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 19789    Accepted Submission(s): 10178 Problem Description Give you the wid…
HDU 1828 Picture 题目链接 题意:给定n个矩形,输出矩形周长并 思路:利用线段树去维护,分别从4个方向扫一次,每次多一段的时候,就查询该段未被覆盖的区间长度,然后周长就加上这个长度,4个方向都加完就是答案 代码: #include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int N = 5005; int n; struct Rec { int…
Picture Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 4475    Accepted Submission(s): 2207 Problem Description A number of rectangular posters, photographs and other pictures of the same shap…
http://acm.hdu.edu.cn/showproblem.php?pid=1828 Picture Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2135    Accepted Submission(s): 1134 Problem Description A number of rectangular posters,…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1828 给你n个矩形,让你求出总的周长. 类似面积并,面积并是扫描一次,周长并是扫描了两次,x轴一次,y轴一次.每次加起来的无非都是新加的边(flag为1)或者是新减的边(flag为-1),即加起来的是此时的总长度(T[1].val)减去上一次扫到的总长度(last)的绝对值(T[1].val - last).(注意用c++提交,g++会wa) #include <iostream> #includ…
Picture Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 16038    Accepted Submission(s): 8303 Problem Description Give you the width and height of the rectangle,darw it.   Input Input contains…
1206 Picture  题目来源: IOI 1998 基准时间限制:2 秒 空间限制:131072 KB 分值: 160 难度:6级算法题  收藏  关注 给出平面上的N个矩形(矩形的边平行于X轴和Y轴),求这些矩形组成的所有多边形的周长之和.     例如:N = 7.(矩形会有重叠的地方).   合并后的多边形:     多边形的周长包括里面未覆盖部分方块的周长. Input 第1行:1个数N.(2 <= N <= 50000) 第2 - N + 1行,每行4个数,中间用空格分隔,分别…
Picture Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2144    Accepted Submission(s): 1139 Problem Description A number of rectangular posters, photographs and other pictures of the same shape…
Picture Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 15932    Accepted Submission(s): 8240 Problem Description Give you the width and height of the rectangle,darw it.   Input Input contains…