結果

問題 No.1964 sum = length
ユーザー HaaHaa
提出日時 2022-06-03 21:42:16
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 283 ms / 2,000 ms
コード長 851 bytes
コンパイル時間 1,705 ms
コンパイル使用メモリ 172,552 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-21 01:43:13
合計ジャッジ時間 8,287 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
4,348 KB
testcase_01 AC 3 ms
4,348 KB
testcase_02 AC 26 ms
4,348 KB
testcase_03 AC 3 ms
4,348 KB
testcase_04 AC 5 ms
4,348 KB
testcase_05 AC 6 ms
4,348 KB
testcase_06 AC 7 ms
4,348 KB
testcase_07 AC 9 ms
4,348 KB
testcase_08 AC 11 ms
4,348 KB
testcase_09 AC 11 ms
4,348 KB
testcase_10 AC 13 ms
4,348 KB
testcase_11 AC 15 ms
4,348 KB
testcase_12 AC 62 ms
4,348 KB
testcase_13 AC 87 ms
4,348 KB
testcase_14 AC 123 ms
4,348 KB
testcase_15 AC 139 ms
4,348 KB
testcase_16 AC 25 ms
4,348 KB
testcase_17 AC 70 ms
4,348 KB
testcase_18 AC 76 ms
4,348 KB
testcase_19 AC 49 ms
4,348 KB
testcase_20 AC 54 ms
4,348 KB
testcase_21 AC 23 ms
4,348 KB
testcase_22 AC 252 ms
4,348 KB
testcase_23 AC 256 ms
4,348 KB
testcase_24 AC 190 ms
4,348 KB
testcase_25 AC 195 ms
4,348 KB
testcase_26 AC 267 ms
4,348 KB
testcase_27 AC 226 ms
4,348 KB
testcase_28 AC 197 ms
4,348 KB
testcase_29 AC 238 ms
4,348 KB
testcase_30 AC 207 ms
4,348 KB
testcase_31 AC 273 ms
4,348 KB
testcase_32 AC 146 ms
4,348 KB
testcase_33 AC 142 ms
4,348 KB
testcase_34 AC 250 ms
4,348 KB
testcase_35 AC 166 ms
4,348 KB
testcase_36 AC 218 ms
4,348 KB
testcase_37 AC 238 ms
4,348 KB
testcase_38 AC 274 ms
4,348 KB
testcase_39 AC 192 ms
4,348 KB
testcase_40 AC 210 ms
4,348 KB
testcase_41 AC 258 ms
4,348 KB
testcase_42 AC 283 ms
4,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;
typedef vector<ll> VI;
typedef vector<VI> VVI;
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) v.begin(),v.end()
template<typename T> bool chmax(T &x, const T &y) {return (x<y)?(x=y,true):false;};
template<typename T> bool chmin(T &x, const T &y) {return (x>y)?(x=y,true):false;};
constexpr ll MOD=998244353;
constexpr ll INF=2e18;

int main(){
    int n; cin >> n;
    int m=400;
    VVI dp(n+1,VI(m,0));
    dp[0][200]=1;
    REP(i,n){
        REP(j,m){
            for(int k=1;k<m;k++){
                int l=j+k-to_string(k).size()-1;
                if(l<0||m<=l)
                    continue;
                dp[i+1][l]+=dp[i][j];
                dp[i+1][l]%=MOD;
            }
        }
    }
    cout << dp[n][200-1] << endl;
    return 0;
}
0