class Solution {
public:
vector<vector<int>> generate(int numRows) {
if (numRows <= 0)
return vector<vector<int>>();
vector<vector<int>> res(1, vector<int>(1,1));
for (int i = 1; i < numRows; i++){
vector<int> tmp;
tmp.push_back(1);
for (int j = 1; j < i; j++)
tmp.push_back(res[res.size() - 1][j - 1] + res[res.size() - 1][j]);
tmp.push_back(1);
res.push_back(tmp);
}
return res;
}
};
static int x=[](){
std::ios::sync_with_stdio(false);
cin.tie(NULL);
return 0;
}();