제출 #542116

#제출 시각아이디문제언어결과실행 시간메모리
542116T0p_Bali Sculptures (APIO15_sculpture)C++14
0 / 100
1 ms212 KiB
#include <bits/stdc++.h>
using namespace std;

const int N = 2e3 + 10;

long long dp[N][N];

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=i ; k<=j ; 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;
}

컴파일 시 표준 에러 (stderr) 메시지

sculpture.cpp: In function 'int main()':
sculpture.cpp:11:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |     scanf(" %d %d %d",&n,&a,&b);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~
sculpture.cpp:15:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |         scanf(" %lld",&dp[1][i]);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~
#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...