#pragma GCC optimize ("O2") #pragma GCC target ("avx") #include //#include //using namespace atcoder; using namespace std; typedef long long ll; #define rep(i, n) for(int i = 0; i < (n); i++) #define rep1(i, n) for(int i = 1; i <= (n); i++) #define co(x) cout << (x) << "\n" #define cosp(x) cout << (x) << " " #define ce(x) cerr << (x) << "\n" #define cesp(x) cerr << (x) << " " #define pb push_back #define mp make_pair #define chmin(x, y) x = min(x, y) #define chmax(x, y) x = max(x, y) #define Would #define you #define please int mod; int dp[2][105][10100]; int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N >> mod; auto mae = dp[0]; auto ato = dp[1]; mae[0][0] = 1; rep(i, N) { rep(j, i + 2) for (int k = i * i; k >= 0; k--) { (ato[j][k + j] += mae[j][k]) %= mod; if (j != 0) { (ato[j][k] += ato[j - 1][k]) %= mod; } } swap(mae, ato); rep(j, i + 2) rep(k, i * i + 1) ato[j][k] = 0; } rep(i, N * N + 1) { co(mae[N][i]); } Would you please return 0; }