結果
| 問題 |
No.1492 01文字列と転倒
|
| コンテスト | |
| ユーザー |
umezo
|
| 提出日時 | 2021-04-30 23:50:59 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 1,420 ms / 4,000 ms |
| コード長 | 562 bytes |
| コンパイル時間 | 1,725 ms |
| コンパイル使用メモリ | 193,240 KB |
| 最終ジャッジ日時 | 2025-01-21 04:49:05 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 |
ソースコード
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
#include <bits/stdc++.h>
using namespace std;
ll dp[210][110][10010];
int main(){
ll n,m;
cin>>n>>m;
dp[0][0][0]=1;
for(int i=0;i<2*n;i++){
for(int j=0;j<=i/2;j++){
int t=(i/2)*(i/2);
for(int k=0;k<=t;k++){
if(k+j<=n*n) dp[i+1][j][k+j]=(dp[i+1][j][k+j]+dp[i][j][k])%m;
if(i>=2*j+1) dp[i+1][j+1][k]=(dp[i+1][j+1][k]+dp[i][j][k])%m;
}
}
}
for(int k=0;k<=n*n;k++) cout<<dp[2*n][n][k]<<endl;
return 0;
}
umezo