Submission #1028559

# Submission time Handle Problem Language Result Execution time Memory
1028559 2024-07-20T04:33:11 Z vjudge1 Bali Sculptures (APIO15_sculpture) C++17
0 / 100
0 ms 348 KB
#include <bits/stdc++.h>

using namespace std;

int main()
{
	int n,A,B;
	cin>>n>>A>>B;
	int a[n], dp[n][B], su=0;
	for (int i=0;i<n;i++)
		for (int j=0;j<B;j++)
			dp[i][j]=2e9;
	for (int i=0;i<n;i++)
		cin>>a[i],su+=a[i],dp[i][0]=su;
	for (int len=1;len<B;len++)
		for (int i=len;i<n;i++)
		{
			su=0;
			for (int j=i;j>len-1;j--)
				su+=a[j],dp[i][len]=min(dp[i][len],su|dp[j-1][len-1]);
		}
	int ans=2e9;
	for (int i=A-1;i<B;i++)
		ans=min(ans,dp[n-1][i]);
	cout<<ans<<endl;
	
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -