classSolution { public: int ans[101][10000+1]; intdfs(int k, int n){ if (ans[k][n]!= -1) { return ans[k][n]; } if (k == 1) return n; if (n == 1) return1; int mi = n; for (int i = 1; i< n; i ++) { int f1 = dfs(k-1, i-1); int f2 = dfs(k, n-i); mi = min(1+max(f1, f2), mi); } ans[k][n] = mi; return mi; } intsuperEggDrop(int k, int n){ memset(ans, 0xff ,sizeof ans); returndfs(k,n); } };