Skip to content

Instantly share code, notes, and snippets.

@yuda110
Created May 5, 2016 04:35
Show Gist options
  • Save yuda110/d2229b94acb4acce743d10fbe7b69e56 to your computer and use it in GitHub Desktop.
Save yuda110/d2229b94acb4acce743d10fbe7b69e56 to your computer and use it in GitHub Desktop.
#p <= 1000 직각삼각형
#a^2 + b^2 = c^2
#1) p의 값을 기준으로, {a, b, c} 값을 정한다.
def get_삼각형의_세변(p):
직각삼각형_cnt = 0
for a in range(어디부터, p-2까지):
for b in range(어디부터, p-2까지):
c = p - (a + b)
if a^2 + b^2 == c^2 :
직각삼각형_cnt += 1
return 직각삼각형_cnt
#2) max값 구하기
def get_max....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment