博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Codeforces Gym 100002 B Bricks 枚举角度
阅读量:6922 次
发布时间:2019-06-27

本文共 2593 字,大约阅读时间需要 8 分钟。

Problem B Bricks"

Time Limit: 1 Sec  

Memory Limit: 256 MB

题目连接

http://codeforces.com/gym/100002

Description

The prisoner of the "IF" castle has decided to run away by disassembling the brick wall in his prison cell. To hide his work from his jailors he shall get rid of the bricks that he removes from the wall. All bricks have a shape of rectangular parallelepiped with the size of A × B × C inches and are so strong that they are impossible to break. However, there's a small rectangular sewer hole in the cell's floor with the size of D × E inches that goes deep down as a rectangular well of the same size (so deep it is, that its depth could not be measured and can be neglected). The prisoner have precisely (up to a tenth of an inch!) measured all the sizes A, B, C, D, E and wants to know if it is possible to dispose of the castle's bricks through the hole in the floor. Please, answer this question for him.

Input

The input file consists of a single line with 5 numbers A, B, C, D, and E separated by spaces. A, B, C are the lengths of brick's sides, and D, E are the lengths of hole's sides. All lengths are at least 1 and at most 10 inches and have at most 1 digit after decimal point.

Output

Write to the output file a single word YES if it is possible to dispose of the bricks through the hole or NO otherwise.

Sample Input

1.0 2.0 1.5 1.4 1.0

Sample Output

NO

HINT

 

题意

给你一个无限深矩形的洞和一个立方体,问你这个立方体能否放入这个洞里面

题解:

注意可以斜着放

那就枚举角度往里面塞就行了

代码:

//qscqesze#include 
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
typedef long long ll;using namespace std;//freopen("D.in","r",stdin);//freopen("D.out","w",stdout);#define sspeed ios_base::sync_with_stdio(0);cin.tie(0)#define maxn 110000#define mod 10007#define eps 1e-9#define pi 3.1415926int Num;//const int inf=0x7fffffff; //§ß§é§à§é¨f§³const ll Inf=0x3f3f3f3f3f3f3f3fll;inline ll read(){ ll x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){ if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();} return x*f;}//**************************************************************************************double a[3],d,e;int flag=0;void solve(int x,int y){ for(double i=0;i<=90;i+=0.001) { double ttt = i*pi/180; double l = a[x]*cos(ttt)+a[y]*sin(ttt); double k = a[x]*sin(ttt)+a[y]*cos(ttt); if(l<=d&&k<=e) { cout<<"YES"<
>a[i]; cin>>d>>e; for(int i=0;i<3;i++) { for(int j=0;j<3;j++) { if(i==j) continue; solve(i,j); if(flag) return 0; } } printf("NO\n");}

 

转载地址:http://bdkjl.baihongyu.com/

你可能感兴趣的文章
kft-activiti-demo
查看>>
变更管理7R
查看>>
2016年上半年网络工程师培训考试感想
查看>>
LESS CSS 框架简介
查看>>
Kobject浅析
查看>>
Shell常用命令小结
查看>>
我的友情链接
查看>>
jboss
查看>>
repmgr实现pg流复制失效自动切换
查看>>
Ubuntu使用ufw进行防火墙设置
查看>>
Innodb 关于blob、text字段的存储以及性能
查看>>
基于LVS-NAT的WEB服务的负载均衡实现
查看>>
千万不要自己感动自己
查看>>
Linux***病毒流量异常处理
查看>>
RabbitMQ(3)-单机与集群搭建
查看>>
python注意要点
查看>>
一个程序员的随想
查看>>
VMware 10M网卡变1000M兆网卡
查看>>
SpringBoot - jetty容器启动
查看>>
iOS-UI-基本控件之UIView
查看>>