Submission #523684

# Submission time Handle Problem Language Result Execution time Memory
523684 2022-02-08T04:15:44 Z Gurban Bali Sculptures (APIO15_sculpture) C++17
0 / 100
1 ms 320 KB
#include <bits/stdc++.h>
using namespace std;

using ll = long long;

const int maxn=2e3+5;
int n,A,B;
int a[maxn];

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);

	cin >> n >> A >> B;
	for(int i = 1;i <= n;i++) cin >> a[i];

	int ans = 0;
	for(int i = 30;i >= 0;i--){
		int now = ans + (1 << i) - 1;
		vector<int>dp(n + 1,1e9);
		dp[0] = 0;
		for(int j = 1;j <= n;j++){
			int sum = 0;
			for(int k = j;k >= 1;k--){
				sum += a[k];
				if((sum & now) == sum) dp[j] = dp[k - 1] + 1;
			}
		}
		if(dp[n] > B) ans += (1 << i); 
	}
	cout<<ans;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 316 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 0 ms 316 KB Output is correct
6 Incorrect 1 ms 276 KB Output isn't correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 316 KB Output is correct
2 Correct 0 ms 316 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Incorrect 0 ms 316 KB Output isn't correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Incorrect 1 ms 204 KB Output isn't correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 320 KB Output is correct
2 Correct 1 ms 296 KB Output is correct
3 Correct 1 ms 312 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Incorrect 0 ms 204 KB Output isn't correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 316 KB Output is correct
2 Correct 0 ms 312 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Incorrect 1 ms 204 KB Output isn't correct
7 Halted 0 ms 0 KB -