728x90
반응형
단순 수학 문제이다.
n = int(input())
if n <= 5:
print(n)
else:
if (n-5)//4 % 2 == 0:
print(5 - (n-5)%4)
else:
print(1 + (n-5)%4)728x90
반응형
'Agorithm > 백준 알고리즘' 카테고리의 다른 글
| 백준 알고리즘 17863번 FYI (python) (0) | 2021.02.09 |
|---|---|
| 백준 알고리즘 17388번 와글와글 숭고한(python) (0) | 2021.02.09 |
| 백준 알고리즘 17009번 Winning Score(python) (0) | 2021.02.08 |
| 백준 알고리즘 16785번 ソーシャルゲーム(python) (0) | 2021.02.08 |
| 백준 알고리즘 16727번 ICPC(python) (0) | 2021.02.08 |