poj 1687 Buggy Sat 简单计算几何
暑期集训出的第一道一血 感觉自己萌萌哒……
这道题本身并没有坑点 仅仅是翻译巨坑……
解大腿在做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 简单计算几何的更多相关文章
- 2018.07.04 POJ 1654 Area(简单计算几何)
Area Time Limit: 1000MS Memory Limit: 10000K Description You are going to compute the area of a spec ...
- 2018.07.04 POJ 3304 Segments(简单计算几何)
Segments Time Limit: 1000MS Memory Limit: 65536K Description Given n segments in the two dimensional ...
- ●POJ 1556 The Doors(简单计算几何+最短路)
●赘述题目 10*10的房间内,有竖着的一些墙(不超过18个).问从点(0,5)到(10,5)的最短路. 按照输入样例,输入的连续5个数,x,y1,y2,y3,y4,表示(x,0--y1),(x,y2 ...
- 2018.07.04 POJ 2398 Toy Storage(二分+简单计算几何)
Toy Storage Time Limit: 1000MS Memory Limit: 65536K Description Mom and dad have a problem: their ch ...
- 2018.07.03 POJ 2318 TOYS(二分+简单计算几何)
TOYS Time Limit: 2000MS Memory Limit: 65536K Description Calculate the number of toys that land in e ...
- 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 ...
- POJ 2031 Building a Space Station【最小生成树+简单计算几何】
You are a member of the space station engineering team, and are assigned a task in the construction ...
- POJ 1163 The Triangle(简单动态规划)
http://poj.org/problem?id=1163 The Triangle Time Limit: 1000MS Memory Limit: 10000K Total Submissi ...
- POJ 1066 Treasure Hunt(计算几何)
题意:给出一个100*100的正方形区域,通过若干连接区域边界的线段将正方形区域分割为多个不规则多边形小区域,然后给出宝藏位置,要求从区域外部开辟到宝藏所在位置的一条路径,使得开辟路径所需要打通的墙壁 ...
随机推荐
- Xsser
来源:https://www.cqhacker.cn/post-174.html XSSer使用说明 =============================================== ...
- niceScroll接口大全
Query滚动条插件兼容ie6+.手机.ipad http://www.areaaperta.com/nicescroll/ jQuery(function($){ $("#scrollIn ...
- 启动Mysql报错:Another MySQL daemon already running with the same unix socket.
启动Mysql报错: Another MySQL daemon already running with the same unix socket. 删除如下文件即可解决 /var/lib/mysql ...
- 链表中LinkList L与LinkList *L 借鉴
链表中LinkList L与LinkList *L的区别以及(*L).elem,L.elem L->next,(*L)->next的区别typedef struct Node{int el ...
- Json字符串转Json对象
public partial class _Default : System.Web.UI.Page{ protected void Page_Load(object sender, Event ...
- 三大框架之hibernate的反转
选择工程.包名 Finish
- 怎样取json对应的值
{ "轮胎1":[{"数量": "1","型号": "195 65R15","售价&quo ...
- 用SqlBulkCopy批量插入数据到SqlServer数据库表中
首先创建一个数据库连接类:SQLHelper using System; using System.Collections.Generic; using System.Linq; using Syst ...
- java多线程并发编程
Executor框架 Executor框架是指java 5中引入的一系列并发库中与executor相关的一些功能类,其中包括线程池,Executor,Executors,ExecutorService ...
- JQuery常用API 核心 效果 JQueryHTML 遍历 Event事件
JQuery 常用API 参考资料:JQuery 官网 jQuery API 中文文档 核心 jQuery 对象 jQuery() 返回匹配的元素集合,无论是通过在DOM的基础上传递的参数还是创建 ...