Submission #870261

#TimeUsernameProblemLanguageResultExecution timeMemory
870261vjudge1Ice Hockey World Championship (CEOI15_bobek)C++17
10 / 100
25 ms10076 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[a[0]] = 1; dp[0] = 1; for (int i = 1; i < n; i++) for (int j = m; j >= 0; j--) if (j-a[i] >= 0) 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...