poj2398】的更多相关文章

poj2398 Toy Storage 链接 poj 题目大意 这道题的大概意思是先输入6个数字:n,m,x1,y1,x2,y2.n代表卡片的数量,卡片竖直(或倾斜)放置在盒内,可把盒子分为n+1块区域,然后分别用0到n表示,m代表玩具的个数,(x1,y1)代表盒子的左上顶点坐标,(x2,y2)代表盒子的右下顶点坐标,接下来的n行,每行都有两个数a,b,(a,y1),(b,y2)分别代表卡片的两个顶点位置,接下来的m行每行两个数从c,d,(c,d),代表玩具放置的坐标,最后让你输出当区域内玩具的…
题目链接:http://poj.org/problem?id=2398 思路RT,和POJ2318一样,就是需要排序,输出也不一样.手工画一下就明白了.注意叉乘的时候a×b是判断a在b的顺时针还是逆时针侧,>0是顺时针测,<0是逆时针侧,本题对应看成右.左侧,特别注意. /* ━━━━━┒ギリギリ♂ eye! ┓┏┓┏┓┃キリキリ♂ mind! ┛┗┛┗┛┃\○/ ┓┏┓┏┓┃ / ┛┗┛┗┛┃ノ) ┓┏┓┏┓┃ ┛┗┛┗┛┃ ┓┏┓┏┓┃ ┛┗┛┗┛┃ ┓┏┓┏┓┃ ┛┗┛┗┛┃ ┓┏┓┏┓…
Mom and dad have a problem: their child, Reza, never puts his toys away when he is finished playing with them. They gave Reza a rectangular box to put his toys in. Unfortunately, Reza is rebellious and obeys his parents by simply throwing his toys in…
题意:同POJ2318 #include<algorithm> #include<cstdio> #include<cstdlib> #include<cstring> using namespace std; struct point { int x, y; }; struct Node { point Low, High; }line[5010]; int Num[5010]; int par[5010]; bool cmp(Node A, Node B…
题解: 计算几何入门题 对每个二分最近的在它右边的杆子 如何判断一个杆子在它右边呢 计算机判断这些要更善于利用点积和叉积 如果叉积为正代表在顺时针方向叉积为负在逆时针 发现要在struct里面重载运算符和struct调用struct 就必须要 Point() {} Point(int x1,int y1) { x=x1; y=y1; } 代码: #include <cstdio> #include <iostream> #include <algorithm> #inc…
Toy Storage Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 5968   Accepted: 3573 Description Mom and dad have a problem: their child, Reza, never puts his toys away when he is finished playing with them. They gave Reza a rectangular box…
Toy Storage Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 4243   Accepted: 2517 Description Mom and dad have a problem: their child, Reza, never puts his toys away when he is finished playing with them. They gave Reza a rectangular box…
接替关键:和上题类似,输出不同,注意输入这道题需要排序. #include<cstdio> #include<cstring> #include<algorithm> #include<cstdlib> #include<cmath> #include<iostream> using namespace std; typedef long long ll; struct point{ int x,y; }; int n,m,x1,x2…
POJ2318 本题需要运用to left test不断判断点处于哪个分区,并统计分区的点个数(保证点不在边界和界外),用来做叉积入门题很合适 //计算几何-叉积入门题 //Time:157Ms Memory:828K #include<iostream> #include<cstring> #include<cstdio> #include<algorithm> using namespace std; #define MAXN 5005 struct P…
ACM训练计划建议 From:freecode#  Date:2015/5/20 前言: 老师要我们整理一份训练计划给下一届的学弟学妹们,整理出来了,费了不少笔墨,就也将它放到博客园上供大家参考. 菜鸟之作,大牛勿喷,如有不当或补充之处,欢迎指出. 本建议书分为三个阶段,大一.大二.大三.大四暂没整理,一方面是大四要面临考验和找工作的问题,坚持继续acm的很少,另一方面,本人还没大四…… 下面以个人经验分析一下这三个阶段建议学习的内容和具体的训练计划. 正文: 大一(第一阶段): 大一是时间最充…