답안 #400512

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
400512 2021-05-08T08:36:40 Z T0p_ Bali Sculptures (APIO15_sculpture) C++14
0 / 100
1 ms 308 KB
#include <bits/stdc++.h>
using namespace std;

long long dp[2020][2020];

int main()
{
	int n, a, b;
	scanf(" %d %d %d",&n,&a,&b);
	for(int i=1 ; i<=n ; i++)
	{
		scanf(" %lld",&dp[1][i]);
		dp[1][i] += dp[1][i-1];
	}
	for(int i=2 ; i<=b ; i++)
		for(int j=i ; j<=n ; j++)
		{
			dp[i][j] = 1e18;
			for(int k=j ; k>=i ; k--)
				dp[i][j] = min(dp[i][j], dp[i-1][k-1] | (dp[1][j] - dp[1][k-1]));
		}
	long long ans = 1e18;
	for(int i=a ; i<=b ; i++)
		ans = min(ans, dp[i][n]);
	printf("%lld\n",ans);
	return 0;
}

Compilation message

sculpture.cpp: In function 'int main()':
sculpture.cpp:9:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    9 |  scanf(" %d %d %d",&n,&a,&b);
      |  ~~~~~^~~~~~~~~~~~~~~~~~~~~~
sculpture.cpp:12:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   12 |   scanf(" %lld",&dp[1][i]);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 308 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 224 KB Output is correct
2 Incorrect 1 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -