【Gym 100971G】Repair
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;
}
┆凉┆暖┆降┆等┆幸┆我┆我┆里┆将┆ ┆可┆有┆谦┆戮┆那┆ ┆大┆始┆ ┆然┆
┆薄┆一┆临┆你┆的┆还┆没┆ ┆来┆ ┆是┆来┆逊┆没┆些┆ ┆雁┆终┆ ┆而┆
┆ ┆暖┆ ┆如┆地┆站┆有┆ ┆也┆ ┆我┆ ┆的┆有┆精┆ ┆也┆没┆ ┆你┆
┆ ┆这┆ ┆试┆方┆在┆逃┆ ┆会┆ ┆在┆ ┆清┆来┆准┆ ┆没┆有┆ ┆没┆
┆ ┆生┆ ┆探┆ ┆最┆避┆ ┆在┆ ┆这┆ ┆晨┆ ┆的┆ ┆有┆来┆ ┆有┆
┆ ┆之┆ ┆般┆ ┆不┆ ┆ ┆这┆ ┆里┆ ┆没┆ ┆杀┆ ┆来┆ ┆ ┆来┆