답안 #602861

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
602861 2022-07-23T11:52:53 Z Fidan Bali Sculptures (APIO15_sculpture) C++17
0 / 100
1 ms 296 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll inf=(1e18)+10;
int main(){
	ll n, a, b, i, j, h;
	cin>>n>>a>>b;
	vector<ll> v(n+1, 0);
	for(i=1; i<=n; i++){
		cin>>v[i];
	}
	vector<vector<ll>> dp(n+1, vector<ll>(b+1, inf));
	vector<ll> pre(n+1, 0);
	for(i=1; i<=n; i++){
		pre[i]=pre[i-1]+v[i];
	}
	for(i=1; i<=n; i++){
		dp[i][1]=pre[i];
	}
	for(i=1; i<=n; i++){
		for(j=1; j<=b; j++){
			for(h=1; h<=i; h++){
				if(dp[h][j-1]==inf) continue;
				dp[i][j]=min(dp[i][j], (dp[h][j-1] | (pre[i]-pre[h])));
			}
		}
	}
	cout<<dp[n][b];
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 1 ms 296 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -