hdu-1115-Lifting the Stone
来源:互联网 发布:华硕vm590l参数数据 编辑:程序博客网 时间:2024/05/23 12:05
#include<cstdio>
#include<cmath>
#include<iostream>
using namespace std;
int main()
{
int s,n,i;
double x1,x2,y1,y2,a,b;
cin>>s;
while(s--)
{
double x3,y3,area=0.0,area1=0.0,sumx=0.0,sumy=0.0;
cin>>n;
cin>>x1>>y1;
cin>>x2>>y2;
for(i=2;i<n;i++)
{
cin>>a>>b;
x3=(x1+x2+a);
y3=(y1+y2+b);
area1=((x2-x1)*(b-y1)-(a-x1)*(y2-y1))/2;
area+=area1;
sumx+=x3*area1;
sumy+=y3*area1;
x2=a;
y2=b;
}
printf("%.2lf %.2lf\n",sumx/area/3,sumy/area/3);
}
return 0;
}
0 0
- HDU 1115 Lifting the Stone
- HDU 1115 Lifting the Stone
- hdu-1115-Lifting the Stone
- hdu 1115 Lifting the Stone
- HDU 1115 Lifting the Stone
- HDU 1115 Lifting the Stone
- HDU-Lifting the Stone
- HDU 1115 Lifting the Stone 计算几何
- HDU 1115 Lifting the Stone(多边形重心)
- hdu 1115 Lifting the Stone 多边形面积
- hdu 1115 Lifting the Stone (重心问题)
- 求重心-hdu-1115-Lifting the Stone
- 【多边形重心】hdu 1115 Lifting the Stone
- hdu 1115 Lifting the Stone 计算几何
- HDU 1115 Lifting the Stone(多边形重心)
- hdu 1115 Lifting the Stone【多边形重心】
- hdu 1115 Lifting the Stone【多边形重心】
- HDU 1115 Lifting the Stone (多边形重心)
- VBS---IsNull() 和 IsEmpty() 的区别
- 关于Windows系统环境变量的引用问题
- Apache httpd Server模块开发
- session共享
- 【 操作系统 】第四章——存储器管理
- hdu-1115-Lifting the Stone
- VS2010 error LNK1123: 转换到 COFF 期间失败
- 指针类型与指针类型的转换
- 回文字符串——
- IO-PushBackInputStream、ObjectInputStream、ObjectOutputStream
- C#操作DataTable
- iOS 学习笔记《一》UIScrollView
- 不是技术牛人,如何应聘NB公司
- PHP获取客户端IP