Submission #870270

#TimeUsernameProblemLanguageResultExecution timeMemory
870270vjudge1Ice Hockey World Championship (CEOI15_bobek)C++17
50 / 100
25 ms7516 KiB
#include <bits/stdc++.h> #define int long long using namespace std; signed main() { int n,m; cin >> n >> m; vector <int> a(n); for (int i = 0; i < n; i++) cin >> a[i]; vector <int> dp(m+1,0); dp[0] = 1; for (int i = 0; i < n; i++) for (int j = m; j >= a[i]; j--) dp[j] += dp[j-a[i]]; int cnt = 0; for (int i = 0; i <= m; i++) cnt+=dp[i]; cout << cnt << '\n'; }
#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...