1
2
3
4
5
|
def sol(n):
if n%2 == 0 : return (n//2)
else: return sol(n-1)-n
print(sol(int(input())))
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
codeforces 1335A - Candies and Two Sisters (0) | 2022.05.02 |
---|---|
codeforces 1154A - Restoring Three Numbers (0) | 2022.04.29 |
codeforces 155A - I_love_\%username\% (0) | 2022.04.29 |
codeforces 977A - Wrong Subtraction (0) | 2022.04.29 |
codeforces 520A - Pangram (0) | 2022.04.29 |
댓글