Submission #549069

#TimeUsernameProblemLanguageResultExecution timeMemory
549069Blobo2_Blobo2Bali Sculptures (APIO15_sculpture)C++17
0 / 100
1083 ms31752 KiB
/* Editor: Abdelrahman Hossam Nickname: Blobo2_Blobo2 IOI next year isA :) */ /*#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx2") #pragma GCC optimize("-ffast-math") #pragma GCC optimize("-funroll-loops") #pragma GCC optimize("-funroll-all-loops,-fpeel-loops,-funswitch-loop")*/ #include<bits/stdc++.h> using namespace std; #define int long long #define endl "\n" #define all(v) v.begin(),v.end() #define gen(arr,n,nxt) generate(arr,arr+n,nxt) #define Blobo2 ios_base::sync_with_stdio(false);cin.tie(0); const int mo=1e9+7; int nxt(){int x;cin>>x;return x;} int arr[2001],n,l,r; int dp[2001][2001]; int solve(int idx=0,int part=1,int sum=0){ //cout<<idx<<' '<<part<<' '<<sum<<endl; if(part>r) return 1e18; if(idx==n){ if(part<l)return 1e18; return sum; } int ret = 0; //if(ret!=-1)return ret; return ret = min(solve(idx+1,part+1,0)|(sum+arr[idx]), solve(idx+1,part,sum+arr[idx])); } signed main(){ Blobo2 n=nxt(),l=nxt(),r=nxt(); gen(arr,n,nxt); memset(dp,-1,sizeof dp); cout<<solve(); return 0; }
#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...