BUPT 2017 summer training (for 16) #1B

题意

Alex is repairing his country house. He has a rectangular metal sheet of size a × b. He has to cut two rectangular sheets of sizes \(a_1\) × $b_1 $and \(a_2\) × \(b_2\) from it. All cuts must be parallel to the sides of the initial sheet. Determine if he can do it.

题解

把所有情况都找一遍,也就是要交换长和宽。

代码

#include <cstdio>
#include <algorithm>
using namespace std;
int main(){
long long a,b,c,d,e,f;
scanf("%lld%lld%lld%lld%lld%lld",&a,&b,&c,&d,&e,&f);
bool t=false;
for(int i=0;i<2;++i){
for(int j=0;j<2;++j){
for(int k=0;k<2;++k){
t|=(max(c,e)<=a&&d+f<=b);
swap(c,d);
}
swap(e,f);
}
swap(a,b);
}
printf("%s",t?"YES":"NO");
return 0;
}

【Gym 100971G】Repair的更多相关文章

  1. 【 Gym 101116K 】Mixing Bowls(dfs)

    BUPT2017 wintertraining(15) #4H Gym - 101116K 题意 给定一个菜谱,大写的单词代表混合物,小写的代表基础原料.每个混合物由其它混合物或基础原料组成,不会间接 ...

  2. 【 Gym - 101124E 】Dance Party (数学)

    BUPT2017 wintertraining(15) #4G Gym - 101124 E.Dance Party 题意 有c种颜色,每个颜色最多分配给两个人,有M个男士,F个女士,求至少一对男士同 ...

  3. 【Gym - 101124A】The Baguette Master (数学,几何)

    BUPT2017 wintertraining(15) #4F Gym - 101124A 题意 给定画框宽度,画的四边和一个对角线长度,求画框外沿周长. 题解 过顶点做画框的垂线,每个角都得到两个全 ...

  4. 【 Gym - 101138K 】 The World of Trains (DP)

    BUPT2017 wintertraining(15) #4E Gym - 101138K 题意 N节车厢的火车,每节车厢容量是1~K,那么有\(K^N\)种火车. 求选择D个连续的且容量相同的车厢的 ...

  5. 【 Gym - 101138J 】Valentina and the Gift Tree(树链剖分)

    BUPT2017 wintertraining(15) 4 D Gym - 101138J 数据 题意 n个节点的一棵树,每个节点的权值为g,q个询问,树上的节点U-V,求U到V的路径的最大子段和. ...

  6. 【 Gym - 101138F 】GukiZ Height (数学)

    BUPT2017 wintertraining(15) #4 C Gym - 101138F 题意 初始高度0,目标值h,第i天目标值会下降i,当前高度会改变a[i%n],求高度不小于目标值的最早的时 ...

  7. 【 Gym - 101138D 】Strange Queries (莫队算法)

    BUPT2017 wintertraining(15) #4B Gym - 101138D 题意 a数组大小为n.(1 ≤ n ≤ 50 000) (1 ≤ q ≤ 50 000)(1 ≤ ai ≤  ...

  8. 【Gym - 101164I】Cubes(dfs,剪枝)

    BUPT2017 wintertraining(15) #4 A - I.Cubes Gym - 101164I 题意 将n拆成最少个立方数相加的形式. 题解 根据n的范围,立方数最大不超过400的立 ...

  9. 【GYM 102059】2018-2019 XIX Open Cup, Grand Prix of Korea

    vp了一场gym,我又开心地划水了. A. Coloring Roads 题意:给定一棵树,树边一开始都是无色的,每次操作可以把一个点到根的路径染成某个颜色,每次询问当前树上出现过某个次数的颜色种数. ...

随机推荐

  1. Feel Good POJ - 2796 (前缀和+单调栈)(详解)

    Bill is developing a new mathematical theory for human emotions. His recent investigations are dedic ...

  2. form-data、x-www-form-urlencoded的区别

    form-data可以上传文件格式的,比如mp3.jpg这些:x-www-form-urlencoded不能选择格式文件,只能传key-value这种string格式的内容.

  3. agora入门案例

    一,下载agora的WebSDK 二,运行index.html 三,输入appID 1.找到appID 2.页面输入appID,查看效果

  4. 多线程系列之六:Producer-Consumer模式

    一,Producer-Consumer模式 Producer:生产者的意思,指的是生成数据的线程.Consumer:消费者的意思,指的是使用数据的线程当生产者和消费者以不同的线程运行时,两者之间的处理 ...

  5. 辨析element.offsetXxxx和element.style.xxxx

    DOM操作时,经常使用element.style属性,没错,element.style是属性,和几个offsetXxxx属性一样,概念是一样的. 但是style有几个属性,这几个属性和offsetXx ...

  6. Linux 典型应用之远程连接SSH

    查看版本 cat /etc/redhat-release 如果ifconfig不能使用 yum install net-tools 修改配置 vim /etc/sysconfig/network-sc ...

  7. 生命周期函数以及vue的全局注册

    beforeCreate 在创造实例之前 created 创造实例以后 beforeMount 在挂载前 render 渲染节点到页面上 //将虚拟dom数组渲染出来 mounted 挂载以后 bef ...

  8. springboot注解@SpringBootApplication分析

    @SpringBootApplication注解用在Spring Boot的入口类上面,是Spring Boot提供的应用启动相关的注解. 直接上注解的源码: @Target(ElementType. ...

  9. [转帖]你所不知道的C和C++运行库

    [C-C++]你所不知道的C和C++运行库 https://blog.csdn.net/humanking7/article/details/85887884 原作者也是转的blog 最近一个物理机上 ...

  10. Linux 下面 PG 的 uuid-ossp 包安装办法

    1. pgsql 安装 时报错, 如图示: 详细信息为: 执行SQL为: CREATE EXTENSION IF NOT EXISTS "uuid-ossp" 错误纤细信息为: C ...