Submission #137993

#TimeUsernameProblemLanguageResultExecution timeMemory
137993nekiIce Hockey World Championship (CEOI15_bobek)C++14
40 / 100
1102 ms263204 KiB
#include <bits/stdc++.h> #define loop(i, a, b) for(int i=a;i<b;i++) using namespace std; typedef long long ll; map<ll, ll> dp; int main(){ ll n, m, t;cin>> n >> m; dp[0]=1; loop(agsdgs, 0, n){ cin >> t; map<ll, ll> dp2=dp; for(auto&& i:dp) if(i.first+t<=m) dp2[i.first+t]+=i.second; dp=dp2; } ll ans=0; for(auto&& i:dp) ans+=i.second; cout << ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...