Submission #838931

#TimeUsernameProblemLanguageResultExecution timeMemory
838931rahidilbayramliIce Hockey World Championship (CEOI15_bobek)C++17
40 / 100
64 ms340 KiB
#include<bits/stdc++.h> #define ll long long #define ld long double #define vi vector<int> #define vl vector<ll> #define all(v) v.begin(), v.end() #define pb push_back #define f first #define s second #define pii pair<int, int> #define pll pair<ll, ll> using namespace std; int main() { ll n, m, i, j, ans = 0, sum = 0; cin >> n >> m; vl v(n); for(i = 0; i < n; i++) cin >> v[i]; for(i = 1; i < (1 << n); i++) { sum = 0; for(j = 0; j < n; j++) { if((i >> j) & 1) sum += v[j]; } if(sum <= m) ans++; } cout << ans + 1 << "\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...