Submission #971749

#TimeUsernameProblemLanguageResultExecution timeMemory
971749Halym2007Bali Sculptures (APIO15_sculpture)C++17
9 / 100
516 ms600 KiB
#include <bits/stdc++.h> using namespace std; const int N = 2e3 + 5; #define ll long long ll a[N]; int main () { // freopen ("input.txt", "r", stdin); ll n, A, B; cin >> n >> A >> B; for (int i = 0; i < n; ++i) { cin >> a[i]; } ll jogap = 2e18; for (int i = 0; i < (1 << n); ++i) { int x = __builtin_popcount(i); if (x < A or x > B) continue; ll jog = 0; ll el = 0, sum = 0; for (int j = 0; j < n; ++j) { sum += a[j]; el++; if (i>>j&1) { jog |= sum; sum = el = 0; } } if (!el) { jogap = min (jogap, jog); } } cout << jogap; }
#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...