题目链接:http://media.hihocoder.com/contests/icpcbeijing2015/problems.pdf

题目大意:给你四个矩形,判断是否能取其中任意三个组成一个大矩形

思路:模拟暴力

 #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <iostream>
#include <algorithm>
using namespace std;
struct bones{
int width;
int height;
bones(int width0=,int height0=){
width=width0;
height=height0;
}
};
int maxx;
int area;
bones a[];
bones tmp[];
bones Add(bones a1,bones a2){
if(a1.width==a2.height) return bones(a1.width,a1.height+a2.width);
if(a1.width==a2.width) return bones(a1.width,a1.height+a2.height);
if(a2.width==a1.height) return bones(a2.width,a2.height+a1.width);
if(a2.height==a1.height) return bones(a1.height,a1.width+a2.width);
return bones(,); }
bool solve(bones a1,bones a2,bones a3){
bones tmp;
tmp=Add(a1,a2);
tmp=Add(tmp,a3);
if(tmp.width>) {
return true;}
tmp=Add(a1,a3);
tmp=Add(tmp,a2);
if(tmp.width>) {
return true;}
tmp=Add(a2,a3);
tmp=Add(tmp,a1);
if(tmp.width>) {return true;}
return false;
}
void print(){
if(solve(a[],a[],a[])||solve(a[],a[],a[])||solve(a[],a[],a[])||solve(a[],a[],a[])){
printf("Yes\n");
return ;
}
printf("No\n");
return ;
}
int main(){
int T;
scanf("%d",&T);
while(T--){
for(int i=;i<=;i++){
scanf("%d %d",&a[i].width,&a[i].height);
}
print();
}
return ;
}

hiho1255 Mysterious Antiques in Sackler Museum的更多相关文章

  1. Mysterious Antiques in Sackler Museum(判断长方形)

    题目链接 参考博客Ritchie丶的博客 - UVALive 7267 Mysterious Antiques in Sackler Museum (判断长方形) 题意:大概意思就是判断四个矩形能不能 ...

  2. UVALive 7267 Mysterious Antiques in Sackler Museum (判断长方形)

    Sackler Museum of Art and Archaeology at Peking University is located on a beautiful site near the W ...

  3. UVaLive 7267 Mysterious Antiques in Sackler Museum (if-else,枚举)

    题意:给定四个矩形,要求从中选出三个,能不能拼成一个矩形. 析:说到这个题,我还坑了队友一次,读题读错了,我直接看的样例,以为是四个能不能组成,然后我们三个就拼命想有什么简便方法,后来没办法了,直接暴 ...

  4. 【hihocoder1255 Mysterious Antiques in Sackler Museum】构造 枚举

    2015北京区域赛现场赛第2题. 题面:http://media.hihocoder.com/contests/icpcbeijing2015/problems.pdf OJ链接:http://hih ...

  5. 2015北京区域赛 Mysterious Antiques in Sackler Museum 几何基础+思维

    题意是,选出三个,看看是否可以凑成一个新的矩形. #include<bits/stdc++.h> using namespace std; struct node { ]; }a[]; b ...

  6. 院校-美国:哈佛大学(Harvard University)

    ylbtech-院校-美国:哈佛大学(Harvard University) 哈佛大学(Harvard University),简称“哈佛”,坐落于美国马萨诸塞州波士顿都市区剑桥市,是一所享誉世界的私 ...

  7. 每日英语:Nanjing's New Sifang Art Museum Illustrates China's Cultural Boom

    In a forest on the outskirts of this former Chinese capital, 58-year-old real-estate developer Lu Ju ...

  8. 【转】get a mysterious problem,when i use HttpWebRequest in unity c# script

    in script,i use HttpWebRequest to get service from network.but it comes a mysterious problem. the so ...

  9. D - Mysterious Present

    这个题和求最长递增序列的题类似,为了能输出一组可行的数据,我还用了一点儿链表的知识. Description Peter decided to wish happy birthday to his f ...

随机推荐

  1. 二维数组中的查找问题--剑指offer面试题3

    题目:在一个二维数组中,对每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序.请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数. // 二维数组中的查找 ...

  2. 2198: 小P当志愿者送餐

    题目描述 在ICPC程序设计大赛期间,小P作为志愿者的任务是给各个学校送盒饭,小P一次最多可以携带M份盒饭.总共有N个学校来参加比赛,这N个学校的休息点在一条笔直的马路边一字排开,路的一头是小P取盒饭 ...

  3. Nice Garland CodeForces - 1108C (思维+暴力)

    You have a garland consisting of nn lamps. Each lamp is colored red, green or blue. The color of the ...

  4. php微信公众号开发入门小教程

    1.配置相关服务器 (1) 如下,把自己的服务器ip白名单配置上: (2) 开始配置令牌,配置令牌时先需要把现成的代码放到自己的服务器上面,代码里面包含自己的设置的令牌号码,这样才可以配置成功. 注意 ...

  5. oc之脚本

    进入Build Phases页面,点击加号选择“New Run Script Phases”创建Run Script 在这里添加Run Script, 1.每次编译运行版本号(bundleVersio ...

  6. os.path 下的各方法

    一.os.path os.path.abspath(file) #拿到当前程序(文件)的绝对目录. os.path.split(pathname) # 返回一个元组,第零个元素为文件上级绝对目录,第一 ...

  7. 后台管理系统之系统操作日志开发(Java实现)

    一,功能点 实现管理员操作数据的记录.效果如下 二,代码实现 基于注解的Aop日志记录 1.Log实体类 package com.ideal.manage.guest.bean.log; import ...

  8. 百度地图api在Html中显示,在jsp页面中不显示解决方法

    在jsp页面中显示如下 但是在html中正常显示. 原来的代码如下: <script type="text/javascript" src="http://api. ...

  9. 面试题(校招java)

    1:linux线程和进程的区别? 进程是程序执行时的一个实例,即它是程序已经执行到课中程度的数据结构的汇集.从内核的观点看,进程的目的就是担当分配系统资源(CPU时间.内存等)的基本单位. 线程是进程 ...

  10. apach ab 安装时的错误

    1.cmd进入bin下:执行httpd -k install 需要管理员 登陆安装 我们打开conf文件夹,找到httpd.conf,修改如下内容,让serverroot指向你的安装位置: Defin ...