Submission #1103940

#TimeUsernameProblemLanguageResultExecution timeMemory
1103940ezzzayIce Hockey World Championship (CEOI15_bobek)C++14
40 / 100
69 ms2684 KiB
#include<bits/stdc++.h> using namespace std; #define int long long #define ff first #define ss second #define pb push_back #define double long double const int N=2e5+5; int a[N]; int dp[N*300]; int b[N]; signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n,p; cin>>n>>p; for(int i=0;i<n;i++)cin>>a[i]; int cnt=0; for(int i=0;i<(1<<n);i++){ int k=0; for(int j=0;j<n;j++){ if((1<<j)&i){ k+=a[j]; } } if(k<=p)cnt++; } cout<<cnt; }
#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...