diff --git a/hadongun/README.md b/hadongun/README.md index 95d529a..c022d14 100644 --- a/hadongun/README.md +++ b/hadongun/README.md @@ -11,4 +11,5 @@ | 7차시 | 2025.04.07 | 스택 | [균형 잡힌 세상](https://www.acmicpc.net/problem/4949)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/25| | 8차시 | 2025.04.09 | 그리디 알고리즘 | [알바생 강호](https://www.acmicpc.net/problem/1758)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/29| | 9차시 | 2025.05.02 | 스택 | [제로](https://www.acmicpc.net/problem/10773)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/36| - | 10차시| 2025.05.07 | 수학 | [통계학](https://www.acmicpc.net/problem/2108)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/36| \ No newline at end of file + | 10차시| 2025.05.07 | 수학 | [통계학](https://www.acmicpc.net/problem/2108)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/36| + | 11차시| 2025.05.09 | 다이나믹 프로그래밍 | [2xn 타일링](https://www.acmicpc.net/problem/11726)|| diff --git "a/hadongun/\353\213\244\354\235\264\353\202\230\353\257\271 \355\224\204\353\241\234\352\267\270\353\236\230\353\260\215/2xn \355\203\200\354\235\274\353\247\201.py" "b/hadongun/\353\213\244\354\235\264\353\202\230\353\257\271 \355\224\204\353\241\234\352\267\270\353\236\230\353\260\215/2xn \355\203\200\354\235\274\353\247\201.py" new file mode 100644 index 0000000..e943a16 --- /dev/null +++ "b/hadongun/\353\213\244\354\235\264\353\202\230\353\257\271 \355\224\204\353\241\234\352\267\270\353\236\230\353\260\215/2xn \355\203\200\354\235\274\353\247\201.py" @@ -0,0 +1,9 @@ +import math + +n = int(input()) +method_num = 0 + +for i in range(0, n // 2 + 1): # 세로 블럭의 개수 i (2칸씩 차지) + method_num += math.comb(n - i, i) # 총 n - i개 자리 중 i개 세로 위치 선택 + +print(method_num % 10007) diff --git "a/hadongun/\354\212\244\355\203\235/\354\230\244\355\201\260\354\210\230.py" "b/hadongun/\354\212\244\355\203\235/\354\230\244\355\201\260\354\210\230.py" new file mode 100644 index 0000000..7e81d69 --- /dev/null +++ "b/hadongun/\354\212\244\355\203\235/\354\230\244\355\201\260\354\210\230.py" @@ -0,0 +1,28 @@ +import sys +N = int(input()) +Numlist = [] +Numlist = list(map(int, input().split())) +reverse = Numlist[::-1] +if N==1: + print(-1) + sys.exit() +while len(reverse): + check = True + currunt = reverse.pop() + + for i in range(len(reverse), 0, -1): + if reverse[i-1] > currunt: + Max = reverse[i-1] + check = False + break + if check: + print(-1, end=' ') + continue + + print(Max, end=' ') + + if len(reverse) == 1: + print(-1) + sys.exit() + +