暑期集训出的第一道一血 感觉自己萌萌哒……

这道题本身并没有坑点 仅仅是翻译巨坑……

解大腿在做B 安学长在做E 我闲着也没事 就一个词一个词翻译F……

最后感觉……

题干大多数都看不懂……

也都没啥用……

大概呢……

就是给你n个点……

m条回路……

问你哪条回路是最外面的……

总之最后就是让你求哪个回路组成的图形面积最大……

考点就是多边形面积公式……

怕有误差就没加/2……

好像加了也能过吧……

WA了两次 一次是选错点了 一次是第一个点和最后一个点顺序反了……

 #include<stdio.h>
#include<string.h>
struct point{
int x,y;
}p[];
int area(point a,point b){
return ((a.x*b.y)-(b.x*a.y));
}
int main(){
int T;
scanf("%d",&T);
while(T--){
int n;
scanf("%d",&n);
for(int i=;i<=n;i++)
scanf("%d%d",&p[i].x,&p[i].y);
int m,q;
int s[];
int maxn=-;
int flag;
scanf("%d",&m);
for(int i=;i<=m;i++){
scanf("%d",&q);
int now=;
scanf("%d",&s[]);
for(int j=;j<q;j++){
scanf("%d",&s[j]);
now+=area(p[s[j-]],p[s[j]]);
}
now+=area(p[s[q-]],p[s[]]);
if(now>maxn){
maxn=now;
flag=i;
}
}
printf("%d\n",flag);
}
return ;
}

poj 1687 Buggy Sat 简单计算几何的更多相关文章

  1. 2018.07.04 POJ 1654 Area(简单计算几何)

    Area Time Limit: 1000MS Memory Limit: 10000K Description You are going to compute the area of a spec ...

  2. 2018.07.04 POJ 3304 Segments(简单计算几何)

    Segments Time Limit: 1000MS Memory Limit: 65536K Description Given n segments in the two dimensional ...

  3. ●POJ 1556 The Doors(简单计算几何+最短路)

    ●赘述题目 10*10的房间内,有竖着的一些墙(不超过18个).问从点(0,5)到(10,5)的最短路. 按照输入样例,输入的连续5个数,x,y1,y2,y3,y4,表示(x,0--y1),(x,y2 ...

  4. 2018.07.04 POJ 2398 Toy Storage(二分+简单计算几何)

    Toy Storage Time Limit: 1000MS Memory Limit: 65536K Description Mom and dad have a problem: their ch ...

  5. 2018.07.03 POJ 2318 TOYS(二分+简单计算几何)

    TOYS Time Limit: 2000MS Memory Limit: 65536K Description Calculate the number of toys that land in e ...

  6. 2018.07.03 POJ 2653 Pick-up sticks(简单计算几何)

    Pick-up sticks Time Limit: 3000MS Memory Limit: 65536K Description Stan has n sticks of various leng ...

  7. POJ 2031 Building a Space Station【最小生成树+简单计算几何】

    You are a member of the space station engineering team, and are assigned a task in the construction ...

  8. POJ 1163 The Triangle(简单动态规划)

    http://poj.org/problem?id=1163 The Triangle Time Limit: 1000MS   Memory Limit: 10000K Total Submissi ...

  9. POJ 1066 Treasure Hunt(计算几何)

    题意:给出一个100*100的正方形区域,通过若干连接区域边界的线段将正方形区域分割为多个不规则多边形小区域,然后给出宝藏位置,要求从区域外部开辟到宝藏所在位置的一条路径,使得开辟路径所需要打通的墙壁 ...

随机推荐

  1. Gentoo/Arch常用软件配置

    ## Desktop Environment ### GNOME ### KDE ### LXDE ### Xfce ## Window Managers ### dwm x11-wm/dwm ### ...

  2. centos6.5 安装python3.5

    1.CentOS6.5 安装Python 的依赖包 yum groupinstall "Development tools" yum install zlib-devel bzip ...

  3. Vim插件之Command-T使用问题

    最近在使用vim插件CommandT时出现问题其实就是vim没有支持ruby,不过google之后找到了解决方法,老外的态度还是很让人敬佩的,度娘搜索的结果太让人呕心了.. 贴下,以后再次遇到解决. ...

  4. IIS 发布程序,无法输出EXCEL 问题处理

    [解决方案1] 1:在服务器上安装office的Excel软件. 2:在"开始"->"运行"中输入dcomcnfg.exe启动"组件服务&quo ...

  5. html css jquery 回到顶部按钮

    今天做了个回到顶部的功能,在这里记录一下,有需要可以拿去试试! CSS部分,很简单就一个class /*回到顶部*/ .back-top { position: fixed; right: 15px; ...

  6. 谷歌游览器对<input type='file'> change只能响应1次解决和样式的改变

    在项目过程中遇到的需要上传本地文件,file的原始控件不太美观,但是这个控件和button有点不太一样, 改变这个样式的思路就是在控件外面套一层链接,然后把file控件的透明度设置为0(透明).样式只 ...

  7. CodeForces 675E Trains and Statistic

    贪心,递推,线段树,$RMQ$. 假设我们记$ans[i]$是以$i$点为起点对答案的贡献,那么答案就是$\sum\limits_{i = 1}^n {ans[i]}$. $ans[i]$怎么计算呢? ...

  8. myeclipse2014安装aptana3.4.0插件

    1.下载aptana3.4.0_eclipse的zip包  http://pan.baidu.com/s/1qXOiZl6 2.打开myeclipse2014,选择help→install from ...

  9. iOS CGRectGetMaxY/CGRectGetMaxX

    在iOS的界面布局中我们可以使用CGRectGetMaxX 这个方法来方便的获取当前控件的x坐标值+宽度的数值,这样便可以方便布局. 同理CGRectGetMaxY是获取y坐标值+控件高度的值,当然这 ...

  10. mysql近几天的查询

    今天:select*from table1 where to_days(时间字段名)=to_days(now()); 昨天:select*from table1 where to_days(now() ...