Area
http://poj.org/problem?id=1265
#include<cstdio>
#include<istream>
#include<algorithm>
#include<cmath>
int n;
using namespace std;
const int maxn=;
const double pi=acos(-1.0);
int gcd(int a,int b)
{
return b==?a:gcd(b,a%b);
}
struct Point //点的定义
{
double x,y;
Point() {}
Point (double a,double b):x(a),y(b) {}
};
Point a[maxn],b[maxn];
double del(const Point &a,const Point &b)
{
return(a.x*b.y-a.y*b.x);
}
int main()
{
int t,c=; scanf("%d",&t);
while(t--)
{
c++;
scanf("%d",&n);
int xx=,yy=,x,y,num=;
for(int i=; i<n; i++){
scanf("%d%d",&x,&y);
num+=gcd(abs(x),abs(y));
b[i+].x=xx+x;
b[i+].y=yy+y;
xx=b[i+].x;
yy=b[i+].y;
}
double sum=;
b[].x=;
b[].y=;
for(int i=; i<n; i++)
sum+=del(b[i],b[i+]);
printf("Scenario #%d:\n",c);
printf("%d %d %.1lf\n",int(sum/2.0)+-(num/),num,sum/);
printf("\n");
}
}
Area的更多相关文章
- [转]NopCommerce How to add a menu item into the administration area from a plugin
本文转自:http://docs.nopcommerce.com/display/nc/How+to+code+my+own+shipping+rate+computation+method Go t ...
- ASP.NET MVC系列:Area
1. Area简介 ASP.NET MVC Area机制构建项目,可以将相对独立的功能模块切割划分,降低项目的耦合度. 2. Area设置Routing 新建Admin Area后,自动创建Admin ...
- Web API项目中使用Area对业务进行分类管理
在之前开发的很多Web API项目中,为了方便以及快速开发,往往把整个Web API的控制器放在基目录的Controllers目录中,但随着业务越来越复杂,这样Controllers目录中的文件就增加 ...
- MVC View中获取action、controller、area名称
获取控制器名称: ViewContext.RouteData.Values["controller"].ToString(); 获取Action名称: ViewContext.Ro ...
- [LeetCode] Rectangle Area 矩形面积
Find the total area covered by two rectilinear rectangles in a2D plane. Each rectangle is defined by ...
- 如何在Linux上使用文件作为内存交换区(Swap Area)
交换区域(Swap Area)有什么作用? 交换分区是操作系统在内存不足(或内存较低)时的一种补充.通俗的说,如果说内存是汽油,内存条就相当于油箱,交换区域则相当于备用油箱. Ubuntu Linux ...
- MVC 添加Area
在MVC项目中经常会使用到Area来分开不同的模块让项目结构更加的清晰. 步骤如下: 项目 –> 添加 -> 区域 ( Area ) 输入 Admin 添加成功后 Area包含: 创建一个 ...
- ASP.NET MVC 设置Area中 Controller 的方法 默认启动页
MVC中通常分区域编程,互不干扰,如果需要设置某个区域下面的某个控制器下面的某个方法为默认启动页的话,直接修改项目的路由如下: public static void RegisterRoutes(Ro ...
- [ASP.NET MVC 小牛之路]08 - Area 使用
ASP.NET MVC允许使用 Area(区域)来组织Web应用程序,每个Area代表应用程序的不同功能模块.这对于大的工程非常有用,Area 使每个功能模块都有各自的文件夹,文件夹中有自己的Cont ...
- ASP.Net MVC Action重定向跳出Controller和Area
1.重定向方法简介 [HttpPost] public ActionResult StudentList( string StudName, string studName, DateTime Bir ...
随机推荐
- MVC ASPX(webForm)视图引擎 <%:%> 与<%=%>的差别
控制器 using System; using System.Collections.Generic; using System.Linq; using System.Web; using Syste ...
- Androidannotation使用之@Rest与server交互的JSON数据转换(二)
开篇 之前的一篇博客:Androidannotation使用之@Rest获取资源及用户登录验证(一):http://blog.csdn.net/nupt123456789/article/detail ...
- Struts2和Struts1的不同
转载(没看懂) Action 类 ◆Struts1要求Action类继承一个抽象基类org.apache.struts.action.Action.Struts1的一个普遍问题是使用抽象类编程而不是接 ...
- IOS的工程目录结构和生命周期
IOS的工程目录结构和生命周期 ·simple table文件夹:工程相关源代码和配置文件 BIDAppDelegate : 委托的声明和实现 BIDViewController: 视图控 ...
- jersey + tomcat 实现restful风格
本文参考 http://www.cnblogs.com/bluesfeng/archive/2010/10/28/1863816.html 环境: idea 15.0.2 jersey 1.3 tom ...
- python 学习笔记(一)
在Windows上安装Python 首先,从Python的官方网站www.python.org下载最新的2.7.9版本,地址是这个: http://www.python.org/ftp/python/ ...
- [Redis] C#中使用redis
C#中使用redis 首先打开Visual Studio建立一个简单的控制台应用程序,我这里暂时使用的VS2013的版本. 然后通过Nuget进行安装Redis常用组件ServiceStack.Red ...
- Struts2 中拦截器和Action的调用关系(写的很好)
http://blog.csdn.net/hackerain/article/details/6991082
- tomcat的webapp下的root文件夹的作用是什么
1.基本一样..只是表示不同的tomcat的http路径而已. root目录默认放的是tomcat自己的一个项目,如:http://localhost:8080/默认访问root项目 对于webapp ...
- 借用Toad 生成表空间的使用量图示
图示产生方法 图示(tablespace uage)如下