Poj 2092 Grandpa is Famous(基数排序)】的更多相关文章

题目链接:http://poj.org/problem?id=2092 思路分析:先统计数据,在根据Count降序排序,Count相等时按照Num升序排序:再输出Count第二大的所有Num: 代码如下: #include <iostream> #include <string.h> #include <algorithm> using namespace std; #define MAX_N ( 10000 + 20 ) struct Player { int Num…
链接: http://poj.org/problem?id=2092 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=27454#problem/D Grandpa is Famous Time Limit: 2000MS   Memory Limit: 30000K Total Submissions: 7210   Accepted: 3650 Description The whole family was excited by…
Grandpa is Famous Time Limit: 2000MS   Memory Limit: 30000K Total Submissions: 7153   Accepted: 3624 Description The whole family was excited by the news. Everyone knew grandpa had been an extremely good bridge player for decades, but when it was ann…
/* * POJ_2092.cpp * * Created on: 2013年11月1日 * Author: Administrator */ #include <iostream> #include <cstdio> #include <algorithm> using namespace std; const int maxn = 10010; struct people{ int id; int p; }peo[maxn]; bool com_people(con…
稳定凸包问题 要求每条边上至少有三个点,且对凸包上点数为1,2时要特判 巨坑无比,调了很长时间= = //POJ 1228 //稳定凸包问题,等价于每条边上至少有三个点,但对m = 1(点)和m = 2(线段)要特判 //AC 2016-10-15 #include <cstdio> #include <cstdlib> #include <iostream> #include <cmath> #define MAXN 1010 double sqr(dou…
Grandpa's Estate Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 11289   Accepted: 3117 Description Being the only living descendant of his grandfather, Kamran the Believer inherited all of the grandpa's belongings. The most valuable one…
题意:原来一个凸多边形删去一些点后剩n个点,问这个n个点能否确定原来的凸包(1 <= 测试组数t <= 10,1 <= n <= 1000). 题目链接:http://poj.org/problem?id=1228 ——>>初看这题,好别扭,不知道要做什么... 其实,是这样的:先求凸包,然后看凸包每一条边所在直线上有多少个点,至少需要3个. 假设一条边的所在直线只有2个点,那么可适当地在这两个点中间加一个或者几个点,使新图形仍是凸包,这时候就不能确定原来的凸包了. 假…
LINK 题意:给出一个点集,问能否够构成一个稳定凸包,即加入新点后仍然不变. 思路:对凸包的唯一性判断,对任意边判断是否存在三点及三点以上共线,如果有边不满足条件则NO,注意使用水平序,这样一来共线点的包括也较为容易,而极角序对始边和终边的共线问题较为麻烦. /** @Date : 2017-07-17 21:08:41 * @FileName: POJ 1228 稳定凸包.cpp * @Platform: Windows * @Author : Lweleth (SoungEarlf@gma…
Description Being the only living descendant of his grandfather, Kamran the Believer inherited all of the grandpa's belongings. The most valuable one was a piece of convex polygon shaped farm in the grandpa's birth village. The farm was originally se…
题意: 判断凸包是否稳定. 解法: 稳定凸包每条边上至少有三个点. 这题就在于求凸包的细节了,求凸包有两种算法: 1.基于水平序的Andrew算法 2.基于极角序的Graham算法 两种算法都有一个类似下面的语句: for(int i=0;i<n;i++) { while(m > 1 && Cross(ch[m-1]-ch[m-2], p[i]-ch[m-2]) <= 0) m--; ch[m++] = p[i]; } 这样的话,求出来就是最简凸包,即点数尽量少的凸包,因…