#include #include #include using namespace std; int main() { int m[101][101]; auto start = chrono::high_resolution_clock::now(); for (int n = 1; n <= 100; n++) m[1][n] = 1; for (int t = 1; t <= 100; t++) m[t][1] = 1; for (int t = 2; t <= 100; t++) for (int n = 2; n <= 100; n++) { if (n > t) m[t][n] = m[t][n-1]; if (n == t) m[t][n] = m[t][n-1]+1; if (n < t) m[t][n] = m[t][n-1]+m[t-n][n]; } auto end = std::chrono::high_resolution_clock::now(); std::chrono::duration elapsed_seconds = end-start; cout << "problem took: " << elapsed_seconds.count() << endl; cout << m[100][99]; return 0; }