結果

問題 No.1492 01文字列と転倒
ユーザー auauaauaua
提出日時 2021-04-30 21:54:36
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
MLE  
実行時間 -
コード長 1,146 bytes
コンパイル時間 1,641 ms
コンパイル使用メモリ 170,968 KB
実行使用メモリ 801,100 KB
最終ジャッジ日時 2023-09-26 05:57:39
合計ジャッジ時間 26,409 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 MLE -
testcase_03 MLE -
testcase_04 MLE -
testcase_05 MLE -
testcase_06 MLE -
testcase_07 MLE -
testcase_08 MLE -
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 MLE -
testcase_15 AC 5 ms
4,380 KB
testcase_16 AC 42 ms
14,388 KB
testcase_17 MLE -
testcase_18 AC 46 ms
15,680 KB
testcase_19 AC 3 ms
4,376 KB
testcase_20 AC 29 ms
10,856 KB
testcase_21 AC 1,734 ms
483,048 KB
testcase_22 AC 40 ms
14,420 KB
testcase_23 AC 17 ms
7,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
//#define int long long
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(c) (c).rbegin(),(c).rend()
#define mp make_pair
#define endl '\n'
#define vec vector<ll>
#define mat vector<vector<ll> >
#define fi first
#define se second
#define double long double
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> pll;
//typedef long double ld;
typedef complex<double> Complex;
const ll INF=1e9+7;
const ll MOD=INF;
const ll inf=INF*INF;
ll mod=MOD;
const ll MAX=100010;



signed main(){
    ll n,m;cin>>n>>m;
    vector<vector<vector<int> > >dp(n*2+1,vector<vector<int> >(n+1,vector<int>(n*n+1)));
    dp[0][0][0]=1;
    rep(i,2*n){
        rep(j,n+1){
            rep(k,n*n+1){
                if(i-j<j)continue;
                if(j<n){
                    dp[i+1][j+1][k]=(dp[i+1][j+1][k]+dp[i][j][k])%m;
                }
                if(k+j<=n*n)dp[i+1][j][k+j]=(dp[i+1][j][k+j]+dp[i][j][k])%m;
            }
        }
    }
    rep(i,n*n+1){
        cout<<dp[n*2][n][i]<<endl;
    }
}
0