Submission #448446

#TimeUsernameProblemLanguageResultExecution timeMemory
448446osmanallazovIce Hockey World Championship (CEOI15_bobek)C++14
40 / 100
74 ms292 KiB
#include <bits/stdc++.h> using namespace std; int main(){ long long n,m,say=0; cin>>n>>m; long long a[n]; for(int i=0;i<n;i++){ cin>>a[i]; } for(long long x=0;x<(1<<n);x++){ long long sum=0; for(long long i=0;i<n;i++){ if(x&(1<<i)){ sum+=a[i]; } if(sum>m){ break; } } if(sum<=m){ say++; } } cout<<say; }
#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...