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. Pixar Shorts 皮克斯动画短片全集

    [原创短片](Theatrical Shorts)16部 <安德鲁和威利冒险记><顽皮跳跳灯><红色的梦><锡铁小兵><小雪人大行动>< ...

  2. 特殊集合 Stack Queue Hashtable

    //Stack    干草堆集合    栈集合      先进后出 Stack st = new Stack(); //实例化 初始化 st.Push(2); //添加元素 st.Push(6); s ...

  3. 简单的自定义Adapter

    import android.content.Context; import android.view.LayoutInflater; import android.view.View; import ...

  4. c#面向对象基础 类、方法、方法重载

    C#是纯粹的面向对象编程语言,它真正体现了“一切皆为对象”的精神.在C#中,即使是最基本的数据类型,如int,double,bool类型,都属于System.Object(Object为所有类型的基类 ...

  5. Java配置----JDK开发环境搭建及环境变量配置

    [声明] 欢迎转载,但请保留文章原始出处→_→ 生命壹号:http://www.cnblogs.com/smyhvae/ 文章来源:http://www.cnblogs.com/smyhvae/p/3 ...

  6. 高德地图 室内地图 API 的一些坑

    开发指南 http://lbs.amap.com/api/javascript-api/guide/create-map/indoormap/ demo 大全: http://lbs.amap.com ...

  7. ngrok访问外网

    1. 外网映射工具介绍 windows用户: 1,下载windows版本的客户端,解压到你喜欢的目录2,在命令行下进入到path/to/windows_386/下3,执行 ngrok -config= ...

  8. Ubuntu下VIM的安装及其配置——Linux篇

    一.Ubuntu系统默认内置: 实际上ubuntu默认没有安装老版本的vi,只装了vim.vi是vim.tiny(vim的最小化版本,不含 GUI,并且仅含有一小部分功能,并且默认与vi兼容.此软件包 ...

  9. requirejs解决异步模块加载方案

    他首先会遍历enableRegistry取出其中定义的模块,并且将没有加载成功的模块标识注入noLoads数组,如果过期了这里就会报错 如果上述没问题还会做循环依赖的判断,主要逻辑在breakCycl ...

  10. 【iCore3 双核心板】例程二十七:DMA LAN实验——高速数据传输测速

    实验指导书及代码包下载: http://pan.baidu.com/s/1o7qnCUI iCore3 购买链接: https://item.taobao.com/item.htm?id=524229 ...