CSES - Leirikisa 2 - Results
Submission details
Task:Kolikot
Sender:Kuha
Submission time:2016-07-28 14:28:39 +0300
Language:C++
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#1ACCEPTED0.05 sdetails
#2ACCEPTED0.05 sdetails
#3ACCEPTED0.05 sdetails
#4ACCEPTED0.06 sdetails
#5ACCEPTED0.05 sdetails
#60.06 sdetails
#70.06 sdetails
#80.05 sdetails
#90.07 sdetails
#10ACCEPTED0.06 sdetails

Code

#include <bits/stdc++.h>
#define ll long long
#define INF 999999999
#define N (1<<17)
#define M 1000000007

using namespace std;

ll dp[500001];

int main () {
  int n, x;
  cin>>n>>x;
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin>>v[i];
  dp[0] = 1;
  for (int c = 0; c < n; c++) {
    for (int i = v[c]; i <= x; i++) {
      dp[i] += dp[i - v[c]];
    }
  }
  cout<<dp[x]<<endl;
}

Test details

Test 1

Verdict: ACCEPTED

input
10 100
4 10 1 6 8 9 3 7 2 5

correct output
6292069

user output
6292069

Test 2

Verdict: ACCEPTED

input
10 100
15 13 6 1 19 2 12 7 17 11

correct output
137264

user output
137264

Test 3

Verdict: ACCEPTED

input
10 100
4 6 27 5 24 8 29 7 17 12

correct output
9127

user output
9127

Test 4

Verdict: ACCEPTED

input
10 100
27 5 36 34 4 28 29 18 1 26

correct output
4245

user output
4245

Test 5

Verdict: ACCEPTED

input
10 100
1 13 34 38 8 32 7 47 25 15

correct output
2448

user output
2448

Test 6

Verdict:

input
100 100000
157 42 20 92 161 45 78 193 121...

correct output
965218376

user output
7617043355915839716

Test 7

Verdict:

input
100 100000
128 91 277 255 36 274 15 110 4...

correct output
61380312

user output
4778530603440303507

Test 8

Verdict:

input
100 100000
975 777 370 188 787 808 879 79...

correct output
44790529

user output
-7508693883224126857

Test 9

Verdict:

input
100 100000
2783 2426 2774 4245 1497 2915 ...

correct output
269131525

user output
-8458298893621348365

Test 10

Verdict: ACCEPTED

input
100 100000
12852 43492 55488 16404 72089 ...

correct output
1128389

user output
1128389