Codeforces 749B:Parallelogram is Back(计算几何)
http://codeforces.com/problemset/problem/749/B
题意:已知平行四边形三个顶点,求另外一个顶点可能的位置。
思路:用向量来做。
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <string>
#include <cmath>
#include <queue>
#include <vector>
#include <map>
#include <set>
using namespace std;
#define INF 0x3f3f3f3f
#define N 100010
typedef long long LL;
struct node {
int x, y;
node () {}
node (int x, int y) : x(x), y(y) {}
}a[], ans[]; int main() {
for(int i = ; i < ; i++) scanf("%d%d", &a[i].x, &a[i].y);
ans[].x = a[].x + a[].x - a[].x;
ans[].y = a[].y + a[].y - a[].y;
ans[].x = a[].x - a[].x + a[].x;
ans[].y = a[].y - a[].y + a[].y;
ans[].x = a[].x + a[].x - a[].x;
ans[].y = a[].y + a[].y - a[].y;
printf("3\n");
for(int i = ; i < ; i++) printf("%d %d\n", ans[i].x, ans[i].y);
return ;
}
Codeforces 749B:Parallelogram is Back(计算几何)的更多相关文章
- 【codeforces 749B】Parallelogram is Back
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...
- Codeforces 659D Bicycle Race【计算几何】
题目链接: http://codeforces.com/contest/659/problem/D 题意: 若干条直线围城的湖,给定直线的端点,判断多少个转点会有危险?(危险是指直走的的话会掉进水里) ...
- Codeforces 340B - Maximal Area Quadrilateral (计算几何)
Codeforces Round #198 (Div. 2) 题目链接:Maximal Area Quadrilateral Iahub has drawn a set of \(n\) points ...
- Codeforces Gym 100338B Geometry Problem 计算几何
Problem B. Geometry ProblemTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudg ...
- Codeforces 1045E. Ancient civilizations 构造 计算几何 凸包
原文链接https://www.cnblogs.com/zhouzhendong/p/CF1045E.html 4K码量构造题,CF血腥残暴! 题解 首先,如果所有点颜色相同,那么直接连个菊花搞定. ...
- Codeforces 1079D Barcelonian Distance(计算几何)
题目链接:Barcelonian Distance 题意:给定方格坐标,方格坐标上有两个点A,B和一条直线.规定:直线上沿直线走,否则沿方格走.求A到B的最短距离. 题解:通过直线到达的:A.B两点都 ...
- codeforces 672C C. Recycling Bottles(计算几何)
题目链接: C. Recycling Bottles time limit per test 2 seconds memory limit per test 256 megabytes input s ...
- Codeforces 499C:Crazy Town(计算几何)
题目链接 给出点A(x1,y1),B(x2,y2),和n条直线(ai,bi,ci,aix + biy + ci = 0),求A到B穿过多少条直线 枚举每条直线判断A.B是否在该直线两侧即可 #incl ...
- codeforces749B
Parallelogram is Back CodeForces - 749B 已知平行四边形的三个顶点,求第四个顶点可能的位置.Input输入有三行,每行包括两个整数x和y ( - 1000 ≤ x ...
随机推荐
- c# 函数练习
1.out的使用 2.100以内与7无关的数(个位数是7,十位数是7,7的倍数) 每日一句:不求与人相比,但求超越自己,要哭就哭出激动的泪水,要笑就笑出成长的性格!
- Sharepoint 2013 网站集的删除与还原
一.可以通过三种方法删除网站集: 1.打开Sharepoint 2013 管理页面首页 ---> 单击‘应用程序管理(Application Management)’并进入该页面 ---> ...
- ios-获取商店已上线app信息
NSString *url = [[NSString alloc] initWithFormat:@"http://itunes.apple.com/lookup?id=%@",@ ...
- JS-确认框
if(confirm("Sure to xxxxxx?")){ xxxxxx; xxxxxx; }
- PHP Header下载文件在IE文件名中文乱码问题
解决PHP Header下载文件在IE文件名中文乱码有两种常见的,一种是是把页面编码改成utf8,另一种是对中文url进入urlencode编码,根据UA检测,区别下载,就可以解决了 $filenam ...
- CentOS通过日志反查入侵
使用 last -f /var/log/wtmp 来查看可疑ip登录 查看/var/log/secure保存的系统信息 来确定可以ip登录
- hibernate学习(3)——api详解对象(2)
1. Transaction 事务 事务的操作: 开启事务 beginTransaction() 获得事务 getTransaction() 提交事务:commit() 回滚事务:rollback ...
- [daily][archlinux][fonts] 在linux下管理字体
序: linux是社区搞出来, 商业应用也都是服务器场景.社区里又都是技术人员.字体又是细节.而且会英文早成了标配.所以没有很多社区以外的人力来搞字体这个毫无回报的东西. 结果很自然的,装linux桌 ...
- class-dump + DumpFrameworks.pl
目的:实现生成 private framework 的 .h,以便倒入项目使用私有 api. 一.class-dump 下载地址: http://stevenygard.com/download/ 安 ...
- sdk 更新的时连接不上dl-ssl.google.com解决办法
今天有朋友说sdk的更新不了,借了个VPN给他也没解决问题,后来还是他自己解决了,下面分享下经验 这里介绍一种不需要FQ的解决办法,修改C:\Windows\System32\drivers\etc下 ...