CP-templates

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub Misuki743/CP-templates

:heavy_check_mark: combi/stirlingFirst.cpp

Verified with

Code

//#include<modint/MontgomeryModInt.cpp>
//#include<poly/NTTmint.cpp>
//#include<poly/FPS.cpp>

template<class Mint>
FPS<Mint> stirlingFirst(int n) {
  vector<FPS<Mint>> fs(n, {0, 1});
  for(int i = 0; i < n; i++)
    fs[i][0] = -i;
  return FPS<Mint>::allProd(fs);
}
#line 1 "combi/stirlingFirst.cpp"
//#include<modint/MontgomeryModInt.cpp>
//#include<poly/NTTmint.cpp>
//#include<poly/FPS.cpp>

template<class Mint>
FPS<Mint> stirlingFirst(int n) {
  vector<FPS<Mint>> fs(n, {0, 1});
  for(int i = 0; i < n; i++)
    fs[i][0] = -i;
  return FPS<Mint>::allProd(fs);
}
Back to top page