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 ...
随机推荐
- 数位DP HDU2089
不要62 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submis ...
- iPhone6分辨率与适配
iPhone6分辨率与适配 分辨率和像素 经新xcode6模拟器验证(分辨率为pt,像素为真实pixel): iPhone5分辨率320x568,像素640x1136,@2x iPhone6分辨率37 ...
- 使用javascript实现在页面打印的效果的三种方式
<div id="console"></div> <script type="text/javascript"> var c ...
- 导入TDP数据包备份
package org.alfresco.repo.bom.util; import java.io.BufferedReader; import java.io.File; import java. ...
- 20145209&20145309信息安全系统设计基础实验报告 (3)
实验内容.步骤与体会: 实验过程的理解,实验指导书中知识点的理解. (1)为什么在双击了GIVEIO和JTAG驱动安装文件后还需要手动进行配置? 因为安装文件只是将驱动文件释放了出来,并没有在系统中将 ...
- 蓝牙物理链路类型:SCO和ACL链路
蓝牙物理链路ACL(Asynchronous Connectionless), 另外的一种链路是SCO(Synchronous Connection Oriented)主要用来传输对时间要求很高的数据 ...
- Hibernate @Formula
在使用Hibernate时经常会遇到实体类某个字段存的是code值而非我们最终想要的中文具体显示的值, 如果使用Hibernate的一对一关联这种,一个属性还好说,但是如果一个实体类里有多个字段都是需 ...
- 多线程 - CountDownLatch
一个同步辅助类,在完成一组正在其他线程中执行的操作之前,它允许一个或多个线程一直等待. 用给定的计数 初始化 CountDownLatch.由于调用了 countDown() 方法,所以在当前计数到达 ...
- c# word 转pdf 导出失败,因为此功能尚未安装
savePDF应该是office2007以上的版本才支持的,而且必须是完整版的office. 如果2007提示这个错误,还需要安装一个插件 http://download.microsoft.com/ ...
- Java学习-001-JDK安装配置
本节主要讲述在 Win7 64bit 系统下安装.配置 JDK8u25,敬请参阅.详细步骤如下: 一.JDK下载 您可到 官方网站 或 我的云盘 下载,对应的JDK8u25的安装程序,下载过程不再赘述 ...