πŸ€–/λ°±μ€€

λ°±μ€€ 3053: νƒμ‹œ κΈ°ν•˜ν•™ (Python)

sssbin 2021. 9. 2. 13:54

https://www.acmicpc.net/problem/3053

 

3053번: νƒμ‹œ κΈ°ν•˜ν•™

첫째 μ€„μ—λŠ” μœ ν΄λ¦¬λ“œ κΈ°ν•˜ν•™μ—μ„œ λ°˜μ§€λ¦„μ΄ R인 μ›μ˜ 넓이λ₯Ό, λ‘˜μ§Έ μ€„μ—λŠ” νƒμ‹œ κΈ°ν•˜ν•™μ—μ„œ λ°˜μ§€λ¦„μ΄ R인 μ›μ˜ 넓이λ₯Ό 좜λ ₯ν•œλ‹€. μ •λ‹΅κ³Όμ˜ μ˜€μ°¨λŠ” 0.0001κΉŒμ§€ ν—ˆμš©ν•œλ‹€.

www.acmicpc.net

 

import math

r = int(input())

print('%f'%float(r**2*math.pi))
print('%f'%float(2*r**2))

 

μœ ν΄λ¦¬λ“œ κΈ°ν•˜ν•™μ—μ„œμ˜ μ›μ˜ 넓이: pi*r^2

νƒμ‹œ κΈ°ν•˜ν•™μ—μ„œμ˜ μ›μ˜ 넓이: 두 λŒ€κ°μ„ μ˜ 길이가 같은 λ§ˆλ¦„λͺ¨ = (1/2*r^2)*4 = 2*r^2