Skip to content

Instantly share code, notes, and snippets.

@monhime
Created May 18, 2020 00:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save monhime/608100b03c07c8ce29a238abf9134fac to your computer and use it in GitHub Desktop.
Save monhime/608100b03c07c8ce29a238abf9134fac to your computer and use it in GitHub Desktop.
ABC168 C問題 解答
import sys
def input(): return sys.stdin.readline().rstrip()
import math
def main():
a,b,h,m=map(int,input().split())
theta_a=(60*h+m)*2*math.pi/720
theta_b=m*2*math.pi/60
print(math.sqrt((a*math.cos(theta_a)-b*math.cos(theta_b))**2+(a*math.sin(theta_a)-b*math.sin(theta_b))**2))
if __name__=='__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment