```
vector<int> getRow(int rowIndex) {
vector<int> res;
res.push_back(1);
if(rowIndex==0) return res;
res.push_back(1);
while(rowIndex>1){
int tmp1,tmp2=1;
for(int i=1;i<res.size();i++){
tmp1=res[i];
res[i]=tmp2+res[i];
tmp2=tmp1;
}
res.push_back(1);
rowIndex--;
}
return res;
}
```