結果

問題 No.1964 sum = length
ユーザー harurunharurun
提出日時 2022-04-21 19:03:12
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,090 bytes
コンパイル時間 3,160 ms
コンパイル使用メモリ 176,436 KB
実行使用メモリ 4,512 KB
最終ジャッジ日時 2023-09-05 02:44:37
合計ジャッジ時間 5,190 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 2 ms
4,384 KB
testcase_02 WA -
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,384 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,384 KB
testcase_10 AC 2 ms
4,384 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <deque>
#include <queue>
#include <string>
#include <iomanip>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <utility>
#include <stdio.h>
#include <math.h>
#include <assert.h>
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif
using namespace std;
using ll=long long;
#define read(x) cin>>(x);
#define readll(x) ll (x);cin>>(x);
#define readS(x) string (x);cin>>(x);
#define readvll(x,N) vector<ll> (x)((N));for(int i=0;i<(N);i++){cin>>(x)[i];}


int main(){
  int n;
  cin>>n;
  vector<ll> C(2*n);
  ll a=1;
  ll digit=0;
  while(a-digit<=2*n-1){
    C[a-digit]++;
    if(a%10==0){
      digit++;
    }
    a++;
  }
  const ll mod=998244353;
  vector<ll> dp(2*n);
  dp[0]=1;
  for(ll i=0;i<n;i++){
    vector<ll> dp2(2*n);
    for(ll j=0;j<2*n;j++){
      for(ll k=1;k<2*n;k++){
        if(j+k<2*n){
          dp2[j+k]+=dp[j]*C[k];
          dp2[j+k]%=mod;
        }
      }
    }
    dp.swap(dp2);
  }
  cout<<dp[2*n-1]<<endl;
  return 0;
}
0