10221 - Satellites

All about problems in Volume 102. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

NAbdulla
New poster
Posts: 31
Joined: Wed Jul 30, 2014 3:40 pm
Contact:

10221 - Satellites Please help, what's wrong?

Post by NAbdulla » Sat Dec 27, 2014 3:48 pm

All my sample outputs are correct but getting WA
My code:
removed
Last edited by NAbdulla on Sun Dec 28, 2014 7:39 am, edited 1 time in total.

NAbdulla
New poster
Posts: 31
Joined: Wed Jul 30, 2014 3:40 pm
Contact:

Re: 10221 - Satellites Please help, what's wrong?

Post by NAbdulla » Sun Dec 28, 2014 7:38 am

ac a bit tricky

Aseem chakrabarthy
New poster
Posts: 5
Joined: Mon Jan 19, 2015 12:12 pm
Location: University of Chittagong

Re: 10221 - Satellites

Post by Aseem chakrabarthy » Fri Feb 06, 2015 10:10 am

why i getting wrong Answer.....

Code: Select all

#include<stdio.h>
#include<iostream>
#include<iomanip>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#define PI 2*acos(0.0)
using namespace std;
int main()
{
    double s,a;
    string n;
    double arc,chord;
    while(cin>>s>>a>>n)
    {
        arc=s+6440;
        if(n=="deg")
        {
            if(a>180)


                a=360-a;


            else
            {


                a=PI*a/180.0;
                s=arc*a;
            }

        }

        else
        {
            a=a/60.0;
            a=PI*a/180.0;
            s=arc*a;
        }

        chord=sqrt(2*arc*arc*(1-cos(a)));
        cout<<fixed<<setprecision(6)<<s<<" "<<fixed<<setprecision(6)<<chord<<endl;
    }
}
Last edited by brianfry713 on Fri Feb 06, 2015 10:39 pm, edited 1 time in total.
Reason: Added code blocks

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10221 - Satellites

Post by brianfry713 » Tue Feb 10, 2015 2:56 am

Input:

Code: Select all

500 200 deg
AC output:

Code: Select all

19380.136014 13669.131612
Check input and AC output for thousands of problems on uDebug!

Aseem chakrabarthy
New poster
Posts: 5
Joined: Mon Jan 19, 2015 12:12 pm
Location: University of Chittagong

Re: 10221 - Satellites

Post by Aseem chakrabarthy » Thu Mar 26, 2015 10:11 am

Thanks Accepted...

Post Reply

Return to “Volume 102 (10200-10299)”