Submission #110279

#TimeUsernameProblemLanguageResultExecution timeMemory
110279tc_abdBali Sculptures (APIO15_sculpture)C++14
9 / 100
1087 ms512 KiB
#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 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...