Submission #950345

# Submission time Handle Problem Language Result Execution time Memory
950345 2024-03-20T08:41:28 Z Unforgettablepl Bali Sculptures (APIO15_sculpture) C++17
0 / 100
1 ms 600 KB
#include <bits/stdc++.h>
using namespace std;

#define int long long

int arr[2001];

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n,a,b;
    cin >> n >> a >> b;
    for(int i=0;i<n;i++)cin>>arr[i];
    int ans = INT64_MAX;
    for(int subset=0;subset<(1<<(n-1));subset++){
        if(__builtin_popcount(subset)!=(b-1))continue;
        int curr = 0;
        int currsum = 0;
        for(int i=0;i<n-1;i++){
            currsum+=arr[i];
            if(subset&(1<<i)){
                curr|=currsum;
                currsum=0;
            }
        }
        curr|=currsum+arr[n-1];
        ans = min(ans,curr);
    }
    cout << ans << '\n';
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Incorrect 0 ms 348 KB Output isn't correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Incorrect 0 ms 348 KB Output isn't correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Incorrect 1 ms 344 KB Output isn't correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 600 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Incorrect 1 ms 348 KB Output isn't correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 460 KB Output is correct
6 Incorrect 1 ms 344 KB Output isn't correct
7 Halted 0 ms 0 KB -