# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
124127 | RafikHachana | Ice Hockey World Championship (CEOI15_bobek) | C++14 | 1081 ms | 66880 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
#define int long long
int n;
vector<int> v;
map<pair<int,int>,int> m;
int dp(int i,int rem)
{
if(rem<0) return 0;
if(i==n) return 1;
if(m.find({i,rem})!=m.end()) return m[{i,rem}];
return m[{i,rem}] = dp(i+1,rem) + dp(i+1,rem-v[i]);
}
main()
{
cin>>n;
int w;
cin>>w;
v.resize(n);
for(int i=0;i<n;i++) cin>>v[i];
cout<<dp(0,w)<<endl;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |