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 <algorithm> #include <bits/stdc++.h> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #includ...
#include <algorithm> #include <bits/stdc++.h> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #includ...
[["-", 12, 2, 3, 4, 0, 16, 31, 16, 31, 13], ["+", 12, 2, 3, 4, 0, 16, 31, 16, 31, 22]]
1
500
import math import numpy as np def main(): A,B,H,M = map(int, input().split()) min = H*60+M H_loc = min * 0.5 M_loc = M * 60 if abs(H_loc-M_loc) > 180: theta = 360 - abs(H_loc - M_loc) else: theta = abs(H_loc - M_loc) r = math.sqrt(A**2 + B**2 - 2*A*B*np.cos(n...
import math import numpy as np def main(): A,B,H,M = map(int, input().split()) min = H*60+M H_loc = min * 0.5 M_loc = M * 6 if abs(H_loc-M_loc) > 180: theta = 360 - abs(H_loc - M_loc) else: theta = abs(H_loc - M_loc) #print(theta) r = math.sqrt(A**2 + B**2...
[["-", 8, 196, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 12, 612]]
5
126
#include <bits/stdc++.h> using namespace std; int main() { int a, b, h, m; double th; double ans; cin >> a >> b >> h >> m; th = abs(h * 30 - m * 6); if (th > 180) th = 360 - th; ans = sqrt(a * a + b * b - 2 * a * b * cos(M_PI * th / 180)); cout << fixed << setprecision(15); cout << ans << end...
#include <bits/stdc++.h> using namespace std; int main() { int a, b, h, m; double th; double ans; cin >> a >> b >> h >> m; th = abs(h * 30 + m * 0.5 - m * 6); if (th > 180) th = 360 - th; ans = sqrt(a * a + b * b - 2 * a * b * cos(M_PI * th / 180)); cout << fixed << setprecision(15); cout << ...
[["+", 12, 2, 3, 4, 0, 16, 31, 16, 17, 72], ["+", 3, 4, 0, 16, 31, 16, 12, 16, 31, 22], ["+", 3, 4, 0, 16, 31, 16, 12, 16, 17, 48], ["+", 3, 4, 0, 16, 31, 16, 12, 16, 12, 13]]
1
108
import math A,B,H,M=(int(x) for x in input().split()) ang=30*H-6*M L=math.sqrt(A**2+B**2-2*A*B*math.cos(math.radians(ang))) print(L)
import math A,B,H,M=(int(x) for x in input().split()) ang=30*H+0.5*M-6*M L=math.sqrt(A**2+B**2-2*A*B*math.cos(math.radians(ang))) print(L)
[["+", 0, 1, 0, 662, 12, 657, 31, 657, 17, 72], ["+", 0, 662, 12, 657, 31, 657, 12, 657, 31, 531], ["+", 0, 662, 12, 657, 31, 657, 12, 657, 17, 48], ["+", 0, 662, 12, 657, 31, 657, 12, 657, 12, 22]]
5
71
A,B,H,M=map(int,input().split()) x=360*(H+M/60)/12-360*M/60 cos=math.cos(math.radians(x)) C = A**2 + B**2 - 2*A*B*(cos) print(C**0.5)
import math A,B,H,M=map(int,input().split()) x=360*(H+M/60)/12-360*M/60 cos=math.cos(math.radians(x)) C = A**2 + B**2 - 2*A*B*(cos) 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
77
#include <cmath> #include <cstdio> #include <cstring> const double pi = 3.1415926576; int main() { double a, b, h, m; scanf("%lf%lf%lf%lf", &a, &b, &h, &m); double angle1, angle2, ag; angle1 = (h * 60.0 + m) * 2.0 * pi / (12.0 * 60.0); angle2 = m * 2.0 * pi / 60.0; ag = angle1 - angle2; if (ag < 0) ag...
#include <cmath> #include <cstdio> #include <cstring> const double pi = 3.141592653589793; int main() { double a, b, h, m; scanf("%lf%lf%lf%lf", &a, &b, &h, &m); double angle1, angle2, ag; angle1 = (h * 60.0 + m) * 2.0 * pi / (12.0 * 60.0); angle2 = m * 2.0 * pi / 60.0; ag = angle1 - angle2; if (ag < 0) ...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13]]
1
130
#include <algorithm> #include <bits/stdc++.h> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #includ...
#include <algorithm> #include <bits/stdc++.h> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #includ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 31, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 13]]
1
1,266
import math a,b,h,m=map(int,input().split()) theta_1=(h+(m/60))*(math.pi/6) theta_2=math.pi/30 theta_1=2*math.pi-(theta_1-math.pi/2) theta_2=2*math.pi-(theta_2-math.pi/2) y1=a*math.sin(theta_1) x1=a*math.cos(theta_1) y2=b*math.sin(theta_2) x2=b*math.cos(theta_2) print(math.sqrt((x1-x2)**2+(y1-y2)**2))
import math a,b,h,m=map(int,input().split()) theta_1=(h+(m/60))*(math.pi/6) theta_2=m*(math.pi/30) theta_1=2*math.pi-(theta_1-math.pi/2) theta_2=2*math.pi-(theta_2-math.pi/2) y1=a*math.sin(theta_1) x1=a*math.cos(theta_1) y2=b*math.sin(theta_2) x2=b*math.cos(theta_2) print(math.sqrt((x1-x2)**2+(y1-y2)**2))
[["+", 0, 656, 0, 1, 0, 662, 12, 657, 31, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 48], ["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 24], ["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 25]]
5
145
#include <math.h> #include <stdio.h> #define PI 3.14159265359 double min(double x, double y) { return x < y ? x : y; } int main() { int a, b, h, m; scanf("%d%d%d%d", &a, &b, &h, &m); double an = fabs(6 * m - 0.5 * (h * 60 + m)); an = min(fabs(180 - an), an); long double ans = sqrtl(b * b + a * a - 2 * b * a *...
#include <math.h> #include <stdio.h> #define PI 3.14159265359 double min(double x, double y) { return x < y ? x : y; } int main() { int a, b, h, m; scanf("%d%d%d%d", &a, &b, &h, &m); double an = fabs(6 * m - 0.5 * (h * 60 + m)); an = min(fabs(360 - an), an); long double ans = sqrtl(b * b + a * a - 2 * b * a *...
[["-", 3, 4, 0, 2, 3, 4, 0, 16, 31, 13], ["+", 3, 4, 0, 2, 3, 4, 0, 16, 31, 13]]
0
138
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i = 0; (i) < (n); i++) ...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i = 0; (i) < (n); i++) ...
[["-", 8, 9, 0, 57, 64, 1, 0, 11, 17, 110], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 17, 32]]
1
485
# coding:utf-8 import sys import math import time #import numpy as np import collections from collections import deque from collections import Counter import queue import copy import bisect import heapq import itertools sys.setrecursionlimit(10**7) #N, Q = map(int, input().split()) #G = [list(input()) for i in rang...
# coding:utf-8 import sys import math import time #import numpy as np import collections from collections import deque from collections import Counter import queue import copy import bisect import heapq import itertools sys.setrecursionlimit(10**7) #N, Q = map(int, input().split()) #G = [list(input()) for i in rang...
[["-", 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
221
import math A = list(map(int, input().split())) L = 30 * A[2] + 0.5 * A[3] S = 6 * A[3] print(L,S) x = A[0]*A[0] + A[1]*A[1] - 2*A[0]*A[1]*math.cos(math.radians(min(math.fabs(L-S)%360,360-math.fabs(L-S)%360))) print(math.sqrt(x))
import math A = list(map(int, input().split())) L = 30 * A[2] + 0.5 * A[3] S = 6 * A[3] x = A[0]*A[0] + A[1]*A[1] - 2*A[0]*A[1]*math.cos(math.radians(min(math.fabs(L-S)%360,360-math.fabs(L-S)%360))) print(math.sqrt(x))
[["-", 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
127
import sys, bisect, math, itertools, heapq, collections from operator import itemgetter # a.sort(key=itemgetter(i)) # i番目要素でsort from functools import lru_cache # @lru_cache(maxsize=None) sys.setrecursionlimit(10**8) input = sys.stdin.readline INF = float('inf') mod = 10**9 + 7 eps = 10**-7 def inp(): ''' 一つの...
import sys, bisect, math, itertools, heapq, collections from operator import itemgetter # a.sort(key=itemgetter(i)) # i番目要素でsort from functools import lru_cache # @lru_cache(maxsize=None) sys.setrecursionlimit(10**8) input = sys.stdin.readline INF = float('inf') mod = 10**9 + 7 eps = 10**-7 def inp(): ''' 一つの...
[["-", 3, 4, 0, 657, 12, 657, 12, 652, 63, 22], ["-", 0, 657, 12, 657, 12, 652, 3, 4, 0, 24], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
192
#!/usr/bin/python3 # -*- coding: utf-8 -*- import math a, b, h, m = map(int, input().split()) x = abs(30*h + m / 2 - 60 * m) if x <= 180: d = math.sqrt(a**2 + b**2 - 2 * a * b * math.cos(math.radians(x))) else: x = 360 - x d = math.sqrt(a**2 + b**2 - 2 * a * b * math.cos(math.radians(x))) print(d)
#!/usr/bin/python3 # -*- coding: utf-8 -*- import math a, b, h, m = map(int, input().split()) x = abs(30 * h + m / 2 - 6 * m) if x <= 180: d = math.sqrt(a**2 + b**2 - 2 * a * b * math.cos(math.radians(x))) else: x = 360 - x d = math.sqrt(a**2 + b**2 - 2 * a * b * math.cos(math.radians(x))) print(d)
[["-", 12, 652, 3, 4, 0, 657, 12, 657, 31, 612], ["+", 12, 652, 3, 4, 0, 657, 12, 657, 31, 612]]
5
120
import java.io.*; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(new BufferedInputStream(System.in)); int x = sc.nextInt(); int y = sc.nextInt(); // int x=3,y=4; int h = sc.nextInt(); int m = sc.nextInt(); double ans = Math....
import java.io.*; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(new BufferedInputStream(System.in)); int x = sc.nextInt(); int y = sc.nextInt(); // int x=3,y=4; int h = sc.nextInt(); int m = sc.nextInt(); double ans = Math....
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 12, 499], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 12, 499], ["-", 0, 57, 75, 57, 15, 15, 0, 16, 12, 499], ["+", 0, 57, 75, 57, 15, 15, 0, 16, 12, 499]]
3
213
import math a,b,h,m = map(int, input().split()) hrad = 30 * h + 0.5 * m mrad = 0.5 * m diff = abs(hrad - mrad) if diff > 180: diff = abs(mrad - hrad) ans = math.sqrt(a*a + b*b - 2*a*b*math.cos(math.radians(diff))) print(ans)
import math a,b,h,m = map(int, input().split()) hrad = 30 * h + 0.5 * m mrad = 6 * m diff = abs(hrad - mrad) if diff > 180: diff = abs(mrad - hrad) ans = math.sqrt(a*a + b*b - 2*a*b*math.cos(math.radians(diff))) print(ans)
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 31, 531], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 31, 612]]
5
93
import math a, b, h, m = map(int, input().split()) l_rad = m / 60 * 360 s_rad = h * 30 + m / 60 * 30 c_rad = abs(l_rad - s_rad) if abs(l_rad - s_rad) <= 180 else 360 - abs(l_rad - s_rad) cos_c = math.cos(math.radians(c_rad)) if cos_c == 1: print(0) elif cos_c == -1: print(a + b) else: print(math.sqrt(a ** 2...
import math a, b, h, m = map(int, input().split()) l_rad = m / 60 * 360 s_rad = h * 30 + m / 60 * 30 c_rad = abs(l_rad - s_rad) if abs(l_rad - s_rad) <= 180 else 360 - abs(l_rad - s_rad) cos_c = math.cos(math.radians(c_rad)) if cos_c == 1: print(abs(a - b)) elif cos_c == -1: print(a + b) else: print(math.sq...
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 31, 22], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 17, 33], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 12, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
125
import math A, B, H, M = map(int, input().split()) minutes = H * 60 + M choshin = (minutes * 6) % 360 tanshin = (minutes * 0.5) % 360 if choshin == tanshin: print(B - A) else: C = abs(choshin - tanshin) tmp = (A ** 2) + (B ** 2) - (2 * A * B * math.cos(math.radians(C))) print(math.sqrt(tmp))
import math A, B, H, M = map(int, input().split()) minutes = H * 60 + M choshin = (minutes * 6) % 360 tanshin = (minutes * 0.5) % 360 if choshin == tanshin: print(abs(B - A)) else: C = abs(choshin - tanshin) tmp = (A ** 2) + (B ** 2) - (2 * A * B * math.cos(math.radians(C))) print(math.sqrt(tmp))
[["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
110
# coding: utf-8 from math import pi from math import cos import math def main(): A, B, H, M = map(int, input().split()) # return (A**2 + B**2 - 2*A*B*cos(math.radians(6*(5*H-M))))**0.5 return (A**2 + B**2 - 2*A*B*cos(math.radians((60*H-11*M)//2)))**0.5 print(main())
# coding: utf-8 from math import pi from math import cos import math def main(): A, B, H, M = map(int, input().split()) # return (A**2 + B**2 - 2*A*B*cos(math.radians(6*(5*H-M))))**0.5 return (A**2 + B**2 - 2*A*B*cos(math.radians((60*H-11*M)/2)))**0.5 print(main())
[["-", 3, 4, 0, 652, 3, 4, 0, 657, 17, 676], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 17, 85]]
5
81
#include <math.h> #include <stdio.h> int main() { double a, b, H, M, ans, X; scanf("%lf %lf %lf %lf", &a, &b, &H, &M); double pi = M_PI; double rad = (30 * H - 5.5 * M) * pi / 180; X = a * a + b * b - cos(rad); ans = sqrt(X); printf("%.10lf", ans); return 0; }
#include <math.h> #include <stdio.h> int main() { double a, b, H, M, ans, X; scanf("%lf %lf %lf %lf", &a, &b, &H, &M); double pi = M_PI; double rad = (30 * H - 5.5 * M) * pi / 180; X = a * a + b * b - 2 * a * b * cos(rad); ans = sqrt(X); printf("%.10lf", ans); return 0; }
[["+", 12, 16, 12, 16, 31, 16, 31, 16, 31, 13], ["+", 12, 16, 12, 16, 31, 16, 31, 16, 17, 48], ["+", 12, 16, 12, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 11, 12, 16, 12, 16, 31, 16, 17, 48], ["+", 0, 11, 12, 16, 12, 16, 31, 16, 12, 22], ["+", 0, 1, 0, 11, 12, 16, 12, 16, 17, 48]]
0
98
#include <algorithm> #include <cmath> #include <iostream> #include <math.h> #include <vector> using namespace std; double PI = acos(-1); int main() { int a, b, h, m; cin >> a >> b >> h >> m; pair<float, float> jisin, hunsin; double ah, am; ah = h * 30 + m * 0.5; am = m * 6; jisin = make_pair(a * cos(ah...
#include <algorithm> #include <cmath> #include <iostream> #include <math.h> #include <vector> using namespace std; double PI = acos(-1); int main() { double a, b, h, m; cin >> a >> b >> h >> m; pair<double, double> jisin, hunsin; double ah, am; ah = h * 30 + m * 0.5; am = m * 6; jisin = make_pair(a * c...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40]]
1
186
/* -------関数一覧-------- arr1dto2d(Array) 一次元配列を二次元配列にします pf(N)素因数分解した結果をオブジェクトで返します gcd(a,b)最大公約数を返します lcm(a,b)最小公倍数を返します num(a,b)a-bを返します。ソート用です isPrime(n)素数かどうか真偽値で返します isNumber(n)数かどうか真偽値で返します arrsum(arr)配列の合計値を返します nibu(arr,n)n以下で最も大きい数の添字を返します(nを含みます) br(input)入力を改行で区切ります */ const debugMode = false; const inf = Num...
/* -------関数一覧-------- arr1dto2d(Array) 一次元配列を二次元配列にします pf(N)素因数分解した結果をオブジェクトで返します gcd(a,b)最大公約数を返します lcm(a,b)最小公倍数を返します num(a,b)a-bを返します。ソート用です isPrime(n)素数かどうか真偽値で返します isNumber(n)数かどうか真偽値で返します arrsum(arr)配列の合計値を返します nibu(arr,n)n以下で最も大きい数の添字を返します(nを含みます) br(input)入力を改行で区切ります */ const debugMode = false; const inf = Num...
[["-", 0, 198, 0, 200, 51, 2, 63, 558, 559, 560], ["-", 0, 198, 0, 200, 51, 2, 3, 3, 0, 24], ["-", 51, 2, 3, 3, 0, 2, 63, 558, 500, 22], ["-", 51, 2, 3, 3, 0, 2, 63, 558, 0, 131], ["-", 0, 2, 3, 3, 0, 16, 12, 23, 0, 25]]
2
1,539
#include <bits/stdc++.h> using namespace std; // T+N //#pragma GCC optimize ("O3") //#pragma GCC target ("sse4") #define endl "\n" typedef long long ll; typedef long double ld; typedef unsigned long long ull; template <class T, class T2> inline bool chkmax(T &x, const T2 &y) { return x < y ? x = y, 1 : 0; } template ...
#include <bits/stdc++.h> using namespace std; // T+N //#pragma GCC optimize ("O3") //#pragma GCC target ("sse4") #define endl "\n" typedef long long ll; typedef long double ld; typedef unsigned long long ull; template <class T, class T2> inline bool chkmax(T &x, const T2 &y) { return x < y ? x = y, 1 : 0; } template ...
[["-", 0, 43, 49, 50, 51, 16, 31, 16, 12, 13], ["+", 0, 43, 49, 50, 51, 16, 31, 16, 12, 13], ["-", 31, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 13]]
1
314
#include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() #define ll long long #define vi vector<int> #define pii pair<int, int> #define F first #define S second #define pb push_back #define forn(b) for (int i = 0; i < b; i++) #define rforn(b) for (int i = b - 1; b >= 0; i--) #define It(m) for...
#include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() #define ll long long #define vi vector<int> #define pii pair<int, int> #define F first #define S second #define pb push_back #define forn(b) for (int i = 0; i < b; i++) #define rforn(b) for (int i = b - 1; b >= 0; i--) #define It(m) for...
[["-", 0, 2, 3, 4, 0, 74, 39, 77, 39, 40], ["+", 0, 2, 3, 4, 0, 74, 39, 77, 39, 40]]
1
246
#include "bits/stdc++.h" #define rep(i, n) for (int i = 0; i < n; i++) #define For(i, a, b) for (int i = a; i <= b; i++) #define Forr(i, a, b) for (int i = a; i >= b; i--) typedef long long ll; double Pi = 3.141592653589793238; using namespace std; using Graph = vector<vector<int>>; using Field = vector<string>; using ...
#include "bits/stdc++.h" #define rep(i, n) for (int i = 0; i < n; i++) #define For(i, a, b) for (int i = a; i <= b; i++) #define Forr(i, a, b) for (int i = a; i >= b; i--) typedef long long ll; double Pi = 3.141592653589793238; using namespace std; using Graph = vector<vector<int>>; using Field = vector<string>; using ...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
223
#include <bits/stdc++.h> using namespace std; #define PI 3.141592653589793238462643383279 int main() { double a, b, h, m; cin >> a >> b >> h >> m; double angleh, anglem; anglem = m * 60.0; angleh = h * 30.0 + m / 2.0; double diff = abs(anglem - angleh); if (diff == 0) { printf("%.15g", abs(a - b)); ...
#include <bits/stdc++.h> using namespace std; #define PI 3.141592653589793238462643383279 int main() { double a, b, h, m; cin >> a >> b >> h >> m; double angleh, anglem; anglem = m * 6.0; angleh = h * 30.0 + m / 2.0; double diff = abs(anglem - angleh); if (diff == 0) { printf("%.15g", abs(a - b)); ...
[["-", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
162
import sys import math def solution(): a,b,h,m=map(int,input().split()) mins=m*6 if(h==12): h=0 hr=h*30+m/2 angle=min((abs(hr-mins),360-abs(hr-mins))) c=a**2+b**2-(2*a*b*math.cos(angle*0.0174533)) c=c**(0.5) print(c) if __name__ == "__main__": solution()
import sys import math def solution(): a,b,h,m=map(int,input().split()) mins=m*6 if(h==12): h=0 hr=h*30+m/2 angle=min((abs(hr-mins),360-abs(hr-mins))) c=a**2+b**2-(2*a*b*math.cos(angle*math.pi/180)) c=c**(0.5) print(c) if __name__ == "__main__": solution()
[["-", 0, 657, 12, 652, 3, 4, 0, 657, 12, 531], ["+", 3, 4, 0, 657, 31, 657, 12, 319, 500, 22], ["+", 3, 4, 0, 657, 31, 657, 12, 319, 0, 131], ["+", 3, 4, 0, 657, 31, 657, 12, 319, 319, 22], ["+", 0, 657, 12, 652, 3, 4, 0, 657, 17, 85], ["+", 0, 657, 12, 652, 3, 4, 0, 657, 12, 612]]
5
122
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> P; typedef pair<ll, ll> Pll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repn(i, n) for (int i = 0; i <= (int)(n); i++) #define srep(i, l, n) for (int i = l; i < (int)(n); i++) #define sre...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> P; typedef pair<ll, ll> Pll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repn(i, n) for (int i = 0; i <= (int)(n); i++) #define srep(i, l, n) for (int i = l; i < (int)(n); i++) #define sre...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
332
A,B,H,M = map(int,input().split()) import math ans = math.sqrt(A**2+B**2-2*A*B*math.cos(math.radians(30*H+0.5*M-60*M))) print(ans)
A,B,H,M = map(int,input().split()) import math ans = math.sqrt(A**2+B**2-2*A*B*math.cos(math.radians(30*H+0.5*M-6*M))) print(ans)
[["-", 0, 652, 3, 4, 0, 657, 12, 657, 31, 612], ["+", 0, 652, 3, 4, 0, 657, 12, 657, 31, 612]]
5
68
import math a,b,h,m = map(int, input().split()) short = (h + m/60) * 30 long = m * 60 big = max(short, long) small = min(short, long) theta = min(big-small, (360-big) + small) print((a**2 + b**2 - 2*a*b*math.cos(math.radians(theta)))**0.5)
import math a,b,h,m = map(int, input().split()) short = (h + m/60) * 30 long = m * 6 big = max(short, long) small = min(short, long) theta = min(big-small, (360-big) + small) print((a**2 + b**2 - 2*a*b*math.cos(math.radians(theta)))**0.5)
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612]]
5
102
#include <iostream> using namespace std; #include "math.h" int main() { double a, b; int h, m; cin >> a >> b >> h >> m; h = h * 60 + m; h %= 12 * 60; double x = (double)h * 1.0 / 12.0 / 60.0 * 2 * 3.14159265; h %= 60; double y = (double)h * 1.0 / 60.0 * 2 * 3.14159265; if (x > y) swap(x, y); x ...
#include <iostream> using namespace std; #include "math.h" int main() { double a, b; int h, m; cin >> a >> b >> h >> m; h = h * 60 + m; h %= 12 * 60; double x = (double)h * 1.0 / 12.0 / 60.0 * 2 * 3.141592653589793238; h %= 60; double y = (double)h * 1.0 / 60.0 * 2 * 3.141592653589793238; if (x > y) ...
[["-", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13], ["-", 12, 2, 3, 4, 0, 16, 31, 16, 12, 13], ["+", 12, 2, 3, 4, 0, 16, 31, 16, 12, 13], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
149
a,b,h,m = gets.split.map(&:to_i) t = 60*h + m aa = (t.to_f/2) - (t/720)*360 ab = t%60 angle = (aa-ab).abs angle = 360 - angle if angle > 180 angle *= (Math::PI/180) puts Math.sqrt(a**2 + b**2 - 2*a*b*Math.cos(angle))
a,b,h,m = gets.split.map(&:to_i) t = 60*h + m aa = (t.to_f/2) - (t/720)*360 ab = (6*t)%360 angle = (aa-ab).abs angle = 360 - angle if angle > 180 angle *= (Math::PI/180) puts Math.sqrt(a**2 + b**2 - 2*a*b*Math.cos(angle))
[["+", 0, 493, 0, 662, 12, 738, 31, 739, 0, 24], ["+", 0, 662, 12, 738, 31, 739, 0, 738, 31, 612], ["+", 0, 662, 12, 738, 31, 739, 0, 738, 17, 48], ["+", 0, 493, 0, 662, 12, 738, 31, 739, 0, 25], ["-", 36, 36, 0, 493, 0, 662, 12, 738, 12, 612], ["+", 36, 36, 0, 493, 0, 662, 12, 738, 12, 612]]
4
99
from math import radians, cos, sqrt a,b,h,m = map(int,input().split()) # 時針の位置 h = h + (m/60) longAngle = 360 * (h/12) shortAngle = 360 * (m/60) angle = abs(longAngle-shortAngle) if angle > 180: angle = angle - 180 # 余弦定理 ans = (a**2) + (b**2) - (2*a*b*cos(radians(angle))) print(sqrt(ans))
from math import radians, cos, sqrt a,b,h,m = map(int,input().split()) # 時針の位置 h = h + (m/60) longAngle = 360 * (h/12) shortAngle = 360 * (m/60) angle = abs(longAngle-shortAngle) if angle > 180: angle = 360 - angle # 余弦定理 ans = (a**2) + (b**2) - (2*a*b*cos(radians(angle))) print(sqrt(ans))
[["-", 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
111
import sys sys.setrecursionlimit(10**6) from math import floor,ceil,sqrt,factorial,log,sin,cos,radians,tan from heapq import heappop, heappush, heappushpop from collections import Counter,defaultdict,deque from itertools import accumulate,permutations,combinations,product,combinations_with_replacement from bisect impor...
import sys sys.setrecursionlimit(10**6) from math import floor,ceil,sqrt,factorial,log,sin,cos,radians,tan from heapq import heappop, heappush, heappushpop from collections import Counter,defaultdict,deque from itertools import accumulate,permutations,combinations,product,combinations_with_replacement from bisect impor...
[["-", 36, 36, 0, 656, 0, 1, 0, 677, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 677, 31, 22]]
5
431
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define rrep(i, n) for (int i = (n)-1; i >= 0; i--) #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, a, b) for (int i = (b - 1); i >= (a); i--) #define ALL(v) v.begin(), v.end() #define RALL(v) v.rbegin(), ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define rrep(i, n) for (int i = (n)-1; i >= 0; i--) #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, a, b) for (int i = (b - 1); i >= (a); i--) #define ALL(v) v.begin(), v.end() #define RALL(v) v.rbegin(), ...
[["-", 49, 50, 51, 2, 3, 4, 0, 16, 31, 13], ["+", 49, 50, 51, 2, 3, 4, 0, 16, 31, 13]]
1
280
#include <bits/stdc++.h> using namespace std; #define TRACE(x) x #define WATCH(x) TRACE(cout << #x " = " << x << endl) #define PRINT(x) TRACE(printf(x)) #define WATCHR(a, b) \ TRACE(for (auto c = a; c != b;) cout << *(c++) << " "; cout << endl) #define WATCHC(...
#include <bits/stdc++.h> using namespace std; #define TRACE(x) x #define WATCH(x) TRACE(cout << #x " = " << x << endl) #define PRINT(x) TRACE(printf(x)) #define WATCHR(a, b) \ TRACE(for (auto c = a; c != b;) cout << *(c++) << " "; cout << endl) #define WATCHC(...
[["-", 12, 16, 31, 23, 0, 16, 31, 16, 31, 13], ["-", 12, 16, 31, 23, 0, 16, 31, 16, 17, 48], ["-", 51, 16, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 51, 16, 12, 16, 31, 23, 0, 16, 12, 13], ["-", 0, 11, 12, 2, 3, 4, 0, 16, 31, 13], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 31, 13]]
1
370
#include <bits/stdc++.h> #include <math.h> #include <cmath> #include <cstdio> #include <vector> using namespace std; #define EPS (1e-7) #define INF (1e9) #define PI (acos(-1)) #define deg_to_rad(deg) (((deg) / 360) * 2 * M_PI) #define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360) #define rep(i, n) for (int i = 0; i < (...
#include <bits/stdc++.h> #include <math.h> #include <cmath> #include <cstdio> #include <vector> using namespace std; #define EPS (1e-7) #define INF (1e9) #define PI (acos(-1)) #define deg_to_rad(deg) (((deg) / 360) * 2 * M_PI) #define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360) #define rep(i, n) for (int i = 0; i < (...
[["+", 12, 2, 3, 4, 0, 16, 31, 16, 31, 13], ["+", 12, 2, 3, 4, 0, 16, 31, 16, 17, 48]]
1
202
#include "bits/stdc++.h" using namespace std; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<string> VS; typedef pair<int, int> PII; typedef vector<PII> VPII; typedef long long LL; typedef vector<LL> VL; typedef vector<VL> VVL; typedef pair<LL, LL> PLL; typedef vector<PLL> VPLL; typedef priority_queue...
#include "bits/stdc++.h" using namespace std; typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<string> VS; typedef pair<int, int> PII; typedef vector<PII> VPII; typedef long long LL; typedef vector<LL> VL; typedef vector<VL> VVL; typedef pair<LL, LL> PLL; typedef vector<PLL> VPLL; typedef priority_queue...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["-", 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
491
import math a,b,h,m=map(int,input().split()) h=360*(h/12)+360*(1/12)*(m/60) m=360*(m/60) angle=abs(h-m) if angle>=180: angle-=180 ans=math.sqrt(a**2+b**2-(2*a*b*math.cos(math.radians(angle)))) print(ans)
import math a,b,h,m=map(int,input().split()) h=360*(h/12)+360*(1/12)*(m/60) m=360*(m/60) angle=abs(h-m) if angle>=180: angle=360-angle ans=math.sqrt(a**2+b**2-(2*a*b*math.cos(math.radians(angle)))) print(ans)
[["-", 0, 57, 64, 196, 0, 1, 0, 677, 17, 110], ["-", 0, 57, 64, 196, 0, 1, 0, 677, 12, 612], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 31, 612], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 12, 22]]
5
108
#include <bits/stdc++.h> #define DEBUG fprintf(stderr, "Passing [%s] line %d\n", __FUNCTION__, __LINE__) #define File(x) \ freopen(x ".in", "r", stdin); \ freopen(x ".out", "w", stdout) using namespace std...
#include <bits/stdc++.h> #define DEBUG fprintf(stderr, "Passing [%s] line %d\n", __FUNCTION__, __LINE__) #define File(x) \ freopen(x ".in", "r", stdin); \ freopen(x ".out", "w", stdout) using namespace std...
[["-", 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
384
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; #define ll long long #define ld long double #define MOD 1000000007 #define nl cout << bl #define rt ll Q[100005] = {0} #define mp make_pair #define test() \...
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; #define ll long long #define ld long double #define MOD 1000000007 #define nl cout << bl #define rt ll Q[100005] = {0} #define mp make_pair #define test() \...
[["-", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40]]
1
494
import math a, b, h, m = map(int, input().split()) ang_a = 30 * h ang_b = 6 * m ang_c = max(ang_a, ang_b) - min(ang_a, ang_b) if ang_c > 180: ang_c = 360 - ang_c ans = math.sqrt(a**2 + b**2 - 2*a*b*math.cos(math.radians(ang_c))) print(ans)
import math a, b, h, m = map(int, input().split()) ang_a = 30 * h + m / 2 ang_b = 6 * m ang_c = max(ang_a, ang_b) - min(ang_a, ang_b) if ang_c > 180: ang_c = 360 - ang_c ans = math.sqrt(a**2 + b**2 - 2*a*b*math.cos(math.radians(ang_c))) print(ans)
[["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 72], ["+", 0, 1, 0, 662, 12, 657, 12, 657, 31, 22], ["+", 0, 1, 0, 662, 12, 657, 12, 657, 17, 85], ["+", 0, 1, 0, 662, 12, 657, 12, 657, 12, 612]]
5
93
a,b,h,m = list(map(int, input().split())) hh=360*(60*h+m)/(60*12) mm=360*(m/60) rad=hh-mm if rad > 180: rad=360-rad print(math.sqrt(a**2+b**2-2*a*b*math.cos(math.radians(rad))))
import math a,b,h,m = list(map(int, input().split())) hh=360*(60*h+m)/(60*12) mm=360*(m/60) rad=hh-mm if rad > 180: rad=360-rad print(math.sqrt(a**2+b**2-2*a*b*math.cos(math.radians(rad))))
[["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22]]
5
97
import math l=list(map(int, input().split(' '))) a=l[0] b=l[1] h=l[2] m=l[3] hours = (h+m/60)/12 minutes = m/60 theta = 2*math.pi*(hours-minutes) ans = a**2+b**2+2*a*b*math.cos(theta) print(ans**0.5)
import math l=list(map(int, input().split(' '))) a=l[0] b=l[1] h=l[2] m=l[3] hours = (h+m/60)/12 minutes = m/60 theta = 2*math.pi*(hours-minutes) ans = a**2+b**2-2*a*b*math.cos(theta) print(ans**0.5)
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 72], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 33]]
5
103
#168 #c import math a,b,h,m = list(map(int, input().split())) oa = (60*h + m)/2 ob = m*60 cos_ab = math.cos(math.radians(oa-ob)) c = (a**2 + b**2 -2*a*b*cos_ab)**0.5 print(c)
#168 #c import math a,b,h,m = list(map(int, input().split())) oa = (60*h + m)/2 ob = m*6 cos_ab = math.cos(math.radians(oa-ob)) c = abs((a**2 + b**2 -2*a*b*cos_ab)**0.5) print(c)
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 12, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
83
import math a,b,h,m = map(int, input().split()) theta_h = (60 * h + m)/2 theta_m = 60 * m the = abs(theta_h -theta_m) the = min(the, 360 - the) r = (a ** 2 + b ** 2 - 2 * a * b * math.cos(math.radians(the))) ** (1/2) print(r)
import math a,b,h,m = map(int, input().split()) theta_h = (60 * h + m)/2 theta_m = 6 * m the = abs(theta_h -theta_m) the = min(the, 360 - the) r = (a ** 2 + b ** 2 - 2 * a * b * math.cos(math.radians(the))) ** (1/2) print(r)
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 31, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 31, 612]]
5
95
#!/usr/bin/env python3 import sys import collections import math sys.setrecursionlimit(10 ** 7) # 1 ✕ N A, B, C, D = list(map(int, input().rstrip().split())) ar = (360 / 12) * C br = (360 / 60) * D print(math.sqrt(A * A + B * B - (2 * A * B * math.cos(math.radians(abs(ar - br))))))
#!/usr/bin/env python3 import sys import collections import math sys.setrecursionlimit(10 ** 7) # 1 ✕ N A, B, C, D = list(map(int, input().rstrip().split())) ar = (360 / 12) * C + D * 0.5 br = (360 / 60) * D print(math.sqrt(A * A + B * B - (2 * A * B * math.cos(math.radians(abs(ar - br))))))
[["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 72], ["+", 0, 1, 0, 662, 12, 657, 12, 657, 31, 22], ["+", 0, 1, 0, 662, 12, 657, 12, 657, 17, 48], ["+", 0, 1, 0, 662, 12, 657, 12, 657, 12, 531]]
5
101
import math A,B,H,M = (int(x) for x in input().split()) h = 360*H/12 + 30*M/60 m = 360*M/60 c = abs(h-m) if(c > 180): c -= 180 C = A**2 + B**2 - 2*A*B*math.cos(math.radians(c)) if c != 180 and c != 0: print(math.sqrt(C)) elif c == 180: print(A+B) else: print(abs(A-B))
import math A,B,H,M = (int(x) for x in input().split()) h = 360*H/12 + 30*M/60 m = 360*M/60 c = abs(h-m) if(c > 180): c = 360 - c C = A**2 + B**2 - 2*A*B*math.cos(math.radians(c)) if c != 180 and c != 0: print(math.sqrt(C)) elif c == 180: print(A+B) else: print(abs(A-B))
[["-", 0, 57, 64, 196, 0, 1, 0, 677, 17, 110], ["-", 0, 57, 64, 196, 0, 1, 0, 677, 12, 612], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 0, 32], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 31, 612], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 12, 22]]
5
131
a, b, h, m = gets.split.map(&:to_f) a_kakudo = 30.0 * h + 30.0 * (m/60.0) b_kakudo = m kakudo = (a_kakudo - b_kakudo).abs kakudo = [kakudo, 360-kakudo].min puts (a**2+b**2 - 2*a*b*Math.cos(kakudo/180.0 * Math::PI))**0.5
a, b, h, m = gets.split.map(&:to_f) a_kakudo = 30.0 * h + 30.0 * (m/60.0) b_kakudo = 6.0*m kakudo = (a_kakudo - b_kakudo).abs kakudo = [kakudo, 360-kakudo].min puts (a**2+b**2 - 2*a*b*Math.cos(kakudo/180.0 * Math::PI))**0.5
[["+", 36, 36, 0, 493, 0, 662, 12, 738, 31, 531], ["+", 36, 36, 0, 493, 0, 662, 12, 738, 17, 48]]
4
84
import math A, B, H, M = map(int, input().split()) hour = 30 * (M / 60) + 360 * (H / 12) minute = 360 * (M / 60) if hour > minute: degree = hour - minute else: degree = minute - hour degree = degree - 180 if degree - 180 > 0 else degree length = A**2 + B**2 - 2 * A * B * math.cos(math.radians(degree)) print...
import math A, B, H, M = map(int, input().split()) hour = 30 * (M / 60) + 360 * (H / 12) minute = 360 * (M / 60) if hour > minute: degree = hour - minute else: degree = minute - hour degree = 360 - degree if degree > 180 else degree length = A**2 + B**2 - 2 * A * B * math.cos(math.radians(degree)) print(mat...
[["-", 0, 1, 0, 662, 12, 41, 0, 657, 31, 22], ["+", 0, 1, 0, 662, 12, 41, 0, 657, 31, 612], ["-", 0, 1, 0, 662, 12, 41, 0, 657, 12, 612], ["+", 0, 1, 0, 662, 12, 41, 0, 657, 12, 22], ["-", 0, 662, 12, 41, 0, 666, 0, 657, 17, 33], ["-", 0, 662, 12, 41, 0, 666, 0, 657, 12, 612], ["-", 0, 1, 0, 662, 12, 41, 0, 666, 0, 612...
5
114
#include <bits/stdc++.h> using namespace std; using ll = long long; #define _GLIBCXX_DEBUG #define rep(i, c) for (int i = 0; i < (int)c; i++) #define debug(x) cout << #x << " = " << x << endl #define print(x) cout << x << endl; const ll MOD = 1000000007; const double PI = 3.14159265358979323846; int main() { int A, ...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define _GLIBCXX_DEBUG #define rep(i, c) for (int i = 0; i < (int)c; i++) #define debug(x) cout << #x << " = " << x << endl #define print(x) cout << x << endl; const ll MOD = 1000000007; const double PI = 3.14159265358979323846; int main() { int A, ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
166
#include <bits/stdc++.h> #include <stdio.h> #include <string.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; using ll = long long; using P = pair<int, int>; ll a, b, c, n, h, m, q, x; ll ans = 100000000000; string s; #define MPI 3.14159265358979323846 int main() { cin.tie(0); ios::sync_wit...
#include <bits/stdc++.h> #include <stdio.h> #include <string.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; using ll = long long; using P = pair<int, int>; ll a, b, c, n, h, m, q, x; ll ans = 100000000000; string s; #define MPI 3.14159265358979323846 int main() { cin.tie(0); ios::sync_wit...
[["-", 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
186
abhm=tuple(map(float, input().split())) a=abhm[0] b=abhm[1] h=abhm[2] m=abhm[3] import math as mt pi=mt.pi print(pi) c=pi*(h+m/60)/6 d=pi*m/30 print(mt.sqrt((a*mt.cos(c)-b*mt.cos(d))**2+(a*mt.sin(c)-b*mt.sin(d))**2))
abhm=tuple(map(float, input().split())) a=abhm[0] b=abhm[1] h=abhm[2] m=abhm[3] import math as mt pi=mt.pi c=pi*(h+m/60)/6 d=pi*m/30 print(mt.sqrt((a*mt.cos(c)-b*mt.cos(d))**2+(a*mt.sin(c)-b*mt.sin(d))**2))
[["-", 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
125
a,b,h,m = map(int,input().split()) import math t =abs(30*h + 0.5*m - 6*m) angle = min(t, 360-t) l = a**2 + b** 2 -2*a*b*math.cos(angle*3.1415/180) print(l**0.5)
a,b,h,m = map(int,input().split()) import math t =abs(30*h + 0.5*m - 6*m) angle = min(t, 360-t) l = a**2 + b** 2 -2*a*b*math.cos(angle*3.14159265358979323846/180) print(l**0.5)
[["-", 12, 652, 3, 4, 0, 657, 31, 657, 12, 531], ["+", 12, 652, 3, 4, 0, 657, 31, 657, 12, 531]]
5
80
#include <math.h> #include <stdio.h> #define Pi 3.14159265358973284626 int main(void) { double a, b, h, m; scanf("%lf %lf %lf %lf", &a, &b, &h, &m); long double kaku = (m / 60 - (h / 12 + m / 720)) * 2 * Pi; if (kaku < 0) { kaku *= -1; } long double kyuori2 = a * a + b * b - 2 * a * b * cos(kaku); ...
#include <math.h> #include <stdio.h> #define Pi 3.14159265358973284626 int main(void) { double a, b, h, m; scanf("%lf %lf %lf %lf", &a, &b, &h, &m); long double kaku = (m / 60 - (h / 12 + m / 720)) * 2 * Pi; if (kaku < 0) { kaku *= -1; } long double kyuori2 = a * a + b * b - 2 * a * b * cos(kaku); ...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
117
from math import cos,pi a,b,h,m = map(int, input().split()) deg = abs((h*60 + m)/2.0 - m*6) deg = min(deg, 360-deg) print(deg) print((a**2+b**2-2*a*b*cos(deg/180 * pi))**0.5)
from math import cos,pi a,b,h,m = map(int, input().split()) deg = abs((h*60 + m)/2.0 - m*6) deg = min(deg, 360-deg) print((a**2+b**2-2*a*b*cos(deg/180 * pi))**0.5)
[["-", 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, 652, 3, 4, 0, 657, 31, 23, 0, 24]]
5
87
#include <bits/stdc++.h> #include <cassert> using namespace std; /* #include <ext/pb_ds/assoc_container.hpp> // Common file #include <ext/pb_ds/detail/standard_policies.hpp> #include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update using namespace __gnu_pbds; typedef tree< int, null_type, le...
#include <bits/stdc++.h> #include <cassert> using namespace std; /* #include <ext/pb_ds/assoc_container.hpp> // Common file #include <ext/pb_ds/detail/standard_policies.hpp> #include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update using namespace __gnu_pbds; typedef tree< int, null_type, le...
[["-", 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, 39, 86, 39, 40]]
1
281
# Code for C - : (Colon) # Use input() to fetch data from STDIN import math [a, b, h, m] = map(int, input().split()) ht = 360 * h / 12 + 360 * m / 60 / 12 mt = 360 * m / 60 t = abs(ht - mt) if abs(ht - mt) <= 180 else abs(ht - mt) - 180 print(math.sqrt(a * a + b * b - 2 * a * b * math.cos(math.radians(t))))
# Code for C - : (Colon) # Use input() to fetch data from STDIN import math [a, b, h, m] = map(int, input().split()) ht = 360 * h / 12 + 360 * m / 60 / 12 mt = 360 * m / 60 t = abs(ht - mt) if abs(ht - mt) <= 180 else 360 - abs(ht - mt) print(math.sqrt(a * a + b * b - 2 * a * b * math.cos(math.radians(t))))
[["+", 0, 1, 0, 662, 12, 41, 0, 657, 31, 612], ["+", 0, 1, 0, 662, 12, 41, 0, 657, 17, 33], ["-", 0, 1, 0, 662, 12, 41, 0, 657, 17, 33], ["-", 0, 1, 0, 662, 12, 41, 0, 657, 12, 612]]
5
107
import numpy as np def main(): A, B, H, M = map(int, input().split()) omega_m = 1.0/60.0 omega_h = 1.0/12.0 a = (H + M/60.0) * omega_h b = (60.0*H + M) * omega_m theta = (a - b) * 360.0 c = np.sqrt(A**2 + B**2 - 2.0*A*B*np.abs(np.cos(theta/180.0*np.pi))) print(c) if __name__ == '__main__...
import numpy as np def main(): A, B, H, M = map(int, input().split()) omega_m = 1.0/60.0 omega_h = 1.0/12.0 a = (H + M/60.0) * omega_h b = (60.0*H + M) * omega_m theta = (a - b) * 360.0 c = np.sqrt(A**2 + B**2 - 2.0*A*B*np.cos(theta/180.0*np.pi)) print(c) if __name__ == '__main__': m...
[["-", 0, 657, 12, 657, 12, 652, 63, 319, 319, 22], ["-", 0, 657, 12, 657, 12, 652, 3, 4, 0, 24], ["-", 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, 3, 4, 0, 25]]
5
122
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <iostream> #define lli long long int using namespace std; #define S second #define F first #define pb push_back #define M1 1000000007 #define M2 998244353 #define plli pair<lli, lli> #define setit set<lli>::i...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <iostream> #define lli long long int using namespace std; #define S second #define F first #define pb push_back #define M1 1000000007 #define M2 998244353 #define plli pair<lli, lli> #define setit set<lli>::i...
[["-", 0, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 17, 33]]
1
357
#include <math.h> #include <stdio.h> #define pi 3.14159265 int main(void) { double A, B, H, M, rad; scanf("%lf %lf %lf %lf", &A, &B, &H, &M); rad = H * pi / 6 + M * pi / 360 - M * pi / 30; double ans = sqrt(A * A + B * B - 2 * A * B * cos(rad)); printf("%lf\n", ans); return 0; }
#include <math.h> #include <stdio.h> #define pi 3.14159265358979 int main(void) { double A, B, H, M, rad; scanf("%lf %lf %lf %lf", &A, &B, &H, &M); rad = H * pi / 6 + M * pi / 360 - M * pi / 30; double ans = sqrt(A * A + B * B - 2 * A * B * cos(rad)); printf("%.9lf\n", ans); return 0; }
[["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
102
import math a,b,h,m=map(int,input().split()) s=math.radians((60*h+m)/2) l=math.radians(6*m) d2=(a*math.sin(s)-b*math.sin(l))**2+(a*math.cos(s)-b*math.cos(l))**2 print(d2) d=math.sqrt(d2) print(d)
import math a,b,h,m=map(int,input().split()) s=math.radians((60*h+m)/2) l=math.radians(6*m) d2=(a*math.sin(s)-b*math.sin(l))**2+(a*math.cos(s)-b*math.cos(l))**2 d=math.sqrt(d2) print(d)
[["-", 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
109
from math import radians, cos A, B, H, M = map(int, input().split()) angle_h = (H + M/60) * 30 angle_m = M * 60 theta = min(abs(angle_h-angle_m), 360 - abs(angle_h-angle_m)) r2 = A**2 + B**2 - 2*A*B*cos(radians(theta)) print(r2**(1/2))
from math import radians, cos A, B, H, M = map(int, input().split()) angle_h = (H + M/60) * 30 angle_m = M * 6 theta = min(abs(angle_h-angle_m), 360 - abs(angle_h-angle_m)) r2 = A**2 + B**2 - 2*A*B*cos(radians(theta)) print(r2**(1/2))
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612]]
5
95
import java.util.Scanner; public class Main { public static Scanner scan = new Scanner(System.in); public static void main(String[] args) { double a = nextDouble(); double b = nextDouble(); double h = nextDouble(); double m = nextDouble(); h = h * 30; h = h + 0.5 * m; m = m * 6; ...
import java.util.Scanner; public class Main { public static Scanner scan = new Scanner(System.in); public static void main(String[] args) { double a = nextDouble(); double b = nextDouble(); double h = nextDouble(); double m = nextDouble(); h = h * 30; h = h + 0.5 * m; m = m * 6; ...
[["-", 0, 195, 8, 196, 0, 1, 0, 492, 141, 22], ["-", 8, 196, 0, 1, 0, 492, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 492, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 492, 3, 4, 0, 25], ["-", 8, 498, 0, 195, 8, 196, 0, 1, 0, 35]]
3
293
#include <bits/stdc++.h> using namespace std; using ll = long long; const double pi = 3.141592653589793; int main() { int a, b, h, m; cin >> a >> b >> h >> m; double omega_a = 2 * pi / (12 * 60); // [rad/m] double omega_b = 2 * pi / 60; // [rad/m] double theta_a = omega_a * (h * 60 + m); double ...
#include <bits/stdc++.h> using namespace std; using ll = long long; const double pi = 3.141592653589793; int main() { int a, b, h, m; cin >> a >> b >> h >> m; double omega_a = 2 * pi / (12 * 60); // [rad/m] double omega_b = 2 * pi / 60; // [rad/m] double theta_a = omega_a * (h * 60 + m); double ...
[["+", 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
147
# C a, b, h, m = map(int, input().split()) import math short = 30 * h long = 6 * m short = 30 * h + m*30/60 print(short, long) ans = (a**2 + b**2 - 2*a*b*math.cos(math.radians(abs(short-long))))**(1/2) print(ans)
# C a, b, h, m = map(int, input().split()) import math short = 30 * h long = 6 * m short = 30 * h + m*30/60 ans = (a**2 + b**2 - 2*a*b*math.cos(math.radians(abs(short-long))))**(1/2) print(ans)
[["-", 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
94
A,B,H,M=map(int,input().split()) from math import cos p=3.14159265358979323846264338328 ho=H*p/6+M*p/360 mi=M*p/30 t=ho-mi print(ho,mi) x=(A*A+B*B-2*A*B*cos(t))**0.5 print(x)
A,B,H,M=map(int,input().split()) from math import cos p=3.14159265358979323846264338328 ho=H*p/6+M*p/360 mi=M*p/30 t=ho-mi x=(A*A+B*B-2*A*B*cos(t))**0.5 print(x)
[["-", 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
86
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(a) (a).begin(), (a).end() #define VI vector<int> #define MOD 1000000007 using ll = long long int; using P = pair<int, int>; template <class T> bool chmax(T &a, const T &b) { ...
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(a) (a).begin(), (a).end() #define VI vector<int> #define MOD 1000000007 using ll = long long int; using P = pair<int, int>; template <class T> bool chmax(T &a, const T &b) { ...
[["-", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
227
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef vector<ll> vi; #define INF (1e9) int main() { ld A, B, H, M, ans = 0; cin >> A >> B >> H >> M; ans = A * A + B * B - 2 * A * B * abs(cos(((H + M / 60) / 12 - M / 60) * M_PI * 2)); cout << fixed << setpre...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef vector<ll> vi; #define INF (1e9) int main() { ld A, B, H, M, ans = 0; cin >> A >> B >> H >> M; ans = A * A + B * B - 2 * A * B * (cos(((H + M / 60) / 12 - M / 60) * M_PI * 2)); cout << fixed << setprecis...
[["-", 0, 11, 12, 16, 12, 16, 12, 2, 63, 22], ["-", 0, 1, 0, 16, 12, 2, 3, 4, 0, 13], ["+", 0, 1, 0, 16, 12, 2, 3, 4, 0, 13]]
1
115
#include <bits/stdc++.h> using namespace std; int calcAngle(double h, double m) { // validate the input if (h == 12) h = 0; if (m == 60) m = 0; // Calculate the angles moved // by hour and minute hands // with reference to 12:00 int hour_angle = 0.5 * (h * 60 + m); int minute_angle = 6 * m; ...
#include <bits/stdc++.h> using namespace std; double calcAngle(double h, double m) { // validate the input if (h == 12) h = 0; if (m == 60) m = 0; // Calculate the angles moved // by hour and minute hands // with reference to 12:00 double hour_angle = 0.5 * (h * 60 + m); double minute_angle = ...
[["-", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
168
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int a, b, h, m; cin >> a >> b >> h >> m; double x = abs((h * 30 + m / 2) - 6 * m); double y = x * acos(-1) / 180; cout << fixed << setprecision(15) << sqrt(a * a + b * b - 2 * a * b * cos(y)) << endl; return 0; }
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { double a, b, h, m; cin >> a >> b >> h >> m; double x = abs((h * 30 + m / 2) - 6 * m); double y = x * acos(-1) / 180; cout << fixed << setprecision(15) << sqrt(a * a + b * b - 2 * a * b * cos(y)) << endl; return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
105
import math a,b,h,m = map(int,input().split()) s=abs(h*30+m*0.5-m*6) d=min(s,360-s) print(d) c=a*a+b*b-2*a*b*math.cos(math.radians(d)) print(math.sqrt(c))
import math a,b,h,m = map(int,input().split()) s=abs(h*30+m*0.5-m*6) d=min(s,360-s) c=a*a+b*b-2*a*b*math.cos(math.radians(d)) print(math.sqrt(c))
[["-", 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
88
import math A,B,H,M = map(int,input().split()) theta_h=2*math.pi*H/12 theta_m=2*math.pi*M/60 vh=[A*math.cos(theta_h), A*math.sin(theta_h)] vm=[B*math.cos(theta_m), B*math.sin(theta_m)] print(math.sqrt((vh[0]-vm[0])**2+(vh[1]-vm[1])**2))
import math A,B,H,M = map(int,input().split()) theta_h=2*math.pi*(H+M/60)/12 theta_m=2*math.pi*M/60 vh=[A*math.cos(theta_h), A*math.sin(theta_h)] vm=[B*math.cos(theta_m), B*math.sin(theta_m)] print(math.sqrt((vh[0]-vm[0])**2+(vh[1]-vm[1])**2))
[["+", 0, 662, 12, 657, 31, 657, 12, 23, 0, 24], ["+", 12, 657, 31, 657, 12, 23, 0, 657, 17, 72], ["+", 31, 657, 12, 23, 0, 657, 12, 657, 31, 22], ["+", 31, 657, 12, 23, 0, 657, 12, 657, 17, 85], ["+", 31, 657, 12, 23, 0, 657, 12, 657, 12, 612], ["+", 0, 662, 12, 657, 31, 657, 12, 23, 0, 25]]
5
121
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int(i) = 0; i < (n); i++) int main() { long double a, b, h, m, ans = 0, tanshin, choshin, kakudo; cin >> a >> b >> h >> m; tanshin = h * 360.0 / 12.0 + m * 30.0 / 60.0; choshin = m * 360.0 / 60.0; kakudo = abs(tanshin - choshin); if (kaku...
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int(i) = 0; i < (n); i++) int main() { long double a, b, h, m, ans = 0, tanshin, choshin, kakudo; cin >> a >> b >> h >> m; tanshin = h * 360.0 / 12.0 + m * 30.0 / 60.0; choshin = m * 360.0 / 60.0; kakudo = abs(tanshin - choshin); if (kak...
[["-", 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
130
# -*- coding:utf-8 -*- def solve(): import sys import math A, B, H, M = list(map(int, sys.stdin.readline().split())) h_speed = 360 / (12*60) m_speed = 360 / 60 m = H*60 + M h_angle = h_speed * m m_angle = m_speed * m % 360 angle = abs(h_angle - m_angle) if abs(h_angle-m_angle) <...
# -*- coding:utf-8 -*- def solve(): import sys import math A, B, H, M = list(map(int, sys.stdin.readline().split())) h_speed = 360 / (12*60) m_speed = 360 / 60 m = H*60 + M h_angle = h_speed * m m_angle = m_speed * m % 360 angle = abs(h_angle - m_angle) if abs(h_angle-m_angle) <...
[["+", 0, 1, 0, 662, 12, 41, 0, 657, 31, 612], ["+", 0, 1, 0, 662, 12, 41, 0, 657, 17, 33], ["-", 0, 1, 0, 662, 12, 41, 0, 657, 17, 33], ["-", 0, 1, 0, 662, 12, 41, 0, 657, 12, 612]]
5
173
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; const ll INF = 1LL << 60; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if (a < b)...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; const ll INF = 1LL << 60; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if (a < b)...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 1, 0, 16, 12, 2, 3, 4, 0, 13], ["+", 0, 1, 0, 16, 12, 2, 3, 4, 0, 13]]
1
218
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define ALL(a) a.begin(), a.end() typedef long long ll; #define INF 1 << 30 const double PI = 3.141592653589793; int main() { i...
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define ALL(a) a.begin(), a.end() typedef long long ll; #define INF 1 << 30 const double PI = 3.141592653589793; int main() { i...
[["-", 0, 30, 0, 14, 8, 9, 0, 52, 0, 89], ["+", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["-", 8, 9, 0, 52, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["-", 8, 9, 0, 52, 8, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 12, 13]]
1
168
import math a,b,h,m = map(int,input().split()) u = 360 * h / 12 + 30 * m / 60 v = 360 * m / 60 z = abs(u - v) if z > 180: z = z - 180 c = a**2 + b**2 - 2*a*b*math.cos(math.radians(z)) print(math.sqrt(c))
import math a,b,h,m = map(int,input().split()) u = 360 * h / 12 + 30 * m / 60 v = 360 * m / 60 z = abs(u - v) if z > 180: z = 360 - z c = a**2 + b**2 - 2*a*b*math.cos(math.radians(z)) print(math.sqrt(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
96
import math a, b, h, m = map(int, input().split()) c = math.pi*(h+m/60)/6 d = math.pi*m/30 e = min(abs(c-d), math.pi-abs(c-d)) print(math.sqrt(a**2+b**2-2*a*b*math.cos(e)))
import math a, b, h, m = map(int, input().split()) c = math.pi*(h+m/60)/6 d = math.pi*m/30 e = min(abs(c-d), 2*math.pi-abs(c-d)) print(math.sqrt(a**2+b**2-2*a*b*math.cos(e)))
[["+", 12, 652, 3, 4, 0, 657, 31, 657, 31, 612], ["+", 12, 652, 3, 4, 0, 657, 31, 657, 17, 48]]
5
96
import bisect import copy import heapq import sys import itertools import math import queue input = sys.stdin.readline sys.setrecursionlimit(1000000) # mod = 10 ** 9 + 7 def read_values(): return map(int, input().split()) def read_index(): return map(lambda x: int(x) - 1, input().split()) def read_list(): return list(...
import bisect import copy import heapq import sys import itertools import math import queue input = sys.stdin.readline sys.setrecursionlimit(1000000) # mod = 10 ** 9 + 7 def read_values(): return map(int, input().split()) def read_index(): return map(lambda x: int(x) - 1, input().split()) def read_list(): return list(...
[["-", 12, 657, 12, 652, 3, 4, 0, 657, 17, 109], ["-", 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
243
import math a,b,h,m=map(int,input().split()) mangle=m*6 hangle=30*h+0.5*m angle=min(abs(hangle-mangle), 360-abs(hangle-mangle)) print(angle) length=math.sqrt(a**2+b**2-2*a*b*math.cos(math.radians(angle))) print(length)
import math a,b,h,m=map(int,input().split()) mangle=m*6 hangle=30*h+0.5*m angle=min(abs(hangle-mangle), 360-abs(hangle-mangle)) length=math.sqrt(a**2+b**2-2*a*b*math.cos(math.radians(angle))) print(length)
[["-", 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 ll long long #define inf 1e18 #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define inf 1e18 #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
[["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 72], ["+", 0, 43, 49, 50, 51, 16, 12, 16, 31, 22], ["+", 0, 43, 49, 50, 51, 16, 12, 16, 17, 85], ["+", 0, 43, 49, 50, 51, 16, 12, 16, 12, 13]]
1
253
a,b,h,m = map(int,input().split()) long = m * 60 small = h * 30 + m * 0.5 kakudo = min(abs(long - small), 360-abs(small-long)) import math ans = (a ** 2 + b ** 2 - 2 * a * b * math.cos(math.radians(kakudo))) ** (1/2) print(ans)
a,b,h,m = map(int,input().split()) long = m * 6 small = h * 30 + m * 0.5 kakudo = min(abs(long - small), 360-abs(small-long)) import math ans = (a ** 2 + b ** 2 - 2 * a * b * math.cos(math.radians(kakudo))) ** (1/2) print(ans)
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612]]
5
95
a,b,h,m = gets.split.map &:to_f rad = 2 * Math::PI * ((60 * h + m) / 720 - m / 60) puts rad puts Math.sqrt(a ** 2 + b ** 2 - 2 * a * b * Math.cos( rad ))
a,b,h,m = gets.split.map &:to_f rad = 2 * Math::PI * ((60 * h + m) / 720 - m / 60) puts Math.sqrt(a ** 2 + b ** 2 - 2 * a * b * Math.cos( rad ))
[["-", 36, 36, 0, 493, 0, 652, 3, 4, 0, 22], ["-", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22]]
4
66
import math a, b, h, m = map(int, input().split()) kaku = math.pi / 360 * abs(60 * h - 11 * M) #yogen ans = a ** 2 + b ** 2 - 2 * math.cos(kaku) * a * b print(ans ** (1 /2))
import math a, b, h, m = map(int, input().split()) kaku = math.pi / 360 * abs(60 * h - 11 * m) #yogen ans = a ** 2 + b ** 2 - 2 * math.cos(kaku) * a * b print(ans ** (1 / 2))
[["-", 12, 652, 3, 4, 0, 657, 12, 657, 12, 22], ["+", 12, 652, 3, 4, 0, 657, 12, 657, 12, 22]]
5
73
from math import * A,B,h,m = map(int,input().split()) if h>11:h-=12 s=l=.0 l=m*6 s=30*(h+(m/60)) if l<s:l,s=s,l if l-s>180:d=360-l+s else:d=l-s c = cos(radians(d)) ans = sqrt(A**2+B**2-2*c) print(ans)
from math import * A,B,h,m = map(int,input().split()) if h>11:h-=12 s=l=.0 l=m*6 s=30*(h+(m/60)) if l<s:l,s=s,l if l-s>180:d=360-l+s else:d=l-s c = cos(radians(d)) ans = sqrt(A**2+B**2-2*A*B*c) print(ans)
[["+", 0, 657, 12, 657, 31, 657, 31, 657, 12, 22], ["+", 3, 4, 0, 657, 12, 657, 31, 657, 17, 48], ["+", 3, 4, 0, 657, 12, 657, 31, 657, 12, 22], ["+", 12, 652, 3, 4, 0, 657, 12, 657, 17, 48]]
5
117
#include <bits/stdc++.h> using ll = long long; using namespace std; #define INF 100100100 int main(void) { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int a, b, h, m; cin >> a >> b >> h >> m; double alpha = (h * 60 + m) * M_PI / 360; double beta = M_PI * m / 30; double ans = sqrt(a * a...
#include <bits/stdc++.h> using ll = long long; using namespace std; #define INF 100100100 int main(void) { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int a, b, h, m; cin >> a >> b >> h >> m; double alpha = (h * 60 + m) * M_PI / 360; double beta = M_PI * m / 30; double ans = sqrt(a * a...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
126
#define _CRT_SECURE_NO_WARNINGS #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; int P = 998244353; int main() { int a, b, h, m; cin >> a >> b >> h >> m; double degh = h * 30 + m * 0.5, degm = m * 6, deg = degh - degm; double c = a * a + b * b - 2 * a * b * cos(3.141...
#define _CRT_SECURE_NO_WARNINGS #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; int P = 998244353; int main() { int a, b, h, m; cin >> a >> b >> h >> m; double degh = h * 30 + m * 0.5, degm = m * 6, deg = degh - degm; double c = a * a + b * b - 2 * a * b * cos(3.141...
[["-", 12, 2, 3, 4, 0, 16, 31, 16, 31, 13], ["+", 12, 16, 12, 2, 3, 4, 0, 16, 31, 13], ["+", 12, 2, 3, 4, 0, 16, 12, 23, 0, 24], ["+", 12, 2, 3, 4, 0, 16, 12, 23, 0, 25], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
109
#include <algorithm> #include <iomanip> #include <iostream> #include <math.h> #include <string> using namespace std; typedef long long ll; int main(void) { long double p = 3.14159265358979323; long double a, b, c, d, h, m; cin >> a >> b >> h >> m; c = a * cos(p / 180.0 * (30.0 * (h + m / 60.0))) - b * cos...
#include <algorithm> #include <iomanip> #include <iostream> #include <math.h> #include <string> using namespace std; typedef long long ll; int main(void) { long double p = M_PI; long double a, b, c, d, h, m; cin >> a >> b >> h >> m; c = a * cos(p / 180.0 * (30.0 * (h + m / 60.0))) - b * cos(p / 180.0 * (6...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 22], ["-", 3, 4, 0, 16, 12, 23, 0, 16, 31, 13], ["+", 3, 4, 0, 16, 12, 23, 0, 16, 31, 13]]
1
162
#include <bits/stdc++.h> using namespace std; int main() { int a, b, h, m; double c, d, t, x; cin >> a >> b >> h >> m; c = 30.0 * (h + m / 60.0); d = 6.0 * m; t = max(d - c, c - d); if (t > 180.0) t -= 180; t *= M_PI / 180.0; x = pow(-2.0 * a * b * cos(t) + a * a + b * b, 0.5); cout << fixed << ...
#include <bits/stdc++.h> using namespace std; int main() { int a, b, h, m; double c, d, t, x; cin >> a >> b >> h >> m; c = 30.0 * (h + m / 60.0); d = 6.0 * m; t = max(d - c, c - d); if (t > 180.0) t = 360.0 - t; t *= M_PI / 180.0; x = pow(-2.0 * a * b * cos(t) + a * a + b * b, 0.5); cout << fixe...
[["-", 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
126
#include <bits/stdc++.h> using namespace std; int main() { int a, b, h, m; cin >> a >> b >> h >> m; cout << fixed << setprecision(15); int x = 30 * h - 5.5 * m; if (x >= 180) x = 360 - x; double_t pi = 3.141592653589793; double_t ans = a * a + b * b - 2 * a * b * cos(pi * x / 180); ans = sqrt(ans);...
#include <bits/stdc++.h> using namespace std; int main() { int a, b, h, m; cin >> a >> b >> h >> m; cout << fixed << setprecision(15); double_t x = 30 * h - 5.5 * m; if (x >= 180) x = 360 - x; double_t pi = 3.141592653589793; double_t ans = a * a + b * b - 2 * a * b * cos(pi * x / 180); ans = sqrt(...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
107
// Problem : C - : (Colon) // Contest : AtCoder - AtCoder Beginner Contest 168 // URL : https://atcoder.jp/contests/abc168/tasks/abc168_c // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) // mst,pq,mp,st,q #include <bits/stdc++.h> using namespace std; #de...
// Problem : C - : (Colon) // Contest : AtCoder - AtCoder Beginner Contest 168 // URL : https://atcoder.jp/contests/abc168/tasks/abc168_c // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) // mst,pq,mp,st,q #include <bits/stdc++.h> using namespace std; #de...
[["-", 49, 50, 51, 16, 12, 16, 12, 2, 63, 22]]
1
166
#include <algorithm> #include <cmath> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> #define BEGIN(x) x.begin(...
#include <algorithm> #include <cmath> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> #define BEGIN(x) x.begin(...
[["-", 31, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 13]]
1
445
import math a,b,h,m = list(map(int,input().split())) h = h % 12 theta = m*6 - h*30 arc = a** 2 + b**2 - 2*a*b*math.cos(math.radians(theta)) print(arc**0.5)
import math a,b,h,m = list(map(int,input().split())) h = h % 12 theta = m*5.5 - h*30 arc = a** 2 + b**2 - 2*a*b*math.cos(math.radians(theta)) print(arc**0.5)
[["-", 0, 1, 0, 662, 12, 657, 31, 657, 12, 612], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 12, 531]]
5
72
import math A,B,H,M = map(int,input().split()) print(math.sqrt(A**2 + B**2 - 2*A*B*abs(math.cos((H/12.+M/720.)*2*math.pi - M/60.*2*math.pi))))
import math A,B,H,M = map(int,input().split()) print(math.sqrt(A**2 + B**2 - 2*A*B*math.cos(abs((H/12.+M/720.)*2*math.pi - M/60.*2*math.pi))))
[["-", 3, 4, 0, 657, 12, 657, 12, 652, 63, 22], ["-", 0, 657, 12, 657, 12, 652, 3, 4, 0, 24], ["+", 0, 657, 12, 657, 12, 652, 3, 4, 0, 24], ["+", 12, 657, 12, 652, 3, 4, 0, 652, 63, 22]]
5
77
/* :) */ #include <bits/stdc++.h> using namespace std; #define fl(i, a, b) for (int i = a; i < b; i++) #define endl '\n' #define pb push_back #define ff first #define ff first #define ss second #define inf 2e18 #define mod 998244353 #define fast ...
/* :) */ #include <bits/stdc++.h> using namespace std; #define fl(i, a, b) for (int i = a; i < b; i++) #define endl '\n' #define pb push_back #define ff first #define ff first #define ss second #define inf 2e18 #define mod 998244353 #define fast ...
[["-", 0, 57, 64, 9, 0, 1, 0, 11, 12, 13], ["+", 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
A, B, H, M = map(int,input().split()) theta_M = M*6 theta_H = H*30 + M*0.5 theta = abs(theta_M - theta_H) if theta > 180: theta = 360 - theta import math x = A**2 + B**2 - 2 * 3 * 4 * math.cos(math.radians(theta)) x = math.sqrt(x) print(x)
A, B, H, M = map(int,input().split()) theta_M = M*6 theta_H = H*30 + M*0.5 theta = abs(theta_M - theta_H) if theta > 180: theta = 360 - theta import math x = A**2 + B**2 - 2 * A * B * math.cos(math.radians(theta)) x = math.sqrt(x) print(x)
[["-", 12, 657, 12, 657, 31, 657, 31, 657, 12, 612], ["+", 12, 657, 12, 657, 31, 657, 31, 657, 12, 22], ["-", 0, 662, 12, 657, 12, 657, 31, 657, 12, 612], ["+", 0, 662, 12, 657, 12, 657, 31, 657, 12, 22]]
5
93
#!/usr/bin/env python3 import sys input = sys.stdin.readline import math a, b, h, m = map(int, input().split()) deg_h = (h * 120 + m * 2) % 1440 deg_m = (m * 240) % 1440 diff = (deg_h - deg_m) % 1440 if deg_h >= deg_m: diff = deg_h - deg_m else: diff = deg_m - deg_h if 1440 - diff < diff: diff = 1440 - dif...
#!/usr/bin/env python3 import sys input = sys.stdin.readline import math a, b, h, m = map(int, input().split()) deg_h = (h * 120 + m * 2) % 1440 deg_m = (m * 24) % 1440 diff = (deg_h - deg_m) % 1440 if deg_h >= deg_m: diff = deg_h - deg_m else: diff = deg_m - deg_h if 1440 - diff < diff: diff = 1440 - diff...
[["-", 0, 662, 12, 657, 31, 23, 0, 657, 12, 612], ["+", 0, 662, 12, 657, 31, 23, 0, 657, 12, 612]]
5
131
import math a,b,h,m=map(int,input().split()) t1=math.radians(30*h+0.5*m) t2=math.radians(60*m) x1,y1=a*math.cos(t1),a*math.sin(t1) x2,y2=b*math.cos(t2),b*math.sin(t2) ans=math.sqrt((x2-x1)**2+(y2-y1)**2) print(ans)
import math a,b,h,m=map(int,input().split()) t1=math.radians(30*h+0.5*m) t2=math.radians(6*m) x1,y1=a*math.cos(t1),a*math.sin(t1) x2,y2=b*math.cos(t2),b*math.sin(t2) ans=math.sqrt((x2-x1)**2+(y2-y1)**2) print(ans)
[["-", 0, 662, 12, 652, 3, 4, 0, 657, 31, 612], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 31, 612]]
5
114
#include <bits/stdc++.h> #include <unordered_map> const double PI = acos(-1); using namespace std; typedef long long ll; typedef unsigned long long ull; using P = pair<ll, ll>; using V = vector<ll>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep1(i, n) for (ll i = 1; i <= (ll)(n); i++) #define rep2(i...
#include <bits/stdc++.h> #include <unordered_map> const double PI = acos(-1); using namespace std; typedef long long ll; typedef unsigned long long ull; using P = pair<ll, ll>; using V = vector<ll>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep1(i, n) for (ll i = 1; i <= (ll)(n); i++) #define rep2(i...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 0, 1, 0, 16, 12, 2, 3, 4, 0, 13], ["+", 0, 1, 0, 16, 12, 2, 3, 4, 0, 13]]
1
236