#include <iostream>
#include <iomanip>
#define MAXN 1000
using namespace std; struct node
{
double x;
double y;
}; node _node[MAXN]; double fun(double a,double b);
int main()
{
//freopen("acm.acm","r",stdin);
int n;
int i;
double tem_x;
double tem_y;
double x;
double y;
int sum;
while(cin>>n)
{
tem_x = ;
tem_y = ; for(i = ; i < n; ++ i)
{
cin>>_node[i].x;
cin>>_node[i].y;
} for(i = ; i < n-; ++ i)
{
if(i % == )
{
tem_x -= _node[i].x;
tem_y -= _node[i].y;
}
else
{
tem_x += _node[i].x;
tem_y += _node[i].y;
}
} tem_x *= ;
tem_y *= ;
x = fun(_node[n-].x*,-tem_x);
y = fun(_node[n-].y*,-tem_y);
cout<<n<<" ";
cout<<setiosflags(ios::fixed)<<setprecision()<<x<<" "<<y<<" ";
x = _node[].x* - x;
y = _node[].y* - y;
for(i = ; i < n; ++ i)
{
cout<<setiosflags(ios::fixed)<<setprecision()<<x<<" "<<y<<" ";
x = _node[i].x* - x;
y = _node[i].y* - y;
}
cout<<endl;
}
} double fun(double a,double b)
{
return (a+b)/2.0;
}

关注我的公众号,当然,如果你对Java, Scala, Python等技术经验,以及编程日记,感兴趣的话。

技术网站地址: vmfor.com

POJ 1940的更多相关文章

  1. poj 1940 Wine Trading in Gergovia_贪心

    在一条街上有许多房屋,每间屋子里都住着人,并且都是做葡萄酒生意的商人,他们每天都要决定买卖多少瓶葡萄酒.有趣的地方是,供需总是完美地一致.商人总是能买到自己需要的葡萄酒,并且,他们从来不介意是从哪个商 ...

  2. POJ 2251 Dungeon Master /UVA 532 Dungeon Master / ZOJ 1940 Dungeon Master(广度优先搜索)

    POJ 2251 Dungeon Master /UVA 532 Dungeon Master / ZOJ 1940 Dungeon Master(广度优先搜索) Description You ar ...

  3. poj 题目分类(1)

    poj 题目分类 按照ac的代码长度分类(主要参考最短代码和自己写的代码) 短代码:0.01K--0.50K:中短代码:0.51K--1.00K:中等代码量:1.01K--2.00K:长代码:2.01 ...

  4. POJ题目分类(按初级\中级\高级等分类,有助于大家根据个人情况学习)

    本文来自:http://www.cppblog.com/snowshine09/archive/2011/08/02/152272.spx 多版本的POJ分类 流传最广的一种分类: 初期: 一.基本算 ...

  5. POJ题目细究

    acm之pku题目分类 对ACM有兴趣的同学们可以看看 DP:  1011   NTA                 简单题  1013   Great Equipment     简单题  102 ...

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

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

  7. 转载:poj题目分类(侵删)

    转载:from: POJ:http://blog.csdn.net/qq_28236309/article/details/47818407 按照ac的代码长度分类(主要参考最短代码和自己写的代码)  ...

  8. POJ 3370. Halloween treats 抽屉原理 / 鸽巢原理

    Halloween treats Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 7644   Accepted: 2798 ...

  9. POJ 2356. Find a multiple 抽屉原理 / 鸽巢原理

    Find a multiple Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7192   Accepted: 3138   ...

随机推荐

  1. try-catch-finally中return语句的执行

    catch里return后还会执行finally吗??在java里,是的.但是值得注意的是,在存在try-catch-finally的方法中,return可能出现的位置有4个,在try中,在catch ...

  2. zip压缩

    package com.green.project.compress; import java.io.File;import java.io.FileInputStream;import java.i ...

  3. git用法

    chapter: 8 add 添加文件内容至索引 用法:git add [选项] [--] ... -n, --dry-run 演习 -v, --verbose 冗长输出 -i, --interact ...

  4. DXP中原理图与PCB图元件互找

    在原理图中找到元件,快捷键TS即可在PCB中找到元件,且为选中状态.

  5. java rest框架jersey数组单记录问题解决

    JAVA数据接口采用jersey技术,可以返回xml,json等格式,可以根据客户端请求accept,如:Application/json,Application/xml 来得到不同的接口数据,非常好 ...

  6. week 9 scenario testing

    1:How do you expect different personas to use your software?  What’s their need and their goals,  ho ...

  7. android 开发 解码gif图片,获取每帧bitmap

    环境:android 4.3  (注意对于android4.4版本解码出来不正确,除了第一帧正确外,其余的都是显示不同的地方)  通用版本见: android 开发对gif解码(适配android 4 ...

  8. 如何在Android模拟器上安装apk文件

    1.运行SDK Manager,选择模拟器,并运行模拟器 SDK Manager应用 2.将需要安装的apk文件复制到platform-tools目录下(默认在:D:\tools\android\ad ...

  9. 使用SecureRandom类替代Random类

    java.util.Random 产生确定的值可能被恶意的程序预测到. java.security.SecureRandom 产生不确定的随机数不能被预测到. 所以优先使用java.security. ...

  10. 图解SQL的Join(转摘)

    转摘网址:http://coolshell.cn/articles/3463.html 对于SQL的Join,在学习起来可能是比较乱的.我们知道,SQL的Join语法有很多inner的,有outer的 ...