(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

Submission #1122381

#TimeUsernameProblemLanguageResultExecution timeMemory
1122381vjudge1Ice Hockey World Championship (CEOI15_bobek)C++17
40 / 100
46 ms504 KiB
#pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC optimize("fast-math") #include <bits/stdc++.h> using namespace std; #define int long long #define fi first #define se second #define vvi vector<vector<int>> #define ld long double #define ar array #define pb push_back #define vi vector<int> #define vc vector #define vpi vector<pair<int, int>> #define pii pair<int, int> #define all(c) (c).begin(), (c).end() #define endll '\n' #define fastio ios::sync_with_stdio(0); cin.tie(nullptr); cout.tie(nullptr); #define lb(a, x) lower_bound(all(a), x) - a.begin(); #define ub(a, x) upper_bound(all(a), x) - a.begin(); template<typename T> bool umax(T &res, const T &val) { if (res < val){ res = val; return true; }; return false; } template<typename T> bool umin(T &res, const T &val) { if (res > val){ res = val; return true; }; return false; } mt19937 rng(time(0)); const int sz = 5e5 + 5; void solve() { int n, m; cin >> n >> m; int a[n]; for(int i = 0; i < n; ++i){ cin >> a[i]; } int res = 0; for(int mask = 0; mask < (1 << n); mask++){ int s = 0; for(int i = 0; i < n; ++i){ if(1 << i & mask){ s += a[i]; } } res += s <= m; } cout << res << endl; } signed main() { fastio int T = 1; while (T--) { solve(); } }
#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...