Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Why WA#include <iostream.h> #include <math.h> int w,h,l,H; inline int test(int a,int b,int c) { if(w<a || h<b || l<c) return 0; if(b <= H) return 1; if(c<=H && b*c<=l*H && b*b+c*c<=h*h) return 1; if(a*a+b*b <= h) { double e = atan(a/b) + acos(H/sqrt(a*a+b*b)); if(a*cos(e) + b*sin(e) <= w) return 1; } return 0; } void main() { int a,b,c; while(cin>>w>>h>>l>>H>>a>>b>>c) if(test(a,b,c)||test(a,c,b)||test(b,a,c)||test(b,c,a)|| test(c,a,b)||test(c,b,a)) cout<<"The box goes on the truck."<<endl; else cout<<"The box will not go on the truck."<<endl; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator