이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll n,a,b,mn=1000000000000000009ll;
ll arr[50];
void bt(ll id,ll sum,ll curr,ll flag,bool flag2){
if(id == n){
if(flag < a || flag > b || !flag2) return;
mn = min(mn,curr); return;
}
sum += arr[id];
bt(id+1,sum,curr,flag,0);
curr |= sum;
bt(id+1,0,curr,flag+1,1);
}
int main(){
cin>>n>>a>>b;
for(int i=0;i<n;i++) cin>>arr[i];
bt(0,0,0,0,0);
cout<<mn<<endl;
}
# | 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... |