diff --git a/Contributors.html b/Contributors.html index fc4bafaeed..b9f2680db7 100644 --- a/Contributors.html +++ b/Contributors.html @@ -225,6 +225,8 @@

Contributors

Akash Ratan Verma Vibhuti Negi Ananya Sajwan + Husin Muhammad Assegaff + diff --git a/Program's_Contributed_By_Contributors/Dynamic Programming/Ladders.cpp b/Program's_Contributed_By_Contributors/Dynamic Programming/Ladders.cpp new file mode 100644 index 0000000000..9c5aaae4ff --- /dev/null +++ b/Program's_Contributed_By_Contributors/Dynamic Programming/Ladders.cpp @@ -0,0 +1,21 @@ +// Solution of problem Ladders - E-Olymp (https://www.e-olymp.com/en/problems/989) + +#include +using namespace std; + +int n, dp[100]; + +int main() +{ + scanf("%d", &n); + dp[0] = 1; + for (int i = 1; i <= n; i++) + { + for (int j = n; j >= 0; j--) + { + if (i + j <= n) + dp[j + i] += dp[j]; + } + } + printf("%d\n", dp[n]); +} \ No newline at end of file