https://www.acmicpc.net/problem/9713
1
2
3
4
5
6
7
8
9
10
|
def sol(n):
answer = (n//2+1)**2
return answer
if __name__ == '__main__':
t = int(input())
for _ in range(t):
n = int(input())
print(sol(n))
|
cs |
홀수의 합 구하는 공식:
n^2
반응형
'python-algorithm' 카테고리의 다른 글
백준 6976 Divisibility by 11 (0) | 2022.12.07 |
---|---|
백준 5940 Math Practice (0) | 2022.12.07 |
백준 26041 비슷한 전화번호 표시 (0) | 2022.12.06 |
백준 6500 랜덤 숫자 만들기 (0) | 2022.12.06 |
백준 7120 String (0) | 2022.12.05 |
댓글