Submission #71556


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <bits/stdc++.h>
using namespace std;
int main(){
int n,x;
cin>>n>>x;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}
vector<vector<int>> dp(n,vector<int>((30*30)+1,0));
dp[0][a[0]]++;
for(int i=1;i<n;i++){
dp[i][a[i]]++;
for(int j=0;j<=30*30;j++){
if(dp[i-1][j]>=1){
dp[i][j]+=dp[i-1][j];
dp[i][j+a[i]]+=dp[i-1][j];
}
}
}
cout<<dp[n-1][x]<<"\n";
return(0);
}

ステータス

項目 データ
問題 1235 - チーム虚無新人賞おめでとう!
ユーザー名 ei2122
投稿日時 2022-07-28 10:34:12
言語 C++17
状態 Accepted
得点 10
ソースコード長 520 Byte
最大実行時間 26 ms
最大メモリ使用量 888 KB

セット

セット 得点 Cases
1 R1910 1 / 1 in01.text, in02.text, in03.text, in04.text, in05.text, in06.text, in07.text, in08.text, in09.text, in10.text, in11.text, in12.text, in13.text, in14.text, in15.text, in16.text, in17.text, in18.text, in19.text, in20.text
2 R1933 9 / 9 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
in01.text AC 24 ms 604 KB
1
2
in02.text AC 22 ms 432 KB
1
2
in03.text AC 23 ms 508 KB
1
2
in04.text AC 25 ms 452 KB
1
2
in05.text AC 26 ms 524 KB
1
2
in06.text AC 17 ms 592 KB
1
2
in07.text AC 20 ms 656 KB
1
2
in08.text AC 23 ms 584 KB
1
2
in09.text AC 17 ms 636 KB
1
2
in10.text AC 26 ms 684 KB
1
2
in11.text AC 24 ms 600 KB
1
2
in12.text AC 18 ms 640 KB
1
2
in13.text AC 25 ms 672 KB
1
2
in14.text AC 25 ms 712 KB
1
2
in15.text AC 22 ms 616 KB
1
2
in16.text AC 19 ms 644 KB
1
2
in17.text AC 20 ms 668 KB
1
2
in18.text AC 21 ms 696 KB
1
2
in19.text AC 20 ms 716 KB
1
2
in20.text AC 23 ms 864 KB
1
2
in21.text AC 22 ms 764 KB
2
in22.text AC 24 ms 780 KB
2
in23.text AC 17 ms 796 KB
2
in24.text AC 18 ms 804 KB
2
in25.text AC 22 ms 796 KB
2
in26.text AC 18 ms 788 KB
2
in27.text AC 18 ms 772 KB
2
in28.text AC 22 ms 888 KB
2
in29.text AC 19 ms 880 KB
2
in30.text AC 21 ms 868 KB
2