zoj 2105 Lifting the Stone
题意 裸的计算几何 求多边形重心;
#include<iostream>
#include<stdio.h>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std; double a,b,c,d,e,f;
double mix( double x,double y,double xx,double yy ){return x*yy - xx*y;}
int main( )
{
int N,T; scanf("%d",&T);
while( T-- )
{
scanf("%d",&N); scanf("%lf%lf%lf%lf",&a,&b,&c,&d);
double sumx = ,sumy = ,suma = ;
for( int i = ; i <= N; i++ )
{
scanf("%lf%lf",&e,&f);
double area = mix(e-a,f-b,c-a,d-b)/2.0;
sumx += (( a+c+e )*area);
sumy += (( b+d+f )*area);
suma += area;
c = e; d = f;
}
sumx = int(sumx/suma/3.0*100000.0);
sumy = int(sumy/suma/3.0*100000.0);
printf("%.2lf %.2lf\n",sumx/100000.0,sumy/100000.0);
}
return ;
}
zoj 2105 Lifting the Stone的更多相关文章
- poj 1115 Lifting the Stone 计算多边形的中心
Lifting the Stone Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u S ...
- Lifting the Stone(hdoj1115)
Lifting the Stone Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others ...
- (hdu step 7.1.3)Lifting the Stone(求凸多边形的重心)
题目: Lifting the Stone Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Other ...
- Lifting the Stone(求多边形的重心—)
Lifting the Stone Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) T ...
- hdu 1115 Lifting the Stone 多边形的重心
Lifting the Stone Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others ...
- Lifting the Stone(hdu1115)多边形的重心
Lifting the Stone Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)To ...
- hdu 1115:Lifting the Stone(计算几何,求多边形重心。 过年好!)
Lifting the Stone Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others ...
- hdu 1115 Lifting the Stone (数学几何)
Lifting the Stone Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others ...
- Lifting the Stone(多边形重心)
Lifting the Stone Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u S ...
随机推荐
- 相对布局RelativeLayout
一. public class RelativeLayout extends ViewGroup java.lang.Object ↳ android.view.View ↳ an ...
- ExtJs之FieldSet和FieldContainer
<!DOCTYPE html> <html> <head> <title>ExtJs</title> <meta http-equiv ...
- WCF分布式开发步步为赢(10):请求应答(Request-Reply)、单向操作(One-Way)、回调操作(Call Back).
WCF除了支持经典的请求应答(Request-Reply)模式外,还提供了什么操作调用模式,他们有什么不同以及我们如何在开发中使用这些操作调用模式.今天本节文章里会详细介绍.WCF分布式开发步步为赢( ...
- badboy 之 查看回放结果
在运行脚本时,Badboy提供了Summary功能方便我们监控回放结果状态,如下Summary view: 以下表格对运行情况的各个维度进行解释: 统计点 描述 Played 运行或回放脚本的次数 S ...
- gridview 绑定方法中带参数
OnClientClick='javascript:OrderDetailShow("<%# Eval('OrderType')%>")' 上面这种方式是错的法一: & ...
- Gradle Goodness: Using and Working with Gradle Version
To get the current Gradle version we can use the gradleVersion property of the Gradle object. This r ...
- Spark基础与Java Api介绍
原创文章,转载请注明: 转载自http://www.cnblogs.com/tovin/p/3832405.html 一.Spark简介 1.什么是Spark 发源于AMPLab实验室的分布式内存计 ...
- for (Map.Entry<Long, Integer> me : zlSendMap.entrySet())
public static void main(String[] args) throws IOException { Map<String,String> map = new HashM ...
- 浅析ODS与EDW关系(转载)
浅析ODS与EDW 关系 刘智琼 (中国电信集团广州研究院广州510630) 摘要 本文重点介绍了企业运营数据仓储(ODS)和企业数据仓库(EDW )的概念,并对ODS与EDW 之间的关系,包括两者相 ...
- 实记JLink刷固件方法
最近J-Link调试程序,不知何故,USB报无法连接,试了别的电脑也是这样.文件存于“百度网盘/05.组装维修/4.单片机/1.JLink-ARM仿真器”下.所有的操作基于WIN7 32位系统. 1. ...