From 4844b7a941c54d5f78de21a15626aa2822bd432e Mon Sep 17 00:00:00 2001 From: hadongun Date: Fri, 9 May 2025 23:51:51 +0900 Subject: [PATCH] 2025-05-09 --- hadongun/README.md | 2 +- ...n \355\203\200\354\235\274\353\247\201.py" | 9 ++++++ .../\354\230\244\355\201\260\354\210\230.py" | 28 +++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 "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" create mode 100644 "hadongun/\354\212\244\355\203\235/\354\230\244\355\201\260\354\210\230.py" diff --git a/hadongun/README.md b/hadongun/README.md index 95ae3aa..01b38ac 100644 --- a/hadongun/README.md +++ b/hadongun/README.md @@ -12,5 +12,5 @@ | 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| - + | 11차시| 2025.05.09 | 다이나믹 프로그래밍 | [2xn 타일링](https://www.acmicpc.net/problem/11726)|| --- \ No newline at end of file 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() + +