답안 #1028523

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1028523 2024-07-20T03:22:22 Z vjudge1 Bali Sculptures (APIO15_sculpture) C++17
0 / 100
13 ms 32088 KB
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

const int N = 2005;
int n, x, y;
ll a[N], dp[N][N];

int main(){
    memset(dp, 31, sizeof dp);
    
    cin >> n >> x >> y;
    for (int i = 1; i <= n; i ++)
        cin >> a[i], a[i] += a[i - 1], dp[i][1] = a[i];

    for (int j = 2; j <= n; j ++){
        for (int i = j; i <= n; i ++){
            for (int k = j - 1; k < i; k ++)
                dp[i][j] = min(dp[i][j], dp[k][j - 1] | (a[i] - a[k]));
        }
    }

    ll ans = 1e18;
    for (int i = x; i <= y; i ++)
        ans = min(ans, dp[n][i]);
    cout << ans << endl;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 12 ms 31836 KB Output is correct
2 Incorrect 12 ms 31832 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 12 ms 31836 KB Output is correct
2 Incorrect 13 ms 31836 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 12 ms 32088 KB Output is correct
2 Incorrect 12 ms 31720 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 11 ms 31832 KB Output is correct
2 Incorrect 10 ms 31836 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 31836 KB Output is correct
2 Incorrect 11 ms 31792 KB Output isn't correct
3 Halted 0 ms 0 KB -