ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1793. Tray 2

Fail solution is accepted
Posted by nskoryukina 1 Nov 2011 22:43
Hi, my solution is:

#include <iostream>
#include <cstdio>
#include <cmath>
#include <stdlib.h>
#include <valarray>
using namespace std;

double const pi=acos(-1.0);

int main()
{
    long long a,b,d;
    cin >> a >> b >> d;
    long long R1, r1, R2, r2, h;
    cin>>r1>>R1>>r2>>R2>>h;
    if(
        pi*R1*R1+pi*R2*R2>a*b ||
        2* max(r1,r2) > min(a,b))
    {
        cout<<"NO"<<endl;
        return 0;
    }
    if(d>=h && 2*max(R1,R2) > min(a,b))
    {
        cout<<"NO"<<endl;
        return 0;
    }
    else cout <<"YES"<<endl;
    return 0;
}

But is wrong, ofcourse.
Add new tests, please =)
Now this solution gets WA (-)
Posted by Sandro (USU) 2 Nov 2011 02:17