Task: | Kolikot |
Sender: | Kuha |
Submission time: | 2016-07-28 14:28:39 +0300 |
Language: | C++ |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.05 s | details |
#2 | ACCEPTED | 0.05 s | details |
#3 | ACCEPTED | 0.05 s | details |
#4 | ACCEPTED | 0.06 s | details |
#5 | ACCEPTED | 0.05 s | details |
#6 | WRONG ANSWER | 0.06 s | details |
#7 | WRONG ANSWER | 0.06 s | details |
#8 | WRONG ANSWER | 0.05 s | details |
#9 | WRONG ANSWER | 0.07 s | details |
#10 | ACCEPTED | 0.06 s | details |
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: WRONG ANSWER
input |
---|
100 100000 157 42 20 92 161 45 78 193 121... |
correct output |
---|
965218376 |
user output |
---|
7617043355915839716 |
Test 7
Verdict: WRONG ANSWER
input |
---|
100 100000 128 91 277 255 36 274 15 110 4... |
correct output |
---|
61380312 |
user output |
---|
4778530603440303507 |
Test 8
Verdict: WRONG ANSWER
input |
---|
100 100000 975 777 370 188 787 808 879 79... |
correct output |
---|
44790529 |
user output |
---|
-7508693883224126857 |
Test 9
Verdict: WRONG ANSWER
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 |