Submission #19509201


Source Code Expand

Copy
#include <bits/stdc++.h>
#define ZERO(a) memset(a,0,sizeof(a))
#define FILL(a,b) memset(a,b,sizeof(a))
#define SORT(v) sort((v).begin(),(v).end())
#define RSORT(v) sort((v).rbegin(),(v).rend())
#define FOR(i,a,b)  for(int i=a, i##_len=(b); i<i##_len; ++i)
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
using ll = int64_t;
using namespace std;
const long double PI = acosl(-1);

int main(void) {
    int A, B, H, M;
    cin >> A >> B >> H >> M;
    long double hrad = (2 * PI * (H * 60 + M)) / (12 * 60);
    long double mrad = (2 * PI * M) / 60;
    long double ans = sqrtl(powl(A * cosl(hrad) - B * cosl(mrad), 2)
                    + powl(A * sinl(hrad) - B * sinl(mrad), 2));
    printf("%.10Lf", ans);
    return 0;
}

Submission Info

Submission Time
Task C - : (Colon)
User weldsk
Language C++ (GCC 9.2.1)
Score 300
Code Size 755 Byte
Status AC
Exec Time 11 ms
Memory 4112 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 11 ms 3904 KB
sample_02.txt AC 2 ms 3916 KB
sub1_01.txt AC 2 ms 4012 KB
sub1_02.txt AC 2 ms 3928 KB
sub1_03.txt AC 2 ms 3900 KB
sub1_04.txt AC 3 ms 3928 KB
sub1_05.txt AC 2 ms 3912 KB
sub1_06.txt AC 2 ms 3660 KB
sub1_07.txt AC 2 ms 3724 KB
sub1_08.txt AC 3 ms 3936 KB
sub1_09.txt AC 2 ms 3900 KB
sub1_10.txt AC 2 ms 4044 KB
sub1_11.txt AC 2 ms 4112 KB
sub1_12.txt AC 2 ms 4112 KB
sub1_13.txt AC 2 ms 3932 KB
sub1_14.txt AC 2 ms 3924 KB
sub1_15.txt AC 3 ms 3916 KB
sub1_16.txt AC 2 ms 3992 KB
sub1_17.txt AC 2 ms 4044 KB
sub1_18.txt AC 2 ms 3940 KB
sub1_19.txt AC 2 ms 3980 KB
sub1_20.txt AC 2 ms 4000 KB
sub1_21.txt AC 2 ms 3968 KB
sub1_22.txt AC 2 ms 3680 KB
sub1_23.txt AC 2 ms 3916 KB
sub1_24.txt AC 2 ms 4044 KB
sub1_25.txt AC 2 ms 3900 KB
sub1_26.txt AC 3 ms 4112 KB
sub1_27.txt AC 3 ms 3920 KB
sub1_28.txt AC 5 ms 4016 KB