Submission #161912

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1619122019-11-05 09:49:57impriBali Sculptures (APIO15_sculpture)C++14
0 / 100
4 ms504 KiB
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n,a,b;
int y[101];
int sum[101][101];
int dp[101][101];
int get(int num,int r){
if(num==1)return y[1];
int res=sum[1][num];
if(r==1)return res;
if(dp[num][r]>=0)return dp[num][r];
for(int i=1;i<num;i++)
res=min(res,get(i,r-1)|sum[i+1][num]);
return dp[num][r]=res;
}
int main()
{ cout <<fixed;cout.precision(12);cin.tie(0);
ios_base::sync_with_stdio(false);
memset(dp,-1,sizeof(dp));
cin >> n >> a >> b;
for(int i=1;i<=n;i++)
cin >> y[i];
for(int i=1;i<=n;i++){
int r=0;
for(int j=i;j<=n;j++){
r+=y[j];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#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...