buggy_code stringlengths 11 625k | fixed_code stringlengths 17 625k | bug_type stringlengths 2 4.45k | language int64 0 8 | token_count int64 5 200k |
|---|---|---|---|---|
#include <math.h>
#include <stdio.h>
int main(void) {
int len_hour_hand, len_minute_hand, hour, minute;
double diff_rad, distance;
scanf("%d %d %d %d", &len_hour_hand, &len_minute_hand, &hour, &minute);
diff_rad = 11 * M_PI * (60 * hour + minute) / 360;
distance = sqrt(pow(len_hour_hand, 2) + pow(len_minute_... | #include <math.h>
#include <stdio.h>
int main(void) {
int len_hour_hand, len_minute_hand, hour, minute;
double diff_rad, distance;
scanf("%d %d %d %d", &len_hour_hand, &len_minute_hand, &hour, &minute);
diff_rad = 11 * M_PI * (60 * hour + minute) / 360;
distance = sqrt(pow(len_hour_hand, 2) + pow(len_minute_... | [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 0 | 103 |
import math
A, B, H, M = map(int, input().split())
pai = math.pi
#HとMを正規化する事で、針間の角度を算出している
angle = 2*pai*((H+M/60)/12 - M/60)
#余弦定理
distance = np.sqrt(A**2+B**2-2*A*B*math.cos(angle))
print(distance) | import numpy as np
import math
A, B, H, M = map(int, input().split())
pai = math.pi
#HとMを正規化する事で、針間の角度を算出している
angle = 2*pai*((H+M/60)/12 - M/60)
#余弦定理
distance = np.sqrt(A**2+B**2-2*A*B*np.cos(angle))
print(distance) | [["+", 0, 656, 0, 596, 141, 704, 141, 673, 0, 22], ["+", 36, 36, 0, 656, 0, 596, 141, 704, 0, 272], ["+", 36, 36, 0, 656, 0, 596, 141, 704, 705, 22], ["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["-", 0, 657, 12, 657, 12, 652, 63, 319, 500, 22], ["+", 0, 657, 12, 657, 12, 652, 63, 319, 500, 22]] | 5 | 81 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
int a, b, h, m;
cin >> a >> b >> h >> m;
double pi = 3.141592653589793238;
double y = abs(2 * 60 * h + 2 * m - 2 * 12 * m);
if (y / 720 > 1)
y -= 720;... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
int a, b, h, m;
cin >> a >> b >> h >> m;
double pi = 3.141592653589793238;
double y = abs(2 * 60 * h + 2 * m - 2 * 12 * m);
if (y / 720 > 1)
y = 2 * 7... | [["-", 8, 9, 0, 57, 64, 1, 0, 11, 17, 110], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 17, 32], ["+", 64, 1, 0, 11, 12, 16, 31, 16, 31, 13], ["+", 64, 1, 0, 11, 12, 16, 31, 16, 17, 48], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 12, 22]] | 1 | 141 |
/* ex4_2
fmuacshai */
#include <math.h>
#include <stdio.h>
int main(void) {
//時針の長さをh_hand、分針の長さをm_hand、○時をhour、×分をminと定義する
double h_hand, m_hand, hour, min;
//時針と分針の角度をangle、求める長さの2乗をlenth2、求める長さをans
double angle, ans, lenth2;
// h_handを入力
scanf("%lf", &h_hand);
// m_handを入力
scanf("%lf", &m_hand);... | /* ex4_2
fmuacshai */
#include <math.h>
#include <stdio.h>
int main(void) {
//時針の長さをh_hand、分針の長さをm_hand、○時をhour、×分をminと定義する
double h_hand, m_hand, hour, min;
//時針と分針の角度をangle、求める長さの2乗をlenth2、求める長さをans
double angle, ans, lenth2;
// h_handを入力
scanf("%lf", &h_hand);
// m_handを入力
scanf("%lf", &m_hand);... | [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 0 | 144 |
/* ex4_2
urah */
#include <math.h>
#include <stdio.h>
double distance(int len_hour_hand, int len_minute_hand, double hour,
double minute);
int main(void) {
int len_hour_hand, len_minute_hand;
double hour, minute, ans;
// 入力の受け取り
scanf("%d\t%d\t%lf\t%lf", &len_hour_hand, &len_minute_hand,... | /* ex4_2
urah */
#include <math.h>
#include <stdio.h>
// プロトタイプ宣言
double distance(int len_hour_hand, int len_minute_hand, double hour,
double minute);
int main(void) {
int len_hour_hand, len_minute_hand;
double hour, minute, ans;
// 入力の受け取り
scanf("%d\t%d\t%lf\t%lf", &len_hour_hand, &len_... | [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]] | 0 | 172 |
/* ex4_2
urah */
#include <math.h>
#include <stdio.h>
double distance(int len_hour_hand, int len_minute_hand, double hour,
double minute);
int main(void) {
int len_hour_hand, len_minute_hand;
double hour, minute, ans;
// 入力の受け取り
scanf("%d\t%d\t%lf\t%lf", &len_hour_hand, &len_minute_hand,... | /* ex4_2
urah */
#include <math.h>
#include <stdio.h>
double distance(int len_hour_hand, int len_minute_hand, double hour,
double minute);
int main(void) {
int len_hour_hand, len_minute_hand;
double hour, minute, ans;
// 入力の受け取り
scanf("%d\t%d\t%lf\t%lf", &len_hour_hand, &len_minute_hand,... | [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 0 | 172 |
/* ex4_2
sak_Citrus*/
#include <math.h>
#include <stdio.h>
int main(void) {
//時針・分針の長さとその指す位置
int hourLength, minuteLength, hour, minute;
// 0時方向から時計回りに測った角
double hourAngle, minuteAngle;
//解(の2乗)、角の差(cosの性質から負値も許容)
double ans, diff;
scanf("%d %d %d %d", &hourLength, &minuteLength, &hour, &minute);
... | /* ex4_2
sak_Citrus*/
#include <math.h>
#include <stdio.h>
int main(void) {
//時針・分針の長さとその指す位置
int hourLength, minuteLength, hour, minute;
// 0時方向から時計回りに測った角
double hourAngle, minuteAngle;
//解(の2乗)、角の差(cosの性質から負値も許容)
double ans, diff;
scanf("%d %d %d %d", &hourLength, &minuteLength, &hour, &minute);
... | [["-", 31, 16, 31, 23, 0, 16, 12, 16, 12, 13], ["+", 31, 16, 31, 23, 0, 16, 12, 16, 12, 13]] | 0 | 124 |
/* ex4-2
Sagzar1993 */
#include <math.h>
#include <stdio.h>
int main(void) {
int hourLen, minuteLen, hour, minute; //時針と分針の長さ、現在の時刻
scanf("%d %d %d %d", &hourLen, &minuteLen, &hour, &minute); //入力を受け取る
//0時ちょうどの時の針の角度を0として、現在の針の角度をそれぞれ求める
double hourAng = (minute / 60.0) * (M_PI / 6) + (hour / 12.0) * (... | /* ex4-2
Sagzar1993 */
#include <math.h>
#include <stdio.h>
int main(void) {
int hourLen, minuteLen, hour, minute; //時針と分針の長さ、現在の時刻
scanf("%d %d %d %d", &hourLen, &minuteLen, &hour, &minute); //入力を受け取る
//0時ちょうどの時の針の角度を0として、現在の針の角度をそれぞれ求める
double hourAng = (minute / 60.0) * (M_PI / 6) + (hour / 12.0) * (... | [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 0 | 139 |
#C
import math
A,B,H,M = map(int,input().split())
a2 = A*A+B*B-2*A*B*math.cos(math.pi*2*(H/12-M/60))
print(math.sqrt(a2)) | #C
import math
A,B,H,M = map(int,input().split())
a2 = A*A+B*B-2*A*B*math.cos(math.pi*2*((H/12+M/720)-M/60))
print(math.sqrt(a2)) | [["+", 0, 657, 12, 23, 0, 657, 31, 23, 0, 24], ["+", 12, 23, 0, 657, 31, 23, 0, 657, 17, 72], ["+", 0, 657, 31, 23, 0, 657, 12, 657, 31, 22], ["+", 0, 657, 31, 23, 0, 657, 12, 657, 17, 85], ["+", 0, 657, 31, 23, 0, 657, 12, 657, 12, 612], ["+", 0, 657, 12, 23, 0, 657, 31, 23, 0, 25]] | 5 | 68 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, h, m;
cin >> a >> b >> h >> m;
long double hour = 30 * h + m / 60.0 * 30;
long double minute = m * 6;
long double d = pow(
a * a + b * b - 2 * a * b * cos(abs(hour - minute) * acos(0.0) / 90.0),
0.5);
cout << d;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, h, m;
cin >> a >> b >> h >> m;
long double hour = 30 * h + m / 60.0 * 30;
long double minute = m * 6;
long double d = pow(
a * a + b * b - 2 * a * b * cos(abs(hour - minute) * acos(0.0) / 90.0),
0.5);
cout << setprecision(20) ... | [["+", 0, 1, 0, 16, 31, 16, 12, 2, 63, 22], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 24], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 25], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151]] | 1 | 97 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, h, m;
double hu, zi, kaku;
double ans;
cin >> a >> b >> h >> m;
hu = m * 6;
zi = h * 30 + m / 2;
if (hu == 0 || zi == 0)
kaku = 360 - fabs(hu - zi);
else
kaku = fabs(hu - zi);
kaku = kaku * M_PI / 180;
ans = a * a + b * b... | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, h, m;
double hu, zi, kaku;
double ans;
cin >> a >> b >> h >> m;
hu = m * 6;
zi = h * 30 + m * 0.5;
if (hu == 0 || zi == 0)
kaku = 360 - fabs(hu - zi);
else
kaku = fabs(hu - zi);
kaku = kaku * M_PI / 180;
ans = a * a + b *... | [["-", 0, 1, 0, 11, 12, 16, 12, 16, 17, 85], ["-", 0, 1, 0, 11, 12, 16, 12, 16, 12, 13], ["+", 0, 1, 0, 11, 12, 16, 12, 16, 17, 48], ["+", 0, 1, 0, 11, 12, 16, 12, 16, 12, 13]] | 1 | 137 |
import math
A,B,H,M = map(int,input().split())
radH = 2*math.pi*H/12 + 30/180*math.pi*M/60
radM = 2*math.pi*M/60
L = math.sqrt(A^2+B^2-2*A*B*math.cos(radH-radM))
print(L) | import math
A,B,H,M = map(int,input().split())
radH = 2*math.pi*H/12 + 30/180*math.pi*M/60
radM = 2*math.pi*M/60
L = math.sqrt(A**2+B**2-2*A*B*math.cos(radH-radM))
print(L) | [["-", 12, 652, 3, 4, 0, 657, 31, 657, 17, 140], ["+", 3, 4, 0, 657, 31, 657, 31, 657, 17, 578], ["-", 0, 662, 12, 652, 3, 4, 0, 657, 17, 140], ["+", 3, 4, 0, 657, 31, 657, 12, 657, 17, 578]] | 5 | 89 |
import numpy as np
A, B, H, M = map(int, input().split())
pai = 3.14
angle = 2*pai*((H+M/60)/12 - M/60)
distance = np.sqrt(A**2+B**2-2*A*B*np.cos(angle))
print(distance)
| import numpy as np
import math
A, B, H, M = map(int, input().split())
pai = math.pi
angle = 2*pai*((H+M/60)/12 - M/60)
distance = np.sqrt(A**2+B**2-2*A*B*np.cos(angle))
print(distance)
| [["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22], ["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 531], ["+", 0, 656, 0, 1, 0, 662, 12, 319, 500, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 319, 0, 131], ["+", 0, 656, 0, 1, 0, 662, 12, 319, 319, 22]] | 5 | 79 |
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int A = sc.nextInt();
int B = sc.nextInt();
int H = sc.nextInt();
int M = sc.nextInt();
double kakudoTansin = 30 * H + 0.5 * M;
double kakudoTyousin = 6 * M;
double ka... | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int A = sc.nextInt();
int B = sc.nextInt();
int H = sc.nextInt();
int M = sc.nextInt();
double kakudoTansin = 30 * H + 0.5 * M;
double kakudoTyousin = 6 * M;
double ka... | [["-", 0, 57, 64, 196, 0, 1, 0, 11, 17, 110], ["-", 0, 57, 64, 196, 0, 1, 0, 11, 12, 499], ["+", 0, 57, 64, 196, 0, 1, 0, 11, 17, 32], ["+", 64, 196, 0, 1, 0, 11, 12, 16, 31, 499], ["+", 64, 196, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 64, 196, 0, 1, 0, 11, 12, 16, 12, 22]] | 3 | 163 |
#include <bits/stdc++.h>
using namespace std;
const long double pi = 4 * acos(0);
const long double fractHour = pi / 12;
const long double fractMinu = fractHour / 60;
const long double otro = pi / 60;
int main() {
int a, b, h, m;
cin >> a >> b >> h >> m;
long double hou = fractHour * h + fractMinu * m;
long ... | #include <bits/stdc++.h>
using namespace std;
const long double pi = 4 * acos(0);
const long double fractHour = pi / 12;
const long double fractMinu = fractHour / 60;
const long double otro = pi / 60;
int main() {
int a, b, h, m;
cin >> a >> b >> h >> m;
long double hou = fractHour * h + fractMinu * m;
long ... | [["-", 0, 57, 64, 9, 0, 1, 0, 11, 17, 110], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["-", 64, 9, 0, 1, 0, 11, 12, 16, 17, 85], ["-", 64, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 12, 22]] | 1 | 152 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
const double pi = 3.14159265358979323846;
double a, b, h, m;
cin >> a >> b >> h >> m;
double one = ((60 * h + m) / 720) * (2 * pi);
double two = (m / 60) * (2 * pi);
double x = abs(one... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
const double pi = 3.14159265358979323846;
double a, b, h, m;
cin >> a >> b >> h >> m;
double one = ((60 * h + m) / 720) * (2 * pi);
double two = (m / 60) * (2 * pi);
double x = abs(one... | [["-", 8, 9, 0, 57, 64, 1, 0, 11, 17, 110], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 17, 32], ["+", 64, 1, 0, 11, 12, 16, 31, 16, 31, 13], ["+", 64, 1, 0, 11, 12, 16, 31, 16, 17, 48], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 12, 22]] | 1 | 150 |
#include <bits/stdc++.h>
using namespace std;
const double PI = M_PI;
double square(double a) { return (double)a * a; }
double dist(pair<double, double> a, pair<double, double> b) {
return sqrt(square(a.first - b.first) + square(a.second - b.second));
}
pair<double, double> point(double lenght, double deg) {
doubl... | #include <bits/stdc++.h>
using namespace std;
const double PI = M_PI;
double square(double a) { return (double)a * a; }
double dist(pair<double, double> a, pair<double, double> b) {
return sqrt(square(a.first - b.first) + square(a.second - b.second));
}
pair<double, double> point(double lenght, double deg) {
doubl... | [["-", 8, 9, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 31, 13]] | 1 | 205 |
import math
def main():
line = [int(i) for i in input().split(' ')]
A, B, H, M = line[0], line[1], line[2], line[3]
ang = math.fabs((H / 12 * 360) - (M / 60 * 360))
angle = min(ang, 360-ang)
ans = math.sqrt(A * A + B * B - 2 * A * B * math.cos(math.radians(angle)))
print(ans)
if __name__ == "__m... | import math
def main():
line = [int(i) for i in input().split(' ')]
A, B, H, M = line[0], line[1], line[2], line[3]
ang = math.fabs(((H+M/60) / 12 * 360) - (M / 60 * 360))
angle = min(ang, 360-ang)
ans = math.sqrt(A * A + B * B - 2 * A * B * math.cos(math.radians(angle)))
print(ans)
if __name__ ... | [["+", 31, 23, 0, 657, 31, 657, 31, 23, 0, 24], ["+", 0, 657, 31, 657, 31, 23, 0, 657, 17, 72], ["+", 31, 657, 31, 23, 0, 657, 12, 657, 31, 22], ["+", 31, 657, 31, 23, 0, 657, 12, 657, 17, 85], ["+", 31, 657, 31, 23, 0, 657, 12, 657, 12, 612], ["+", 31, 23, 0, 657, 31, 657, 31, 23, 0, 25]] | 5 | 133 |
#include <math.h>
#include <stdio.h>
int main() {
int a, b, h, m;
double as, bs, work, s;
scanf("%d%d%d%d", &a, &b, &h, &m);
as = h * 360.0 / 12.0 + m * 360.0 / 12.0 / 60;
bs = m * 360.0 / 60.0;
if (as < bs) {
work = as;
as = bs;
bs = work;
}
s = as - bs;
if (s > 180)
s = 360 - s;
pr... | #include <math.h>
#include <stdio.h>
int main() {
int a, b, h, m;
double as, bs, work, s;
scanf("%d%d%d%d", &a, &b, &h, &m);
as = h * 360.0 / 12.0 + m * 360.0 / 12.0 / 60;
bs = m * 360.0 / 60.0;
if (as < bs) {
work = as;
as = bs;
bs = work;
}
s = as - bs;
if (s > 180)
s = 360 - s;
pr... | [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 0 | 151 |
import math
A,B,H,M = map(int,input().split())
m = H*60 + M
r_a = m / 720
r_b = m / 60
r = abs(r_a - r_b)
if r > 1:
r = abs(r - int(r))
if r > 0.5:
r = abs(0.5 - r)
c = math.sqrt(A*A + B*B -2*A*B*math.cos(math.radians(360*r)))
print(c) | import math
A,B,H,M = map(int,input().split())
m = H*60 + M
r_a = m / 720
r_b = m / 60
r = abs(r_a - r_b)
if r > 1:
r = abs(r - int(r))
if r > 0.5:
r = abs(1 - r)
c = math.sqrt(A*A + B*B -2*A*B*math.cos(math.radians(360*r)))
print(c) | [["-", 0, 662, 12, 652, 3, 4, 0, 657, 31, 531], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 31, 612]] | 5 | 114 |
/*
Author : Xinyuan
*/
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define INF 1000000007
#define mod 1005
#define PI acos(-1)
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<PII> VII;
typedef vector<VI> VVI;
typedef long long int ll;... | /*
Author : Xinyuan
*/
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define INF 1000000007
#define mod 1005
#define PI acos(-1)
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<PII> VII;
typedef vector<VI> VVI;
typedef long long int ll;... | [["+", 0, 43, 49, 50, 51, 16, 12, 74, 0, 24], ["+", 49, 50, 51, 16, 12, 74, 39, 77, 39, 40], ["+", 0, 43, 49, 50, 51, 16, 12, 74, 0, 25], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 1 | 236 |
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define ins insert
#define ull unsigned ... | #pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define ins insert
#define ull unsigned ... | [["+", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 0, 16, 31, 16, 31, 16, 31, 23, 0, 24], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13], ["+", 51, 2, 3, 4, 0, 16, 31, 16, 12, 22], ["+", 49, 50, 51, 2, 3, 4, 0, 16, 17, 85], ["+", 49, 50, 51, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 25]] | 1 | 356 |
import java.util.Scanner;
public class Main {
static Scanner in = new Scanner(System.in);
static void run() {
int A = in.nextInt(), B = in.nextInt(), H = in.nextInt(), M = in.nextInt();
double m = 2.0 * Math.PI * M / 60;
double h = 2.0 * Math.PI * (H * 60 + M) / (60 * 12);
double a = Math.max(m, ... |
import java.util.Scanner;
public class Main {
static Scanner in = new Scanner(System.in);
static void run() {
int A = in.nextInt(), B = in.nextInt(), H = in.nextInt(), M = in.nextInt();
double m = 2.0 * Math.PI * M / 60;
double h = 2.0 * Math.PI * (H * 60 + M) / (60 * 12);
double a = Math.max(m, ... | [["-", 8, 196, 0, 57, 64, 1, 0, 11, 17, 110], ["+", 8, 196, 0, 57, 64, 1, 0, 11, 17, 32], ["+", 64, 1, 0, 11, 12, 16, 31, 16, 31, 499], ["+", 64, 1, 0, 11, 12, 16, 31, 16, 17, 48], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 12, 22]] | 3 | 189 |
from math import cos, radians, sqrt
A, B, H, M = list(map(int,input().split))
m = H * 60 + M
h = 360.0 / 60.0 * (m % 60)
mi = 360.0 / 720.0 * (m % 720)
arg = abs(h - mi)
print(sqrt(A**2 + B**2 - 2.0 * A * B * cos(radians(arg)))) | from math import cos, radians, sqrt
A, B, H, M = list(map(int,input().split()))
m = H * 60 + M
h = 360.0 / 60.0 * (m % 60)
mi = 360.0 / 720.0 * (m % 720)
arg = abs(h - mi)
print(sqrt(A**2 + B**2 - 2.0 * A * B * cos(radians(arg)))) | [["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]] | 5 | 93 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, h, m;
cin >> a >> b >> h >> m;
long double ans;
double deg = (h * 30 + 0.5 * m - 6 * m);
long double cs = cosl(deg * M_PI / 180);
ans = ((long double)(a * a + b * b)) - ((long double)2 * a * b * cs);
cout << sqrt(ans);
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, h, m;
cin >> a >> b >> h >> m;
long double ans;
double deg = (h * 30 + 0.5 * m - 6 * m);
long double cs = cosl(deg * M_PI / 180);
ans = ((long double)(a * a + b * b)) - ((long double)2 * a * b * cs);
cout << setprecision(20) << sqrt(ans)... | [["+", 0, 1, 0, 16, 31, 16, 12, 2, 63, 22], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 24], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 25], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151]] | 1 | 104 |
import math
A, B, H, M = (int(x) for x in input().split())
minuteAngle = math.radians(M * 6)
hourAngle = math.radians(M + H * 60)
angleC = abs(hourAngle - minuteAngle)
print(math.sqrt((A ** 2) + (B ** 2) - (2 * A * B * math.cos(angleC))))
| import math
A, B, H, M = (int(x) for x in input().split())
minuteAngle = math.radians(M*6)
hourAngle = math.radians(M*1/2 + H*30)
angleC = abs(hourAngle - minuteAngle)
print(math.sqrt((A**2) + (B**2) - (2*A*B*math.cos(angleC))))
| [["+", 3, 4, 0, 657, 31, 657, 31, 657, 17, 48], ["+", 3, 4, 0, 657, 31, 657, 31, 657, 12, 612], ["+", 12, 652, 3, 4, 0, 657, 31, 657, 17, 85], ["+", 12, 652, 3, 4, 0, 657, 31, 657, 12, 612], ["-", 12, 652, 3, 4, 0, 657, 12, 657, 12, 612], ["+", 12, 652, 3, 4, 0, 657, 12, 657, 12, 612]] | 5 | 90 |
a, b, h, m = int(input().split())
#長針は60分で一周、短針は720分で一周
#長針は1分で6、短針は1分で0.5 合わせて5.5度離れる
min = (60 * h) + m
ang0 = (min * 5.5) % 360
if ang0 <= 180:
ang = ang0
else:
ang = 360 - ang0
import math
cos_ang = math.cos(math.radians(ang))
x = math.sqrt((a ** 2) + (b ** 2) - (2 * a * b * cos_ang))
print(x)
| a, b, h, m = map(int, input().split())
#長針は60分で一周、短針は720分で一周
#長針は1分で6、短針は1分で0.5 合わせて5.5度離れる
min = (60 * h) + m
ang0 = (min * 5.5) % 360
if ang0 <= 180:
ang = ang0
else:
ang = 360 - ang0
import math
cos_ang = math.cos(math.radians(ang))
x = math.sqrt((a ** 2) + (b ** 2) - (2 * a * b * cos_ang))
print(x)
| [["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21]] | 5 | 100 |
#include <bits/stdc++.h>
using namespace std;
const double PI = 3.14159265358979323846;
int main() {
int a, b, h, m;
cin >> a >> b >> h >> m;
double angle1 = m * 6.0;
double angle2 = h * 30.0 + m / 2.0;
double angle = abs(angle1 - angle2);
if (angle > 180.0)
angle -= 180.0;
double ans = sqrt(a * a +... | #include <bits/stdc++.h>
using namespace std;
const double PI = 3.14159265358979323846;
int main() {
int a, b, h, m;
cin >> a >> b >> h >> m;
double angle1 = m * 6.0;
double angle2 = h * 30.0 + m / 2.0;
// cout<<angle1<<" "<<angle2<<endl;
double angle = abs(angle1 - angle2);
// cout<<angle<<endl;
if (... | [["-", 8, 9, 0, 57, 64, 1, 0, 11, 17, 110], ["-", 8, 9, 0, 57, 64, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 31, 13], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 12, 22]] | 1 | 117 |
import math
a,b,h,m=map(int,input().split())
x=m*6
y=(h*30)+(m*0.5)
result=a**2+b**2-2*a*b*math.cos(min(abs(x-y),abs(y-x)))
print(math.sqrt(result))
| import math
a,b,h,m=map(int,input().split())
x=m*6
y=(h*30)+(m*0.5)
result=a**2+b**2-2*a*b*math.cos(math.radians(min(abs(x-y),abs(y-x))))
print(math.sqrt(result))
| [["+", 12, 652, 3, 4, 0, 652, 63, 319, 500, 22], ["+", 12, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["+", 12, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]] | 5 | 86 |
import math
A,B,H,M=map(int, input().split())
S=30*H+0.5*M
L=6*M
if S>L:
rad=S-L
else:
rad=L-S
if rad>=180:
rad=rad-180
print(math.sqrt(A**2+B**2-2*A*B*math.cos(math.radians(rad))))
| import math
A,B,H,M=map(int, input().split())
S=30*H+0.5*M
L=6*M
if S>L:
rad=S-L
else:
rad=L-S
if rad>=180:
rad=360-rad
print(math.sqrt(A**2+B**2-2*A*B*math.cos(math.radians(rad))))
| [["-", 64, 196, 0, 1, 0, 662, 12, 657, 31, 22], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 31, 612], ["-", 64, 196, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 12, 22]] | 5 | 96 |
import numpy as np
import math
A, B, H, M = map(int, input().split())
d = np.sqrt((B*math.cos(math.degrees(6*M))-A*math.cos(math.degrees(30*H+M/2)))**2+(B*math.sin(math.degrees(6*M))-A*math.sin(math.degrees(30*H+M/2)))**2)
print(d) | import numpy as np
import math
A, B, H, M = map(int, input().split())
d = np.sqrt((B*math.cos(math.radians(6*M))-A*math.cos(math.radians(30*H+M/2)))**2+(B*math.sin(math.radians(6*M))-A*math.sin(math.radians(30*H+M/2)))**2)
print(d) | [["-", 12, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 12, 652, 3, 4, 0, 652, 63, 319, 319, 22]] | 5 | 116 |
import math
a, b, h, m = map(int, input().split())
m_rad = 6 * m
h_rad = 30 * h + m / 2
rad = abs(h_rad - m_rad)
rad = rad
if rad > 180:
rad = 360 - rad
print(rad)
length_2 = a**2 + b**2 - 2*a*b*math.cos(math.radians(rad))
print(length_2**0.5) | import math
a, b, h, m = map(int, input().split())
m_rad = 6 * m
h_rad = 30 * h + m / 2
rad = abs(h_rad - m_rad)
rad = rad
if rad > 180:
rad = 360 - rad
length_2 = a**2 + b**2 - 2*a*b*math.cos(math.radians(rad))
print(length_2**0.5) | [["-", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]] | 5 | 94 |
import math
def radi(n):
return n * math.pi / 180
def resolve():
a, b, h, m = map(int, input().split())
hd = radi(h*30+30*(m/60))
md = radi(360*(m/60))
hx = a * math.cos(hd)
hy = a * math.sin(hd)
mx = b * math.cos(md)
my = b * math.sin(md)
x = abs(hx - mx)
y = abs(hy - my)
v = math.sqrt(x**2 + y**2)
print... | import math
def radi(n):
return n * math.pi / 180
def resolve():
a, b, h, m = map(int, input().split())
hd = radi(h*30+30*(m/60))
md = radi(360*(m/60))
hx = a * math.cos(hd)
hy = a * math.sin(hd)
mx = b * math.cos(md)
my = b * math.sin(md)
x = abs(hx - mx)
y = abs(hy - my)
v = math.sqrt(x**2 + y**2)
print... | [["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22]] | 5 | 146 |
def radi(deg):
return deg * (math.pi / 180)
def resolve():
ha, hb, h, m = map(int, input().split())
hr = radi(30*h+(m/2))
mr = radi(6*m)
hx = ha * math.cos(hr)
mx = hb * math.cos(mr)
hy = ha * math.sin(hr)
my = hb * math.sin(mr)
v = (abs(hx - mx)**2 + abs(hy - my)**2)**0.5
print... | import math
def radi(deg):
return deg * (math.pi / 180)
def resolve():
ha, hb, h, m = map(int, input().split())
hr = radi(30*h+(m/2))
mr = radi(6*m)
hx = ha * math.cos(hr)
mx = hb * math.cos(mr)
hy = ha * math.sin(hr)
my = hb * math.sin(mr)
v = (abs(hx - mx)**2 + abs(hy - my)**2)**... | [["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22]] | 5 | 133 |
package main
import (
"bufio"
"fmt"
"math"
"os"
"strconv"
"strings"
)
var rdr = bufio.NewReaderSize(os.Stdin, 1000000)
// https://atcoder.jp/contests/abc167/tasks/abc168_a
func main() {
data := readLines()
a, _ := strconv.Atoi(data[0][0])
b, _ := strconv.Atoi(data[0][1])
h, _ := strconv.Atoi(data[0][2])
... | package main
import (
"bufio"
"fmt"
"math"
"os"
"strconv"
"strings"
)
var rdr = bufio.NewReaderSize(os.Stdin, 1000000)
// https://atcoder.jp/contests/abc167/tasks/abc168_a
func main() {
data := readLines()
a, _ := strconv.Atoi(data[0][0])
b, _ := strconv.Atoi(data[0][1])
h, _ := strconv.Atoi(data[0][2])
... | [["-", 8, 196, 0, 1, 0, 2, 63, 438, 119, 120], ["+", 8, 196, 0, 1, 0, 2, 63, 438, 119, 120], ["-", 0, 1, 0, 2, 3, 4, 0, 429, 0, 62], ["-", 8, 196, 0, 1, 0, 2, 3, 4, 0, 21]] | 7 | 437 |
#include <bits/stdc++.h>
using namespace std;
int main() {
double A, B, H, M;
cin >> A >> B >> H >> M;
double dif;
double difradi = 0.0;
double ans = 0.0;
dif = abs(30 * (H + M / 60) - M * 6);
if (dif > 180)
dif = 360 - dif;
difradi = dif * M_PI / 180;
// cout << dif << endl;
// cout << difrad... | #include <bits/stdc++.h>
using namespace std;
int main() {
double A, B, H, M;
cin >> A >> B >> H >> M;
double dif;
double difradi = 0.0;
double ans = 0.0;
dif = abs(30 * (H + M / 60) - M * 6);
if (dif > 180)
dif = 360 - dif;
difradi = dif * M_PI / 180;
// cout << dif << endl;
// cout << difrad... | [["+", 0, 16, 31, 16, 31, 16, 12, 2, 63, 22], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 24], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 25], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151]] | 1 | 115 |
/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java,
PHP, Ruby, Perl, C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly,
HTML, CSS, JS, SQLite, Prolog. Code, Compile, Run and Debu... | /******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java,
PHP, Ruby, Perl, C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly,
HTML, CSS, JS, SQLite, Prolog. Code, Compile, Run and Debu... | [["+", 0, 16, 31, 16, 31, 16, 12, 2, 63, 22], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 24], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 25], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151]] | 1 | 82 |
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
float PI = 3.14159265359;
int main(void) {
float a, b, h, m;
cin >> a >> b >> h >> m;
float l_x, l_y, s_x, s_y;
l_x = a * cos((m / 30) * PI);
l_y = a * sin((m / 30) * PI);
s_x = b * cos(((m + 60 * h) / 360) * PI);
s_y = b * sin(((... | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
double PI = 3.14159265359;
int main(void) {
double a, b, h, m;
cin >> a >> b >> h >> m;
double l_x, l_y, s_x, s_y;
l_x = a * cos((m / 30) * PI);
l_y = a * sin((m / 30) * PI);
s_x = b * cos(((m + 60 * h) / 360) * PI);
s_y = b * sin... | [["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 1 | 167 |
import math
A, B, H, M = map(int, input().spli3t())
H_degree = (30 * H) + (0.5 * M)
M_degree = 6 * M
diff = abs(H_degree - M_degree)
if diff > 180:
diff = 360 - diff
else:
diff = diff
length = math.sqrt(A**2 + B**2 - 2*A*B*math.cos(math.radians(diff)))
print(length) | import math
A, B, H, M = map(int, input().split())
H_degree = (30 * H) + (0.5 * M)
M_degree = 6 * M
diff = abs(H_degree - M_degree)
if diff > 180:
diff = 360 - diff
else:
diff = diff
length = math.sqrt(A**2 + B**2 - 2*A*B*math.cos(math.radians(diff)))
print(length) | [["-", 12, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 12, 652, 3, 4, 0, 652, 63, 319, 319, 22]] | 5 | 99 |
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
double A, B, H, M, h, m, z;
cin >> A >> B >> H >> M;
h = H * 30 + (m / 60) * 30;
m = M * 6;
... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
double A, B, H, M, h, m, z;
cin >> A >> B >> H >> M;
h = H * 30 + (M / 60) * 30;
m = M * 6;
... | [["-", 12, 16, 12, 16, 31, 23, 0, 16, 31, 22], ["+", 12, 16, 12, 16, 31, 23, 0, 16, 31, 22]] | 1 | 127 |
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
double A, B, H, M, h, m, z;
cin >> A >> B >> H >> M;
h = H * 30;
m = M * 6;
const double PI =... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
double A, B, H, M, h, m, z;
cin >> A >> B >> H >> M;
h = H * 30 + M / 2;
m = M * 6;
const dou... | [["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 0, 1, 0, 11, 12, 16, 12, 16, 31, 22], ["+", 0, 1, 0, 11, 12, 16, 12, 16, 17, 85], ["+", 0, 1, 0, 11, 12, 16, 12, 16, 12, 13]] | 1 | 119 |
import numpy as np
a,b,h,m=map(int,input().split())
pi = np.py
x = 2*pi*(h*60+m)/720
y = 2*pi*m/60
theta=abs(x-y)
cos = np.cos(theta)
ans = (a**2+b**2-2*a*b*cos)**0.5
print(ans)
| import numpy as np
a,b,h,m=map(int,input().split())
pi = np.pi
x = 2*pi*(h*60+m)/720
y = 2*pi*m/60
theta=abs(x-y)
cos = np.cos(theta)
ans = (a**2+b**2-2*a*b*cos)**0.5
print(ans) | [["-", 0, 656, 0, 1, 0, 662, 12, 319, 319, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 319, 319, 22]] | 5 | 94 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
#define PI 3.14159265
const ll int MOD = 1e9 + 7;
void solve() {
int a, b, h, m;
float x1, x2, theta, x;
cin >> a >> b >> h >> m;
x1 = h * 30 + m * (0.5);
x2 = m * 6;
theta = min(abs(x1 - x2), 360 - abs(x1 - x2));
x = ... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
#define PI 3.141592653589793
const ll int MOD = 1e9 + 7;
void solve() {
int a, b, h, m;
double x1, x2, theta, x;
cin >> a >> b >> h >> m;
x1 = h * 30 + m * (0.5);
x2 = m * 6;
theta = min(abs(x1 - x2), 360 - abs(x1 - x2))... | [["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 172 |
import math
def kyori(a,b,c,d):
return math.sqrt(a**2+b**2-2*a*b*math.cos(abs(c-d)))
A, B, H, M = [int(i) for i in input().split()]
m = M* 2*math.pi/60 #rad
h = H* 2*math.pi/12+ m*2*math.pi/12/60 #rad
#print(h, "\n", m)
k=kyori(A,B,h,m)
print(k)
| import math
def kyori(a,b,c,d):
return math.sqrt(a**2+b**2-2*a*b*math.cos(abs(c-d)))
A, B, H, M = [int(i) for i in input().split()]
m = M* 2*math.pi/60 #rad
h = H* 2*math.pi/12+ M*2*math.pi/60/12 #rad
#print(h, "\n", m)
k=kyori(A,B,h,m)
print(k)
| [["-", 12, 657, 31, 657, 31, 657, 31, 657, 31, 22], ["+", 12, 657, 31, 657, 31, 657, 31, 657, 31, 22], ["-", 0, 662, 12, 657, 12, 657, 31, 657, 17, 85], ["-", 0, 662, 12, 657, 12, 657, 31, 657, 12, 612], ["+", 0, 1, 0, 662, 12, 657, 12, 657, 17, 85], ["+", 0, 1, 0, 662, 12, 657, 12, 657, 12, 612]] | 5 | 122 |
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <time.h>
#include <tuple>
#include <... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <time.h>
#include <tuple>
#include <... | [["+", 0, 16, 31, 16, 31, 16, 12, 2, 63, 22], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 24], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 25], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151]] | 1 | 761 |
#include <math.h>
#include <stdio.h>
double deg_rad(double x) { return x * M_PI / 180.0; }
int abs(int x) {
if (x < 0)
return x * -1;
else
return x;
}
int main() {
int A, B, H, M;
double angle, angle_rad, C;
scanf("%d %d %d %d", &A, &B, &H, &M);
angle = abs(30 * H - 5.5 * M);
angle_rad = deg_rad... | #include <math.h>
#include <stdio.h>
double deg_rad(double x) { return (x * M_PI) / 180.0; }
double abs(double x) {
if (x < 0)
return x * -1;
else
return x;
}
int main() {
int A, B, H, M;
double angle, angle_rad, C;
scanf("%d %d %d %d", &A, &B, &H, &M);
angle = abs(30 * H - 5.5 * M);
angle_rad =... | [["+", 8, 9, 0, 37, 0, 16, 31, 23, 0, 24], ["+", 8, 9, 0, 37, 0, 16, 31, 23, 0, 25], ["-", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40], ["-", 0, 14, 49, 53, 54, 55, 0, 56, 39, 40], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 39, 40]] | 0 | 139 |
import math
a,b,h,m=map(int, input().split())
th=30*(h+m/60)
tm=6*m
if th>=tm:
tbig=th
tsml=tm
else:
tbig=tm
tsml=th
print(tm,th)
if tbig-tsml <= 180:
print((a**2+b**2-2*a*b*math.cos(math.radians(tbig-tsml)))**(1/2))
else:
print((a**2+b**2-2*a*b*math.cos(math.radians(360-tbig+tsml)))**(1/2... | import math
a,b,h,m=map(int, input().split())
th=30*(h+m/60)
tm=6*m
if th>=tm:
tbig=th
tsml=tm
else:
tbig=tm
tsml=th
#print(tm,th)
if tbig-tsml <= 180:
print((a**2+b**2-2*a*b*math.cos(math.radians(tbig-tsml)))**(1/2))
else:
print((a**2+b**2-2*a*b*math.cos(math.radians(360-tbig+tsml)))**(1/... | [["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 21], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]] | 5 | 150 |
import math
s = input("")
s = s.split(" ")
A = int(s[0])
B = int(s[1])
H = int(s[2])
M = int(s[3])
k = 360*M/60-(360*H/12+360*M/12/60)
k = abs(k)
j = math.cos(k*3.141592*2/360)
c = math.sqrt(A*A+B*B-2*A*B*j)
print(c)
| import math
s = input("")
s = s.split(" ")
A = int(s[0])
B = int(s[1])
H = int(s[2])
M = int(s[3])
k = 360*M/60-(360*H/12+360*M/12/60)
k = abs(k)
j = math.cos(k*3.14159265359*2/360)
c = math.sqrt(A*A+B*B-2*A*B*j)
print(c) | [["-", 3, 4, 0, 657, 31, 657, 31, 657, 12, 531], ["+", 3, 4, 0, 657, 31, 657, 31, 657, 12, 531]] | 5 | 124 |
import math
a,b,H,M=map(int,input().split())
ans=math.sqrt(pow(a,2)+pow(b,2)-2*a*b*math.cos(math.radians(abs(30*H-6*M))))
print(ans) | import math
a,b,H,M=map(int,input().split())
ans=math.sqrt(pow(a,2)+pow(b,2)-2*a*b*math.cos(math.radians(abs(30*H-11*M/2))))
print(ans) | [["-", 0, 652, 3, 4, 0, 657, 12, 657, 31, 612], ["+", 3, 4, 0, 657, 12, 657, 31, 657, 31, 612], ["+", 0, 652, 3, 4, 0, 657, 12, 657, 17, 85], ["+", 0, 652, 3, 4, 0, 657, 12, 657, 12, 612]] | 5 | 73 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, s, n) for (int i = s; i < (int)(n); i++)
#define co(x) cout << x << endl
#define SQvec(i, j) vector<vector<int>> data(i, vector<int>(j))
#define mod 1000000007
#define pi 3.14159265358979324
typedef long long int lint;
int main() {
long double A, B, H, H_2... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, s, n) for (int i = s; i < (int)(n); i++)
#define co(x) cout << x << endl
#define SQvec(i, j) vector<vector<int>> data(i, vector<int>(j))
#define mod 1000000007
#define pi 3.14159265358979324
typedef long long int lint;
int main() {
long double A, B, H, H_2... | [["-", 0, 57, 64, 9, 0, 1, 0, 11, 17, 110], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 31, 13], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 17, 48], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 12, 22]] | 1 | 154 |
#include <bits/stdc++.h>
using namespace std;
int main() {
double a, b, h, m, angle, pi = 3.14159265358979;
cin >> a >> b >> h >> m;
angle = 2 * pi * abs(h / 12 + m / 12 / 60 - m / 60);
cout << setprecision(9)
<< sqrt(a * a + b * b - 2 * a * b * cos(min(2 * pi - angle, angle)));
} | #include <bits/stdc++.h>
using namespace std;
int main() {
double a, b, h, m, angle, pi = 3.14159265358979;
cin >> a >> b >> h >> m;
angle = 2 * pi * abs(h / 12 + m / 12 / 60 - m / 60);
cout << setprecision(14)
<< sqrt(a * a + b * b - 2 * a * b * cos(min(2 * pi - angle, angle)));
} | [["-", 0, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 13]] | 1 | 98 |
package main
import (
"fmt"
"math"
)
func main() {
var a, b float64
var h, m float64
fmt.Scan(&a, &b, &h, &m)
mc := m * 6.0
hc := (360/12)*h + mc/12
if mc == hc {
fmt.Println(b - a)
return
}
ang := math.Abs(mc - hc)
if ang > 180 {
ang = 360 - ang
}
// 予言定理
//c2 := math.Sqrt()
c2 := math.Pow(a, 2)... | package main
import (
"fmt"
"math"
)
func main() {
var a, b float64
var h, m float64
fmt.Scan(&a, &b, &h, &m)
mc := m * 6.0
hc := (360/12)*h + mc/12
if mc == hc {
fmt.Println(math.Abs(b - a))
return
}
ang := math.Abs(mc - hc)
if ang > 180 {
ang = 360 - ang
}
// 予言定理
//c2 := math.Sqrt()
c2 := math... | [["+", 0, 2, 3, 4, 0, 2, 63, 438, 439, 22], ["+", 0, 2, 3, 4, 0, 2, 63, 438, 0, 131], ["+", 0, 2, 3, 4, 0, 2, 63, 438, 119, 120], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 25]] | 7 | 170 |
import math
A,B,H,M = map(int,input().split())
angH = 30.0*H+0.5*M
angM = 6.0*M
angD = abs(angH-angM)
if angD > 180.0:
angD -= 180.0
cosD = math.cos(math.radians(angD))
ans2 = A*A + B*B - 2*A*B *cosD
ans = math.sqrt(ans2)
print(ans) | import math
A,B,H,M = map(int,input().split())
angH = 30.0*H+0.5*M
angM = 6.0*M
angD = abs(angH-angM)
if angD > 180.0:
angD = 360.0-angD
cosD = math.cos(math.radians(angD))
ans2 = A*A + B*B - 2*A*B *cosD
ans = math.sqrt(ans2)
print(ans) | [["-", 0, 57, 64, 196, 0, 1, 0, 677, 17, 110], ["-", 0, 57, 64, 196, 0, 1, 0, 677, 12, 531], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 31, 531], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 12, 22]] | 5 | 94 |
#include <bits/stdc++.h>
using namespace std;
#define fo(i, n) for (ll i = 0; i < n; i++)
#define endl "\n"
#define of(i, n) for (ll i = n - 1; i >= 0; i--)
#define ll long long
#define vec vector<ll>
#define fio \
ios_base::sync_with_stdio(false); ... | #include <bits/stdc++.h>
using namespace std;
#define fo(i, n) for (ll i = 0; i < n; i++)
#define endl "\n"
#define of(i, n) for (ll i = n - 1; i >= 0; i--)
#define ll long long
#define vec vector<ll>
#define fio \
ios_base::sync_with_stdio(false); ... | [["+", 0, 1, 0, 16, 31, 16, 12, 2, 63, 22], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 24], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 25], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151]] | 1 | 438 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define all(n) n.begin(), n.end()
#define yn(x) cout << (x ? "Yes" : "No") << endl;
#define pi 3.141592653589793238
int main() {
float a, b, h, m;
cin >> a >> b >> h >> m;
float a1 = h / 12 + m / 60 /... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define all(n) n.begin(), n.end()
#define yn(x) cout << (x ? "Yes" : "No") << endl;
#define pi 3.141592653589793238
int main() {
double a, b, h, m;
cin >> a >> b >> h >> m;
double a1 = h / 12 + m / 60... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 144 |
#include <cmath>
#include <iostream>
using namespace std;
int main() {
double a, b, h, m, ht, mt, t;
cin >> a >> b >> h >> m;
ht = 2 * M_PI * (h / 12 + m / 60 / 12);
mt = 2 * M_PI * m / 60;
t = min(abs(ht - mt), 2 * M_PI - abs(ht - mt));
printf("%.16llf\n", sqrt(a * a + b * b - 2 * a * b * cos(t)));
retur... | #include <cmath>
#include <iostream>
using namespace std;
int main() {
double a, b, h, m, ht, mt, t;
cin >> a >> b >> h >> m;
ht = 2 * M_PI * (h / 12 + m / 60 / 12);
mt = 2 * M_PI * m / 60;
t = min(abs(ht - mt), 2 * M_PI - abs(ht - mt));
printf("%.16lf\n", sqrt(a * a + b * b - 2 * a * b * cos(t)));
return... | [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 1 | 123 |
import math
def solution():
a, b, h, m = map(int, input().split())
return (a*a+b*b-2*a*b*cos((m*11/360-h/6)*pi))**.5
print(solution())
| from math import *
def solution():
a, b, h, m = map(int, input().split())
return (a*a+b*b-2*a*b*cos((m*11/360-h/6)*pi))**.5
print(solution())
| [["-", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 36, 36, 0, 656, 0, 686, 0, 314], ["+", 36, 36, 36, 36, 0, 656, 0, 686, 0, 487], ["+", 36, 36, 0, 656, 0, 686, 0, 690, 0, 48]] | 5 | 68 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
using namespace std;
int main() {
long double pi = acos(-1);
long double a, b, h, m;
cin >> a >> b >> h >> m;
// 長針について
// m * 12 *pi/360
// 短針について
// h * 60 * pi / 360 + m * pi * 360
long double diff... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
using namespace std;
int main() {
long double pi = acos(-1);
long double a, b, h, m;
cin >> a >> b >> h >> m;
// 長針について
// alp_1 = m * 12 *pi/360
// 短針について
// h * 60 * pi / 360 + m * pi / 360
long dou... | [["+", 0, 1, 0, 11, 12, 16, 12, 23, 0, 24], ["+", 0, 1, 0, 11, 12, 16, 12, 23, 0, 25], ["-", 0, 1, 0, 2, 3, 4, 0, 2, 63, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 2, 63, 22]] | 1 | 146 |
import math
a, b, h, m = map(int, input().split())
theta = (h * 60 * 0.5+ m * 0.5) % 360 - (h * 60 * 6 + m * 6) % 360
if theta > 180:
theta = 360 - theta
ab = math.sqrt(a**2+b**2-2*a*b*math.cos(theta))
print(ab) | import math
a, b, h, m = map(int, input().split())
theta = (h * 60 * 0.5+ m * 0.5) % 360 - (h * 60 * 6 + m * 6) % 360
if theta > 180:
theta = 360 - theta
ab = math.sqrt(a**2+b**2-2*a*b*math.cos(math.radians(theta)))
print(ab) | [["+", 12, 652, 3, 4, 0, 652, 63, 319, 500, 22], ["+", 12, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["+", 12, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]] | 5 | 92 |
A,B,H,M = map(int,input().split())
import math
cho = 6*M
tan = 30*(H+M/60)
angle = abs(cho-tan)
answer = math.sqrt(A*A+B*B-2*A*B*math.cos(angle))
print(answer) | A,B,H,M = map(int,input().split())
import math
cho = 6*M
tan = 30*(H+M/60)
angle = abs(cho-tan)
answer = math.sqrt(A*A+B*B-2*A*B*math.cos(angle/180*math.pi))
print(answer) | [["+", 12, 652, 3, 4, 0, 657, 31, 657, 17, 85], ["+", 12, 652, 3, 4, 0, 657, 31, 657, 12, 612], ["+", 12, 657, 12, 652, 3, 4, 0, 657, 17, 48], ["+", 12, 652, 3, 4, 0, 657, 12, 319, 500, 22], ["+", 12, 652, 3, 4, 0, 657, 12, 319, 0, 131], ["+", 12, 652, 3, 4, 0, 657, 12, 319, 319, 22]] | 5 | 77 |
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define fastIO \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)... | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define fastIO \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)... | [["+", 0, 16, 31, 16, 31, 16, 12, 2, 63, 22], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 24], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 25], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151]] | 1 | 264 |
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define fastIO \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)... | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define fastIO \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)... | [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 1 | 244 |
#include <bits/stdc++.h>
using namespace std;
#define pi 3.14159265358979323846264338327950L
int main() {
long double a, b, h, m;
cin >> a >> b >> h >> m;
//単針が何度か
long double x = 30 * (h + ((long double)m / 60));
//長針が何度か
long double y = m * 6;
long double arg;
if (x > y) {
arg = x - y;
} else {
... | #include <bits/stdc++.h>
using namespace std;
#define pi 3.14159265358979323846264338327950L
int main() {
long double a, b, h, m;
cin >> a >> b >> h >> m;
//単針が何度か
long double x = 30 * (h + ((long double)m / 60));
//長針が何度か
long double y = m * 6;
long double arg;
if (x > y) {
arg = x - y;
} else {
... | [["-", 0, 57, 64, 9, 0, 1, 0, 11, 17, 110], ["-", 0, 57, 64, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 31, 13], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 12, 22]] | 1 | 193 |
imput = gets.chomp.split(" ").map!{|item| item.to_f}
a = imput[0]
b = imput[1]
h = imput[2]
m = imput[3]
hang = Math::PI*(30*h + m/2)/180
mang = Math::PI*m*6/180
ang = mang - hang
puts ang
mx = Math.cos(ang)*b
my = Math.sin(ang)*b
puts Math.sqrt((a-mx)**2 + (my)**2) | imput = gets.chomp.split(" ").map!{|item| item.to_f}
a = imput[0]
b = imput[1]
h = imput[2]
m = imput[3]
hang = Math::PI*(30*h + m/2)/180
mang = Math::PI*m*6/180
ang = mang - hang
mx = Math.cos(ang)*b
my = Math.sin(ang)*b
puts Math.sqrt((a-mx)**2 + (my)**2) | [["-", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22], ["-", 36, 36, 0, 493, 0, 652, 3, 4, 0, 22]] | 4 | 120 |
import math
a,b,h,m = map(int, input().split())
ans = math.sqrt(float(a)**2+float(b)**2+2*a*b*math.cos((h/12 + m/720 - m/60)*math.pi*2))
print(ans) | import math
a,b,h,m = map(int, input().split())
ans = math.sqrt(float(a)**2+float(b)**2-2*a*b*math.cos((h/12 + m/720 - m/60)*math.pi*2))
print(ans) | [["-", 0, 662, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 17, 33]] | 5 | 77 |
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define int ll
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vpii = vector<pii>;
using vvpii = vector<vpii>;
template <typename T, typename U>
ostream &operator<<(ostream &o, const pair<T, U> ... | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define int ll
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vpii = vector<pii>;
using vvpii = vector<vpii>;
template <typename T, typename U>
ostream &operator<<(ostream &o, const pair<T, U> ... | [["+", 51, 16, 31, 16, 31, 16, 31, 23, 0, 24], ["+", 31, 16, 31, 16, 31, 23, 0, 16, 17, 72], ["+", 31, 16, 31, 23, 0, 16, 12, 16, 31, 22], ["+", 31, 16, 31, 23, 0, 16, 12, 16, 17, 85], ["+", 31, 16, 31, 23, 0, 16, 12, 16, 12, 13], ["+", 51, 16, 31, 16, 31, 16, 31, 23, 0, 25]] | 1 | 313 |
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
double absolute(double x) { return x < 0.0 ? -1.0 * x : x; }
double get_angle(int hour, int minute) {
double angle = absolute((double)minute * 6.0 - (double)hour * 30.0 -
(double)minute * 0.5);
... | #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
double absolute(double x) { return x < 0.0 ? -1.0 * x : x; }
double get_angle(int hour, int minute) {
double angle = absolute((double)minute * 6.0 - (double)hour * 30.0 -
(double)minute * 0.5);
... | [["+", 0, 16, 31, 16, 31, 16, 12, 2, 63, 22], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 24], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 25], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151]] | 1 | 163 |
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int a, b, h, m;
int main() {
scanf("%d%d%d%d", &a, &b, &h, &m);
double rad1 = 1.0 * 2 * M_PI * (1.0 * h / 12 + 1.0 / 60 / 12 * m);
double rad2 = 1.0 * 2 * M_PI * m / 60;
double rad = rad1 - rad2;
/*
if(rad1>rad2){
rad = rad1... | #include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int a, b, h, m;
int main() {
scanf("%d%d%d%d", &a, &b, &h, &m);
double rad1 = 1.0 * 2 * M_PI * (1.0 * h / 12 + 1.0 / 60 / 12 * m);
double rad2 = 1.0 * 2 * M_PI * m / 60;
double rad = rad1 - rad2;
/*
if(rad1>rad2){
rad = rad1... | [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 0 | 130 |
#include <cmath>
#include <iostream>
#define PI 3.14159265
using namespace std;
int main() {
long double a, b, h, m;
cin >> a >> b >> h >> m;
long double C = PI * 2 * (h / 12.0 + (m / 60.0) / 12.0 - m / 60.0);
long double val = pow(a, 2) + pow(b, 2) - 2 * a * b * cos(C);
printf("%20.20Lf\n", sqrtl(val));
}
|
#include <cmath>
#include <iostream>
#define PI 3.14159265358979323846264338327950L
using namespace std;
int main() {
long double a, b, h, m;
cin >> a >> b >> h >> m;
long double C = PI * 2 * (h / 12.0 + (m / 60.0) / 12.0 - m / 60.0);
long double val = pow(a, 2) + pow(b, 2) - 2 * a * b * cos(C);
printf("%20... | [["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59]] | 1 | 105 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
long double a, b, h, m;
const double pi = 3.14159265358979323846;
cin >> a >> b >> h >> m;
long double s = pi * (m * 6.5 + h * 30.0) / 180.0;
long double ans = sqrt(a * a + b * b - 2 * a * b * cosl(s));
cout << fixed << setpre... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
long double a, b, h, m;
const double pi = 3.141592653589793;
cin >> a >> b >> h >> m;
long double s = pi * (m * 5.5 - h * 30.0) / 180.0;
long double ans = sqrt(a * a + b * b - 2 * a * b * cosl(s));
cout << fixed << setprecisio... | [["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 31, 16, 12, 23, 0, 16, 31, 16, 12, 13], ["-", 51, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 31, 16, 12, 23, 0, 16, 31, 16, 12, 13], ["+", 51, 16, 31, 16, 12, 23, 0, 16, 17, 33]] | 1 | 101 |
import math
a, b, h, m = map(int, input().split())
deg_h = 360 / 12
deg_m = 360 / 60
H = h * deg_h + m * deg_m
M = m * deg_m
deg = abs(H - M)
if deg > 180:
deg = 360 - deg
rad = (deg/180) * math.pi
c = math.sqrt(a**2 + b**2 - 2*a*b*math.cos(rad))
print(c)
| import math
a, b, h, m = map(int, input().split())
deg_h = 360 / 12
deg_m = 360 / 60
H = h * deg_h + m * (deg_h/60)
M = m * deg_m
deg = abs(H - M)
if deg > 180:
deg = 360 - deg
rad = (deg/180) * math.pi
c = math.sqrt(a**2 + b**2 - 2*a*b*math.cos(rad))
print(c)
| [["-", 0, 1, 0, 662, 12, 657, 12, 657, 12, 22], ["+", 0, 662, 12, 657, 12, 657, 12, 23, 0, 24], ["+", 12, 657, 12, 657, 12, 23, 0, 657, 31, 22], ["+", 12, 657, 12, 657, 12, 23, 0, 657, 17, 85], ["+", 12, 657, 12, 657, 12, 23, 0, 657, 12, 612], ["+", 0, 662, 12, 657, 12, 657, 12, 23, 0, 25]] | 5 | 106 |
#include <math.h>
#include <stdio.h>
int main() {
int a, b, h, m;
double theta, c;
scanf("%d %d %d %d", &a, &b, &h, &m);
theta = 2 * M_PI *
((double)h / 12.0 + ((double)m / 60.0) / 12.0 - (double)m / 60.0);
c = (double)(a * a + b * b) - (double)(2 * a * b) * cos(theta);
printf("%f\n", sqrt(c));... | #include <math.h>
#include <stdio.h>
int main() {
int a, b, h, m;
double theta, c;
scanf("%d %d %d %d", &a, &b, &h, &m);
theta = 2 * M_PI *
((double)h / 12.0 + ((double)m / 60.0) / 12.0 - (double)m / 60.0);
c = (double)(a * a + b * b) - (double)(2 * a * b) * cos(theta);
printf("%.15f\n", sqrt(c... | [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 0 | 123 |
import math
A,B,H,M = map(int,input().split())
k = max(H*30+M*0.5,M*6)-min(H*30+M*0.5,M*6)
if k >= 180:
k = 360-k
print(k)
print(math.sqrt(A*A+B*B-2*A*B*math.cos(math.radians(k)))) | import math
A,B,H,M = map(int,input().split())
k = max(H*30+M*0.5,M*6)-min(H*30+M*0.5,M*6)
if k >= 180:
k = 360-k
print(math.sqrt(A*A+B*B-2*A*B*math.cos(math.radians(k)))) | [["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25], ["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24]] | 5 | 100 |
import math
A, B, H, M = map(int, open(0).split())
arg_b = math.pi * float(M) / 30
arg_a = (math.pi / 6) * (float(H) + float(M)/60)
K = abs(arg_b - arg_a)
C = math.sqrt(A*A+B*B - 2*A*B*math.cos(K))
print(C)
| import math
A, B, H, M = map(int, input().split())
arg_b = math.pi * float(M) / 30
arg_a = (math.pi / 6) * (float(H) + float(M)/60)
K = abs(arg_b - arg_a)
C = math.sqrt(A*A+B*B - 2*A*B*math.cos(K))
print(C)
| [["-", 3, 4, 0, 652, 63, 319, 500, 652, 63, 22], ["+", 3, 4, 0, 652, 63, 319, 500, 652, 63, 22], ["-", 0, 652, 63, 319, 500, 652, 3, 4, 0, 612]] | 5 | 97 |
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#define PI acos(-1)
int main() {
//変数宣言
int A, B;
int H, M;
double SA, SB;
double AX, AY, BX, BY;
double ans;
scanf("%d %d %d %d", &A, &B, &H, &M);
SA = (double)(M + (60.0 * H)) / (12.0 * 60.0);
SB = (double)M / 60.0;
AX = (double)A * ... | #include <math.h>
#include <stdio.h>
#include <stdlib.h>
#define PI acos(-1)
int main() {
//変数宣言
int A, B;
int H, M;
double SA, SB;
double AX, AY, BX, BY;
double ans;
scanf("%d %d %d %d", &A, &B, &H, &M);
SA = (double)(M + (60.0 * H)) / (12.0 * 60.0);
SB = (double)M / 60.0;
AX = (double)A * ... | [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 0 | 194 |
import numpy
def main():
A, B, H, M = map(float, input().split())
R = H/12 + M*0.5/360
r = M/60
cos = np.cos((R-r)*2*np.pi)
C = np.sqrt(A*A + B*B - 2*A*B*cos)
print(C)
if __name__ == '__main__':
main() | import numpy as np
def main():
A, B, H, M = map(float, input().split())
R = H/12 + M*0.5/360
r = M/60
cos = np.cos((R-r)*2*np.pi)
C = np.sqrt(A*A + B*B - 2*A*B*cos)
print(C)
if __name__ == '__main__':
main() | [["+", 36, 36, 0, 656, 0, 596, 141, 704, 0, 272], ["+", 36, 36, 0, 656, 0, 596, 141, 704, 705, 22]] | 5 | 97 |
import math
def main():
A, B, H, M = map(float, input().split())
R = H/12 + M*0.5/360
r = M/60
cos = math.cos((R-r*2*math.pi))
C = math.sqrt(A*A + B*B - 2*A*B*cos)
print(C)
if __name__ == '__main__':
main() | import math
def main():
A, B, H, M = map(float, input().split())
R = H/12 + M*0.5/360
r = M/60
cos = math.cos((R-r)*2*math.pi)
C = math.sqrt(A*A + B*B - 2*A*B*cos)
print(C)
if __name__ == '__main__':
main() | [["+", 3, 4, 0, 657, 31, 657, 31, 23, 0, 25], ["-", 0, 662, 12, 652, 3, 4, 0, 23, 0, 25]] | 5 | 97 |
import math
a,b,h,m = map(lambda x:int(x), input().split(' '))
#2つの針の長さと間の角度から距離を算出
def dst(a,b,deg):
return ((a**2+b**2)-(2*a*b*math.cos(math.radians(deg))))**0.5
deg_1 = h*(60*h+m)*0.5
deg_2 = m*6
deg = abs(deg_1-deg_2)
if deg > 180:
deg = 360-deg
ans = dst(a,b,deg)
print(ans)
#print(dst(3,4,90)) | import math
a,b,h,m = map(lambda x:int(x), input().split(' '))
#2つの針の長さと間の角度から距離を算出
def dst(a,b,deg):
return ((a**2+b**2)-(2*a*b*math.cos(math.radians(deg))))**0.5
deg_1 = (60*h+m)*0.5
deg_2 = m*6
deg = abs(deg_1-deg_2)
if deg > 180:
deg = 360-deg
ans = dst(a,b,deg)
print(ans)
#print(dst(3,4,90)) | [["-", 0, 1, 0, 662, 12, 657, 31, 657, 31, 22], ["-", 0, 1, 0, 662, 12, 657, 31, 657, 17, 48]] | 5 | 127 |
#include "bits/stdc++.h"
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using namespace std;
const int INF = 1 << 30;
const long long MOD = 1000000000 + 7;
const double PI = atan(-1);
// 3.14159265358979323846;
int main() {
int A, B;
cin >> A >> B;... | #include "bits/stdc++.h"
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using namespace std;
const int INF = 1 << 30;
const long long MOD = 1000000000 + 7;
const double PI = acos(-1);
int main() {
int A, B;
cin >> A >> B;
int H, M;
cin >> H >> ... | [["-", 0, 30, 0, 43, 49, 50, 51, 2, 63, 22], ["+", 0, 30, 0, 43, 49, 50, 51, 2, 63, 22]] | 1 | 170 |
#include "bits/stdc++.h"
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using namespace std;
const int INF = 1 << 30;
const long long MOD = 1000000000 + 7;
const double PI = 3.14159265358979323846;
int main() {
int A, B;
cin >> A >> B;
int H, M;
... | #include "bits/stdc++.h"
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using namespace std;
const int INF = 1 << 30;
const long long MOD = 1000000000 + 7;
const double PI = 3.14159265358979323846;
int main() {
int A, B;
cin >> A >> B;
int H, M;
... | [["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 85], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]] | 1 | 245 |
#include <math.h>
int main() {
int a, b, h, m;
scanf("%d %d %d %d", &a, &b, &h, &m);
double l, s;
l = h * 30 + m / 2;
s = 6 * m;
double tmp;
tmp = fabs(l - s);
double c;
c = sqrt(a * a + b * b - 2 * a * b * cos(tmp * M_PI / 180));
printf("%.10lf", c);
} | #include <math.h>
int main() {
int a, b, h, m;
scanf("%d %d %d %d", &a, &b, &h, &m);
double l, s;
l = h * 30 + (double)m / 2;
s = 6 * m;
double tmp;
tmp = fabs(l - s);
double c;
c = sqrt(a * a + b * b - 2 * a * b * cos(tmp * M_PI / 180));
printf("%.10lf", c);
}
| [["+", 0, 11, 12, 16, 12, 16, 31, 74, 0, 24], ["+", 12, 16, 12, 16, 31, 74, 39, 77, 39, 40], ["+", 0, 11, 12, 16, 12, 16, 31, 74, 0, 25]] | 0 | 109 |
def squared(x):
return x**2
def theta(h, m):
mr = 6 * m
hr = 30 * h + m / 2
r = abs(float(hr) - float(mr))
return r
def length(a, b, h, m):
return math.sqrt(squared(a) + squared(b) - 2 * a * b * math.cos(math.radians(theta(h, m))))
a, b, h, m = [x for x in map(int, input().split())]
print(l... | import math
def squared(x):
return x**2
def theta(h, m):
mr = 6 * m
hr = 30 * h + m / 2
r = abs(float(hr) - float(mr))
return r
def length(a, b, h, m):
return math.sqrt(squared(a) + squared(b) - 2 * a * b * math.cos(math.radians(theta(h, m))))
a, b, h, m = [x for x in map(int, input().split(... | [["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22]] | 5 | 137 |
a,b,h,m=map(int, sys.stdin.readline().rstrip().split())
m_angle = m*6
h_angle = h*30+m/2
theta=abs(h_angle-m_angle)
if theta>180:theta=360-theta
c = a**2+b**2-2*a*b*math.cos(math.radians(theta))
print(c**0.5)
| import sys
import math
a,b,h,m=map(int, sys.stdin.readline().rstrip().split())
m_angle = m*6
h_angle = h*30+m/2
theta=abs(h_angle-m_angle)
if theta>180:theta=360-theta
c = a**2+b**2-2*a*b*math.cos(math.radians(theta))
print(c**0.5) | [["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22]] | 5 | 93 |
# array = [*1..q].map { |_| gets.split.map(&:to_i) }
# n = gets.split.map(&:to_i)
# a = [*1..m].repeated_combination(n).to_a
a,b,h,m = gets.split.map(&:to_i)
if ((30*h+0.5*m) - 6*m).abs < 180
w = ((30*h+0.5*m) - 6*m).abs
else
w = ((360 - 6*m) - (30*h+0.5*m)).abs
end
h = a * Math.sin(w / 180.0000000000 * Math::P... | # array = [*1..q].map { |_| gets.split.map(&:to_i) }
# n = gets.split.map(&:to_i)
# a = [*1..m].repeated_combination(n).to_a
a,b,h,m = gets.split.map(&:to_i)
if ((30*h+0.5*m) - 6*m).abs < 180
w = ((30*h+0.5*m) - 6*m).abs
else
w = ((360 - 6*m) + (30*h+0.5*m)).abs
end
# PI = 3.14159265358979323846264
h = a * ... | [["-", 0, 662, 12, 652, 486, 739, 0, 738, 17, 33], ["+", 0, 662, 12, 652, 486, 739, 0, 738, 17, 72], ["-", 12, 652, 3, 4, 0, 738, 31, 738, 12, 531], ["+", 12, 652, 3, 4, 0, 738, 31, 738, 12, 531]] | 4 | 143 |
import math
A,B,H,M = map(int, input().split())
hourdegrees = ( H * 60 + M ) * (0.5)
mindegrees = M*(6)
if mindegrees < hourdegrees:
degree = hourdegrees - mindegrees
elif mindegrees > hourdegrees:
degree = mindegrees - hourdegrees
distance = math.sqrt(A ** 2 + B ** 2 -2 * A * B * math.cos(math.radians(degr... | import math
A,B,H,M = map(int, input().split())
hourdegrees = ( H * 60 + M ) * (0.5)
mindegrees = M*(6)
if mindegrees < hourdegrees:
degree = hourdegrees - mindegrees
else:
degree = mindegrees - hourdegrees
distance = math.sqrt(A ** 2 + B ** 2 -2 * A * B * math.cos(math.radians(degree) ) )... | [["-", 36, 36, 0, 656, 0, 57, 75, 665, 0, 683], ["-", 0, 656, 0, 57, 75, 665, 15, 666, 0, 22], ["-", 0, 656, 0, 57, 75, 665, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 75, 76, 0, 95]] | 5 | 98 |
#include <algorithm>
#include <bitset>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <set>
#include <stdlib.h>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef pai... | #include <algorithm>
#include <bitset>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <set>
#include <stdlib.h>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef pai... | [["-", 8, 9, 0, 43, 49, 50, 51, 16, 31, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 31, 22]] | 1 | 286 |
#include <cmath>
#include <cstdio>
#include <iostream>
using namespace std;
int a, b, h, m, ans, sz, fz, j;
int main() {
cin >> a >> b >> h >> m;
sz = (60 * h + m) * 0.5;
fz = 6 * m;
j = abs(sz - fz);
if (j > 180)
j = 360 - j;
ans = cos(j * M_PI / 180);
printf("%.20f", sqrt(a * a + b * b - 2 * a * b *... | #include <cmath>
#include <cstdio>
#include <iostream>
using namespace std;
int a, b, h, m;
double ans, sz, fz, j;
int main() {
cin >> a >> b >> h >> m;
sz = (60 * h + m) * 0.5;
fz = 6 * m;
j = abs(sz - fz);
if (j > 180)
j = 360 - j;
ans = cos(j * M_PI / 180);
printf("%.20f", sqrt(a * a + b * b - 2 * ... | [["-", 36, 36, 36, 36, 0, 30, 0, 43, 0, 21], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 0, 35], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40]] | 1 | 122 |
<?php
fscanf(STDIN, "%d%d%d%d", $A, $B, $H, $M);
$argH = ($H/12+$M/12/60)*2*pi();
$argM = $M/60*2*pi();
$dx = $A*cos($argH) - $B*cos($argM);
$dy = $A*sin($argH) - $B*sin($argM);
printf("%f", ($dx**2+$dy**2)**0.5); | <?php
fscanf(STDIN, "%d%d%d%d", $A, $B, $H, $M);
$argH = ($H/12+$M/12/60)*2*pi();
$argM = $M/60*2*pi();
$dx = $A*cos($argH) - $B*cos($argM);
$dy = $A*sin($argH) - $B*sin($argM);
printf("%.18f", ($dx**2+$dy**2)**0.5); | [["-", 0, 613, 3, 3, 0, 28, 0, 609, 0, 610], ["+", 0, 613, 3, 3, 0, 28, 0, 609, 0, 610]] | 6 | 122 |
import math
a,b,h,m = map(int,input().split())
zi = h * 30 + m * 0.5
hun = m * 60
kaku = abs(zi-hun)
if kaku > 180:
kaku = 360 - kaku
kaku = math.cos(math.radians(kaku))
ans2 = a**2 + b**2 - 2*a*b*kaku
print(math.sqrt(ans2)) | import math
a,b,h,m = map(int,input().split())
zi = h * 30 + m * 0.5
hun = m * 6
kaku = abs(zi-hun)
if kaku > 180:
kaku = 360 - kaku
kaku = math.cos(math.radians(kaku))
ans2 = a**2 + b**2 - 2*a*b*kaku
print(math.sqrt(ans2)) | [["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612]] | 5 | 93 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define sct(tc) scanf("%lld", &tc)
#define scl(n) scanf("%lld", &n)
#define scll(n, m) scanf("%lld%lld", &n, &m)
#define scs(ch) scanf("%s", ch)
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define PI 3.141592653589793238... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define sct(tc) scanf("%lld", &tc)
#define scl(n) scanf("%lld", &n)
#define scll(n, m) scanf("%lld%lld", &n, &m)
#define scs(ch) scanf("%s", ch)
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define PI 3.141592653589793238... | [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 1 | 180 |
#include <math.h>
#include <stdio.h>
typedef long double D;
const D pi = 3.14159265358979323846264338327950288419716939937510L;
signed main(void) {
int A, B, H, M;
if (~scanf("%d %d %d %d", &A, &B, &H, &M)) {
D theta = ((H * 60 + M) / 2.0 - 6 * M) * pi / 180.0,
x = (A - B * cos(theta)), y = B * sin(theta)... | #include <math.h>
#include <stdio.h>
typedef double D;
const D pi = 3.14159265358979323846264338327950288419716939937510L;
signed main(void) {
int A, B, H, M;
if (~scanf("%d %d %d %d", &A, &B, &H, &M)) {
D theta = ((H * 60 + M) / 2.0 - 6 * M) * pi / 180.0, x, y;
x = (A - B * cos(theta)), y = B * sin(theta);... | [["-", 36, 36, 0, 30, 0, 134, 39, 86, 0, 96], ["+", 8, 9, 0, 57, 64, 9, 0, 43, 49, 22], ["+", 8, 9, 0, 57, 64, 9, 0, 43, 0, 21], ["+", 8, 9, 0, 57, 64, 9, 0, 43, 0, 35]] | 1 | 123 |
#include <bits/stdc++.h>
using namespace std;
static const double pi = 3.141592653589793;
void solve() {
double A, B, H, M;
cin >> A >> B >> H >> M;
double radA = 2 * pi * (60 * H + M) / (60 * 12);
double radB = 2 * pi * M / 60;
double ans = sqrt(A * A + B * B - 2 * A * B * cos(radA - radB));
cout << an... | #include <bits/stdc++.h>
using namespace std;
static const double pi = 3.141592653589793;
void solve() {
double A, B, H, M;
cin >> A >> B >> H >> M;
double radA = 2 * pi * (60 * H + M) / (60 * 12);
double radB = 2 * pi * M / 60;
double ans = sqrt(A * A + B * B - 2 * A * B * cos(radA - radB));
cout << se... | [["-", 0, 1, 0, 16, 31, 16, 31, 16, 12, 22], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 151], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22]] | 1 | 121 |
A, B, H, M = map(int, input().split())
import math
s = 30*(H+M/60)
t = 6*M
r = abs(s-t)
if r>180:
r = 360-r
print(r)
a = math.sqrt(A**2+B**2-2*A*B*math.cos(math.radians(r)))
print(a) | A, B, H, M = map(int, input().split())
import math
s = 30*(H+M/60)
t = 6*M
r = abs(s-t)
if r>180:
r = 360-r
a = math.sqrt(A**2+B**2-2*A*B*math.cos(math.radians(r)))
print(a) | [["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]] | 5 | 96 |
#include <bits/stdc++.h>
using namespace std;
#define PI 3.141592653589
int main() {
int a, b, h, m;
cin >> a >> b >> h >> m;
long double ans = 0.0, rad;
rad = 6 * m - 30 * h - 0.5 * m;
// if ( rad > 180 )
// rad = 360 - rad;
if (rad < 0)
rad = -rad;
ans = pow(a, 2) + pow(b, 2) - 2 * a * b * cos... | #include <bits/stdc++.h>
using namespace std;
#define PI 3.141592653589
int main() {
double a, b, h, m;
cin >> a >> b >> h >> m;
double ans, rad;
rad = 6 * m - 30 * h - 0.5 * m;
// if ( rad > 180 )
// rad = 360 - rad;
if (rad < 0)
rad = -rad;
ans = pow(a, 2) + pow(b, 2) - 2 * a * b * cos(rad / 1... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]] | 1 | 116 |
import math
a,b,h,m=map(int,input().split())
tyok=h*30+m*0.5
tank=m*6
sa=0
if abs(tyok-tank)>180:
sa=abs(tyok-tank)-180
else:
sa=abs(tyok-tank)
c=a**2+b**2-2*a*b*math.cos(math.radians(sa))
print(math.sqrt(c)) | import math
a,b,h,m=map(int,input().split())
tyok=h*30+m*0.5
tank=m*6
sa=0
if abs(tyok-tank)>180:
sa=abs(tyok-tank)-360
else:
sa=abs(tyok-tank)
c=a**2+b**2-2*a*b*math.cos(math.radians(sa))
print(math.sqrt(c))
| [["-", 64, 196, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 12, 612]] | 5 | 105 |
import math
a,b,h,m = map(int, input().split())
h1 = h * 30
m1 = m * 5.5
r = abs(h1 - m1)
a1 = a ** 2
b1 = b ** 2
ab = a * b
if r == 0:
print(abs(a-b))
elif r == 180:
print(a + b)
elif 180 < r:
r1 = r -180
cos = math.cos(math.radians(r1))
d = a1 + b1 - 2 * ab * cos
ans = d ** (1/2)
print(ans)
else:
co... | import math
a,b,h,m = map(int, input().split())
h1 = h * 30
m1 = m * 5.5
r = abs(h1 - m1)
a1 = a ** 2
b1 = b ** 2
ab = a * b
if r == 0:
print(abs(a-b))
elif r == 180:
print(a + b)
elif 180 < r:
r1 = 360 - r
cos = math.cos(math.radians(r1))
d = a1 + b1 - 2 * ab * cos
ans = d ** (1/2)
print(ans)
else:
c... | [["-", 64, 196, 0, 1, 0, 662, 12, 657, 31, 22], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 31, 612], ["-", 64, 196, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 12, 22]] | 5 | 166 |
import sys
from io import StringIO
import unittest
import math
# 参考1:余弦定理(この頁を学習すると、|??|に入る式が分かり、直角三角形でない場合でも第3の辺aの長さを求めることができるようになります。)
# https://www.geisya.or.jp/~mwm48961/kou2/cos_rule.htm
# aの2乗 = bの2乗 + cの2乗 − 2bccosA
# 参考2:コサイン等の関数説明
# https://note.nkmk.me/python-math-sin-cos-tan/
def resolve():
a, b, h, m ... | import sys
from io import StringIO
import unittest
import math
# 参考1:余弦定理(この頁を学習すると、|??|に入る式が分かり、直角三角形でない場合でも第3の辺aの長さを求めることができるようになります。)
# https://www.geisya.or.jp/~mwm48961/kou2/cos_rule.htm
# aの2乗 = bの2乗 + cの2乗 − 2bccosA
# 参考2:コサイン等の関数説明
# https://note.nkmk.me/python-math-sin-cos-tan/
def resolve():
a, b, h, m ... | [["-", 64, 196, 0, 1, 0, 652, 63, 319, 500, 22], ["-", 64, 196, 0, 1, 0, 652, 63, 319, 0, 131], ["-", 64, 196, 0, 1, 0, 652, 63, 319, 319, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22]] | 5 | 487 |
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#define debug(var) cerr << (#var) << " = " << (var) << endl;
#else
#define debug(var)
#endif
void init() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
const double EPSILON = 1e-6;
const double PI = acos(-1);
bool eq(double a, double b) { ... | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#define debug(var) cerr << (#var) << " = " << (var) << endl;
#else
#define debug(var)
#endif
void init() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
const double EPSILON = 1e-9;
const double PI = acos(-1);
bool eq(double a, double b) { ... | [["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 1 | 276 |
#include <cmath>
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
int a, b, h, m;
cin >> a >> b >> h >> m;
double ans =
a * a + b * b - 2 * a * b * cos(2 * M_PI * ((h + m / 60) / 12 - m / 60));
printf("%.12lf\n", sqrt(ans));
return 0;
}
/*
#include<bits/stdc++.h>
using namespace ... | #include <cmath>
#include <cstdio>
#include <iostream>
using namespace std;
int main() {
double a, b, h, m;
cin >> a >> b >> h >> m;
double ans =
a * a + b * b - 2 * a * b * cos(2 * M_PI * ((h + m / 60) / 12 - m / 60));
printf("%.12lf\n", sqrt(ans));
return 0;
}
| [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]] | 1 | 92 |
#include <math.h>
#include <stdio.h>
int main(void) {
int a = 0, b = 0, h = 0, m = 0;
double rad = 0.0;
double ans = 0.0;
scanf("%d", &a);
scanf("%d", &b);
scanf("%d", &h);
scanf("%d", &m);
rad = h * 30.0 + (double)m * 30.0 / 60.0;
rad = (double)m * 360.0 / 60.0 - rad;
rad = rad / 180.0 * 3.14159... | #include <math.h>
#include <stdio.h>
int main(void) {
int a = 0, b = 0, h = 0, m = 0;
double rad = 0.0;
double ans = 0.0;
scanf("%d", &a);
scanf("%d", &b);
scanf("%d", &h);
scanf("%d", &m);
rad = h * 30.0 + (double)m * 30.0 / 60.0;
rad = (double)m * 360.0 / 60.0 - rad;
rad = rad / 180.0 * 3.14159... | [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 0 | 151 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.