Submission #19508604


Source Code Expand

Copy

    #include <bits/stdc++.h>
    using namespace std;
    typedef long long ll;
    #define FAST ios_base::sync_with_stdio(false);cin.tie(0);
    const double EPS = 1e-9;
    const double PI = acos(-1);
    const int knightDir[8][2] = {{-2,-1},{-2,1},{-1,2},{1,2},{2,-1},{2,1},{-1,-2},{1,-2}};
    //const int dx[]={0,0,0,1,1,1,-1,-1,-1};
    //const int dy[]={-1,0,1,-1,0,1,-1,0,1};
    const int dx[] = {0 , 1 , 0 , -1};
    const int dy[] = {1 , 0 , -1 , 0};
    //#define MOD         1000000007LL
    #define MAX         2000015
    const ll MOD = 998244353;
    inline ll mod(ll a){return ((a % MOD + MOD) % MOD);}
    inline ll add(ll a, ll b){return mod(mod(a) + mod(b));}
    inline ll sub(ll a, ll b){return mod(mod(a) - mod(b));}
    
    double toRadian(double a)
    {
        return a * (PI / 180);
    }
    int main()
    {
        FAST
        int t;
        t = 1;

        while(t--)
        {
           long double a , b , h , m;
           cin >> a >> b >> h >> m;
           
           long double al = h * 30 + (m * 0.5);
           long double bl = m * 6;
           
           long double angleInDegree = abs(al - bl);
           //cout << angleInDegree << endl;
           long double ans = (a * a) + (b * b) - (2 * a * b * cos(toRadian(angleInDegree)));
           
           cout << fixed << setprecision(20) << sqrt(ans) << endl;
        }
    }


Submission Info

Submission Time
Task C - : (Colon)
User iamworldian
Language C++ (GCC 9.2.1)
Score 300
Code Size 1429 Byte
Status AC
Exec Time 8 ms
Memory 4076 KB

Judge Result

Set Name Sample Subtask1
Score / Max Score 0 / 0 300 / 300
Status
AC × 2
AC × 30
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
Subtask1 sample_01.txt, sample_02.txt, sub1_01.txt, sub1_02.txt, sub1_03.txt, sub1_04.txt, sub1_05.txt, sub1_06.txt, sub1_07.txt, sub1_08.txt, sub1_09.txt, sub1_10.txt, sub1_11.txt, sub1_12.txt, sub1_13.txt, sub1_14.txt, sub1_15.txt, sub1_16.txt, sub1_17.txt, sub1_18.txt, sub1_19.txt, sub1_20.txt, sub1_21.txt, sub1_22.txt, sub1_23.txt, sub1_24.txt, sub1_25.txt, sub1_26.txt, sub1_27.txt, sub1_28.txt
Case Name Status Exec Time Memory
sample_01.txt AC 8 ms 3944 KB
sample_02.txt AC 3 ms 3824 KB
sub1_01.txt AC 2 ms 3848 KB
sub1_02.txt AC 2 ms 3936 KB
sub1_03.txt AC 2 ms 3952 KB
sub1_04.txt AC 2 ms 3992 KB
sub1_05.txt AC 2 ms 3832 KB
sub1_06.txt AC 2 ms 3684 KB
sub1_07.txt AC 2 ms 3940 KB
sub1_08.txt AC 2 ms 3972 KB
sub1_09.txt AC 2 ms 3848 KB
sub1_10.txt AC 2 ms 3904 KB
sub1_11.txt AC 2 ms 3820 KB
sub1_12.txt AC 2 ms 3964 KB
sub1_13.txt AC 3 ms 3892 KB
sub1_14.txt AC 3 ms 3880 KB
sub1_15.txt AC 2 ms 3892 KB
sub1_16.txt AC 2 ms 3848 KB
sub1_17.txt AC 2 ms 3824 KB
sub1_18.txt AC 2 ms 3868 KB
sub1_19.txt AC 2 ms 3852 KB
sub1_20.txt AC 2 ms 4012 KB
sub1_21.txt AC 3 ms 3888 KB
sub1_22.txt AC 2 ms 3656 KB
sub1_23.txt AC 2 ms 3888 KB
sub1_24.txt AC 2 ms 4076 KB
sub1_25.txt AC 2 ms 3952 KB
sub1_26.txt AC 2 ms 3908 KB
sub1_27.txt AC 2 ms 4012 KB
sub1_28.txt AC 2 ms 4048 KB