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(计算几何)的更多相关文章

  1. 【codeforces 749B】Parallelogram is Back

    time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...

  2. Codeforces 659D Bicycle Race【计算几何】

    题目链接: http://codeforces.com/contest/659/problem/D 题意: 若干条直线围城的湖,给定直线的端点,判断多少个转点会有危险?(危险是指直走的的话会掉进水里) ...

  3. Codeforces 340B - Maximal Area Quadrilateral (计算几何)

    Codeforces Round #198 (Div. 2) 题目链接:Maximal Area Quadrilateral Iahub has drawn a set of \(n\) points ...

  4. Codeforces Gym 100338B Geometry Problem 计算几何

    Problem B. Geometry ProblemTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudg ...

  5. Codeforces 1045E. Ancient civilizations 构造 计算几何 凸包

    原文链接https://www.cnblogs.com/zhouzhendong/p/CF1045E.html 4K码量构造题,CF血腥残暴! 题解 首先,如果所有点颜色相同,那么直接连个菊花搞定. ...

  6. Codeforces 1079D Barcelonian Distance(计算几何)

    题目链接:Barcelonian Distance 题意:给定方格坐标,方格坐标上有两个点A,B和一条直线.规定:直线上沿直线走,否则沿方格走.求A到B的最短距离. 题解:通过直线到达的:A.B两点都 ...

  7. codeforces 672C C. Recycling Bottles(计算几何)

    题目链接: C. Recycling Bottles time limit per test 2 seconds memory limit per test 256 megabytes input s ...

  8. Codeforces 499C:Crazy Town(计算几何)

    题目链接 给出点A(x1,y1),B(x2,y2),和n条直线(ai,bi,ci,aix + biy + ci = 0),求A到B穿过多少条直线 枚举每条直线判断A.B是否在该直线两侧即可 #incl ...

  9. codeforces749B

    Parallelogram is Back CodeForces - 749B 已知平行四边形的三个顶点,求第四个顶点可能的位置.Input输入有三行,每行包括两个整数x和y ( - 1000 ≤ x ...

随机推荐

  1. windows查看进程

    由端口到进程: 直接查看进程: 查看本机连接端口: 杀进程:  (eg:kill httpd) tskill  1596

  2. html5 语义

    页面示意图

  3. 关于Random类产生随机数的一些问题

    package test2; import java.util.Random; /** * @author cy * * @date 2015年7月28日 上午8:47:52 * * @Descrip ...

  4. IOS第12天(2,UINavigationController导航控制器)

    ****HMAppDelegate.m @implementation HMAppDelegate - (BOOL)application:(UIApplication *)application d ...

  5. DS实验题 Order 已知父节点和中序遍历求前、后序

    题目: 思路: 这题是比较典型的树的遍历问题,思路就是将中序遍历作为位置的判断依据,假设有个节点A和它的父亲Afa,那么如果A和Afa的顺序在中序遍历中是先A后Afa,则A是Afa的左儿子,否则是右儿 ...

  6. Android如何通过shareduserid获取系统权限

    [原文] android会为每个apk进程分配一个单独的空间(比如只能访问/data/data/自己包名下面的文件),一般情况下apk之间是禁止相互访问数据的.通过Shared User id,拥有同 ...

  7. Docker三剑客之Swarm介绍

    DockOne技术分享(二十): 我用swarm在多台物理机调度管理容器,用ovs实现跨主机的容器互联问题 [编者的话]Swarm项目是Docker公司发布三剑客中的一员,用来提供容器集群服务,目的是 ...

  8. 移除\禁用 jquery mobile 元素样式渲染

    在元素上加属性. data-role="none"

  9. UINavigation Bar中使用UIcollectionView,在UIcollectionView的顶端和低端出现空白的问题

    在含有UINavigation Bar的视图中,使用UIcollectionView,会在UIcollectionView的顶端和低端出现空白,需要添加下面 一句代码,空白即可消失   //如果不加这 ...

  10. 浏览器浏览记忆(history)几则技巧记录

    一般浏览记录模式 假设有三个页面, start.html, 通过点击start.html上的链接跳转到 first.html, 然后点击first.html上链接跳转到 second.html, 那么 ...