Submission #456203

#TimeUsernameProblemLanguageResultExecution timeMemory
456203Blobo2_Blobo2Bali Sculptures (APIO15_sculpture)C++14
0 / 100
1077 ms31768 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,tune=native") #pragma GCC optimize("-ffast-math") #pragma GCC optimize("-funroll-loops") #pragma GCC optimize("-funroll-all-loops,-fpeel-loops,-funswitch-loops") #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_el_7akim_elly_3ayz_yro7_IOI_w_3ayz_yakol_jilaty ios_base::sync_with_stdio(false);cin.tie(0); const int mo=1e9+7,INF=1e18; 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 1e9; if(idx==n){ if(sum)return sum; if(part<l)return 1e9; return 0; } 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_el_7akim_elly_3ayz_yro7_IOI_w_3ayz_yakol_jilaty 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...