| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1327884 | vuh | Bali Sculptures (APIO15_sculpture) | C++20 | 968 ms | 440 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
ios::sync_with_stdio(false);
cin.tie(0);
int n, p, q;
cin>>n>>p>>q;
int a[n];
int ans = LLONG_MAX;
for(int i = 0; i < n; i++) cin >> a[i];
for(int b = 0; b < (1<<(n-1)); b++){
int v = 1;
int cur = a[0];
int res = 0;
bool flag = false;
for(int i = 0; i < n-1; i++){
if(b & (1 << i)){
res |= cur;
v++;
if(v > q){
flag = true;
break;
}
cur = 0;
}
cur += a[i+1];
}
if(flag) continue;
res |= cur;
if(v >= p)
ans = min(ans, res);
}
std::cout << ans << std::endl;
return 0;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
