- 浏览: 32097 次
-
最新评论
文章列表
一。点,线,面,形基本关系,点积叉积的理解
POJ 2318 TOYS(推荐)achttp://acm.pku.edu.cn/JudgeOnline/problem?id=2318POJ 2398 Toy Storage(推荐)achttp://acm.pku.edu.cn/JudgeOnline/problem?id=2398
一个矩形,有被若干直线分成N个格子,给出一个点的坐标,问你该点位于哪个点中。
知识点:其实就是点在凸四边形内的判断,若利用叉积的性质,可以二分求解。
- 2013-07-25 15:17
- 浏览 362
- 评论(0)
题意:
从给定的图中找出某些点,这些点能够消除同一行和同一列的“怪物”。求使得最少的点的位置。
关键:要想消除整张的图的妖怪,必须选中n个点(对于n行n列来说)!!!!!!!!!!!
做法:对于每一行来说都要被消去,则每一行都至少要有一个 ‘ . ’;另外就是如果这种方法不行,则看每一列。
如果每一列都有一个 ' . ',同样也是可行的。
#include<stdio.h>
#include<string.h>
const int maxn = 105;
char mat[ maxn ][ maxn ];
bool vis[ ma ...
- 2013-07-25 15:15
- 浏览 577
- 评论(0)
题意:找出第index 个回文数。
这题是有规律的,即list[]数组。
其次,对于某个 index 可以先精确到 位数 pos,然后在进行分析。
#include<stdio.h>
#include<string.h>
#include<math.h>
typedef __int64 int64;
int64 list[ 24 ];
int ans[ 240 ];
void init(){
list[0] = 0;
list[1] = 9;
list[2] = 9;
list[3] = 90;
...
- 2013-07-25 15:12
- 浏览 322
- 评论(0)
注意:这个矩形是实心!
其余没什么说的。
判断线段与矩形的位置关系
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<algorithm>
using namespace std;
const double eps = 1e-8;
struct Point{
double x,y;
};
struct Rect{
Point p[4];
};
struct Line{
Point a,b;
};
double xmult( Point sp,Poin ...
- 2013-07-25 15:02
- 浏览 423
- 评论(0)
/*
dij+两点间距离
*/
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<algorithm>
#include<iostream>
#include<math.h>
using namespace std;
const int maxn = 205;//point number
const int maxm = 105;//line number
const double inf = 99999999;
const double ep ...
- 2013-07-25 14:59
- 浏览 228
- 评论(0)
/*
给出一个凸多边形的房间,根据风水要求,把两个圆形地毯铺在房间里,不能折叠,不能切割,可以重叠。
问最多能覆盖多大空间,输出两个地毯的圆心坐标。多组解输出其中一个
将多边形的边内移R之后,半平面交区域便是可以放入圆的可行区域
*/
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<algorithm>
using namespace std;
const int maxn = 105;
const int maxm = ...
- 2013-07-25 14:53
- 浏览 324
- 评论(0)