HDOJ 2056 Rectangles】的更多相关文章

Problem Description Given two rectangles and the coordinates of two points on the diagonals of each rectangle,you have to calculate the area of the intersected part of two rectangles. its sides are parallel to OX and OY . Input Input The first line o…
Rectangles    HDOJ(2056) http://acm.hdu.edu.cn/showproblem.php?pid=2056 题目描述:给2条线段,分别构成2个矩形,求2个矩形相交面积. 算法:先用快速排斥判断2个矩形是否相交.若不相交,面积为0.若相交,将x坐标排序去中间2个值之差,y坐标也一样.最后将2个差相乘得到最后结果. 这题是我大一的时候做过的,当时一看觉得很水,写起来发现其实没我想的那么水.分了好几类情况没做出来.今天看了点关于判断线段相交的知识,想起了这题便拿来练…
Rectangles Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 19110    Accepted Submission(s): 6187 Problem Description Given two rectangles and the coordinates of two points on the diagonals of ea…
2047  阿牛的EOF牛肉串 #include<stdio.h> int main(){ int n,i; _int64 s[]; while(~scanf("%d",&n)){ s[]=;s[]=; ;i<=n;i++){ s[i] = s[i-]* + s[i-]*; } printf("%I64d\n",s[n]); } } 2048  神.上帝以及老天爷 #include<stdio.h> int main(){ in…
这个题目很好,变形的题目也很多.简单DP. /* 1510 */ #include <cstdio> #include <cstring> #include <cstdlib> #define MAXN 105 char map[MAXN][MAXN]; int dp[MAXN][MAXN]; int min(int a, int b) { return a<b ? a:b; } int main() { int n; int i, j, k, tmp; int…
#include <iostream> #include <iomanip> #include <cstdlib> using namespace std; struct node { double a, b, c, d; node(){} void add(double a, double b, double c, double d){ this->a = a; this->b = b; this->c = c; this->d = d; }…
FatMouse' Trade Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 56784    Accepted Submission(s): 19009 Problem Description FatMouse prepared M pounds of cat food, ready to trade with the cats g…
Nasty Hacks Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3049    Accepted Submission(s): 2364 Problem Description You are the CEO of Nasty Hacks Inc., a company that creates small pieces of…
Box of Bricks Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 5994    Accepted Submission(s): 2599 Problem Description Little Bob likes playing with his box of bricks. He puts the bricks one up…
Problem Description Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time is guessing the most popular problem. When the contest is over, they will count the balloons of each color…