Submission #870264

#TimeUsernameProblemLanguageResultExecution timeMemory
870264vjudge1Ice Hockey World Championship (CEOI15_bobek)C++17
40 / 100
1101 ms600 KiB
#include <bits/stdc++.h> #pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") #define int long long #define endl "\n" using namespace std; vector<int>v; int dp(int i,int sum){ if(sum<0)return 0; if(i<0)return 1; return dp(i-1,sum)+dp(i-1,sum-v[i]); } signed main(){ int n,m; cin>>n>>m; for(int i=0;i<n;i++){ int a; cin>>a; v.push_back(a); } sort(v.begin(),v.end()); cout<<dp(n-1,m); }
#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...