Pagini recente » Cod sursa (job #1591444) | Cod sursa (job #2439940) | Infoarena Monthly 2014 - Runda 9, Solutii | Cod sursa (job #3032079) | Cod sursa (job #2570143)
#include <fstream>
#include <map>
using namespace std;
ifstream cin("oite.in");
ofstream cout("oite.out");
const int lim=1024+1;
map<pair<int,int>,int> m;
int main()
{
int c,l,a;
cin>>c>>l;
m[{l,0}]=1;
for(int i=1;i<=c;++i)
{
cin>>a;
for(auto x:m){
if(x.first.first-a>=0 and x.first.second<=3)
m[{x.first.first-a,x.first.second+1}]+=x.second;
///cout<<x.first.first<<' '<<x.first.second<<": "<<x.second<<endl;
}
}
cout<<m[{0,4}];
return 0;
}