diff --git a/dohyeondol1/DP/24-dohyeondol1.cpp b/dohyeondol1/DP/24-dohyeondol1.cpp new file mode 100644 index 0000000..30ca996 --- /dev/null +++ b/dohyeondol1/DP/24-dohyeondol1.cpp @@ -0,0 +1,28 @@ +#include +#include +using namespace std; + +int main() { + cin.tie(nullptr)->sync_with_stdio(false); + + int dp[1001][10]; + int N; cin >> N; + + for(int j = 0; j <= 9; ++j) + dp[1][j] = 1; + + for(int i = 2; i <= N; i++) { + for(int j = 0; j <= 9; j++) { + dp[i][j] = 0; + for(int k = 0; k <= j; k++) + dp[i][j] = (dp[i][j] + dp[i-1][k]) % 10007; + } + } + + int result = 0; + for(int j = 0; j <= 9; j++) + result = (result + dp[N][j]) % 10007; + + cout << result << '\n'; + return 0; +} \ No newline at end of file diff --git a/dohyeondol1/README.md b/dohyeondol1/README.md index f517573..35bc7ce 100644 --- a/dohyeondol1/README.md +++ b/dohyeondol1/README.md @@ -23,4 +23,6 @@ | 19차시 | 2025.07.09 | 그래프 이론 | [최소 스패닝 트리](https://www.acmicpc.net/problem/1197)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/76| | 20차시 | 2025.07.10 | 문자열 | [접두사](https://www.acmicpc.net/problem/1141)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/78| | 21차시 | 2025.07.14 | 그래프 이론 | [석고 모형 만들기](https://www.acmicpc.net/problem/32031)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/81| - | 22차시 | 2025.07.19 | 그리디 알고리즘 | [대회 개최](https://www.acmicpc.net/problem/12915)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/87| \ No newline at end of file + | 22차시 | 2025.07.19 | 그리디 알고리즘 | [대회 개최](https://www.acmicpc.net/problem/12915)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/87| + | 23차시 | 2025.08.03 | 그래프 이론 | [플로이드](https://www.acmicpc.net/problem/11404)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/93| + | 24차시 | 2025.08.25 | DP | [오르막 수](https://www.acmicpc.net/problem/11057)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/95| \ No newline at end of file