题目链接

卡了一下精度和内存。

 #include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <iostream>
#include <algorithm>
using namespace std;
#define eps 1e-8
#define N 1000001
#define LL __int64
int a[] = {-,,,-,,,-,,};
int b[] = {-,-,-,,,,,,};
char str[N];
LL cross(LL x1,LL y1,LL x2,LL y2)
{
return x1*y2 - x2*y1;
}
int main()
{
int t,len,i;
LL x,y,ans,px,py;
scanf("%d",&t);
while(t--)
{
scanf("%s",str);
len = strlen(str);
px = ;
py = ;
ans = ;
for(i = ;i < len;i ++)
{
if(str[i] == '')break;
x = px+a[str[i]-''-];
y = py+b[str[i]-''-];
ans += cross(x,y,px,py);
px = x;
py = y;
}
ans += cross(px,py,,);
if(ans < ) ans = -ans;
if(ans% == )
printf("%I64d\n",ans/);
else
printf("%I64d.5\n",ans/);
}
return ;
}

POJ 1654 Area(水题)的更多相关文章

  1. 【转】POJ百道水题列表

    以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight ...

  2. poj 1654 Area 多边形面积

    /* poj 1654 Area 多边形面积 题目意思很简单,但是1000000的point开不了 */ #include<stdio.h> #include<math.h> ...

  3. poj 1654 Area (多边形求面积)

    链接:http://poj.org/problem?id=1654 Area Time Limit: 1000MS   Memory Limit: 10000K Total Submissions:  ...

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

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

  5. poj 3264 RMQ 水题

    题意:找到一段数字里最大值和最小值的差 水题 #include<cstdio> #include<iostream> #include<algorithm> #in ...

  6. Poj 1552 Doubles(水题)

    一.Description As part of an arithmetic competency program, your students will be given randomly gene ...

  7. POJ 1654 Area 凸包面积

    水题直接码... /********************* Template ************************/ #include <set> #include < ...

  8. poj 1654 Area(求多边形面积 && 处理误差)

    Area Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 16894   Accepted: 4698 Description ...

  9. poj 1654 Area(多边形面积)

    Area Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 17456   Accepted: 4847 Description ...

随机推荐

  1. 【PHP&&mysqli】

    msyqli和mysql只有一个字母的差别,真正的含义是msyql的增强版扩展. MySQL可以处理满足程序员对MySQL数据库操作的各种需要了,为什么还需要mysqli呢?因为mysqli支持面性对 ...

  2. sdut 1592转置矩阵【稀疏矩阵的压缩存储】【快速转置算法】

    转置矩阵 Time Limit: 1000ms   Memory limit: 32768K  有疑问?点这里^_^ 题目链接:http://acm.sdut.edu.cn/sdutoj/proble ...

  3. POJ1351 Number of Locks(数学)

    截至写博客为止,貌似这是网上第一个采用数学公式来处理的. 网上的题解都是DFS或是动态规划,但感觉可以推公式直接用数学的方法处理,想了好久,终于推出公式. 题意:一个长度为n的由数字1,2,3,4 组 ...

  4. ASP.NET多线程下使用HttpContext.Current为null解决方案 2015-01-22 15:23 350人阅读 评论(0) 收藏

    问题一:多线程下获取文件绝对路径 当我们使用HttpContext.Current.Server.MapPath(strPath)获取绝对路径时HttpContext.Current为null,解决办 ...

  5. 跟着鸟哥学Linux系列笔记0-如何解决问题

    跟着鸟哥学Linux系列笔记0-扫盲之概念 在发生问题怎么处理: 1.  在自己的主机.网络数据库上查询How-To或FAQ -Linux 自身的文件数据: /usr/share/doc -CLDP中 ...

  6. MongoDB学习(2)—Node.js与MongoDB的基本连接示例

    前提 已经安装了node.js和MongoDB,本文使用的node.js是v0.12.0,MongoDB是3.0.0. 初始化数据 启动MongoDB服务,在test数据库中插入一条实例数据: db. ...

  7. HDU 4251 The Famous ICPC Team Again 主席树

    The Famous ICPC Team Again Problem Description   When Mr. B, Mr. G and Mr. M were preparing for the ...

  8. C++异常处理机制几种方法

    一.异常 迄今为止,我们处理程序中的错误一般都是用if语句测试某个表达式,然后处理错误的特定义代码. C++异常机制使用了三个新的关键字  (SEH(结构化异常处理)) try    ──标识可能出现 ...

  9. 62个Android Studio小技巧合集

    1书签(Bookmarks) 描述:这是一个很有用的功能,让你可以在某处做个标记(书签),方便后面再跳转到此处. 调用:Menu → Navigate → Bookmarks 快捷键: 添加/移除书签 ...

  10. mybatis 加载配置文件的两种方式

    package com.atguigu.day03_mybaits.test; import java.io.IOException;import java.io.InputStream;import ...