답안 #48149

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
48149 2018-05-10T10:39:10 Z square1001 Bali Sculptures (APIO15_sculpture) C++14
0 / 100
2 ms 640 KB
#include <vector>
#include <cassert>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
	int N, A, B;
	cin >> N >> A >> B;
	assert(A == 1);
	vector<int> v(N);
	for (int i = 0; i < N; i++) cin >> v[i];
	long long ret = 0;
	for (int i = 40; i >= 0; i--) {
		vector<int> dp(N + 1, 1 << 30);
		dp[0] = 0;
		for (int j = 1; j <= N; j++) {
			long long cur = 0;
			for (int k = j - 1; k >= 0; k--) {
				cur += v[k];
				if (((cur >> (i + 1)) | ret) == ret && !((cur >> i) & 1)) {
					dp[j] = min(dp[j], dp[k]);
				}
			}
		}
		ret <<= 1;
		if (dp[N] > B) ret++;
	}
	cout << ret << '\n';
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 248 KB Output is correct
2 Correct 2 ms 484 KB Output is correct
3 Correct 2 ms 484 KB Output is correct
4 Correct 2 ms 484 KB Output is correct
5 Incorrect 2 ms 488 KB Output isn't correct
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 488 KB Output is correct
2 Correct 2 ms 500 KB Output is correct
3 Correct 2 ms 640 KB Output is correct
4 Correct 2 ms 640 KB Output is correct
5 Incorrect 2 ms 640 KB Output isn't correct
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 640 KB Output is correct
2 Correct 2 ms 640 KB Output is correct
3 Correct 2 ms 640 KB Output is correct
4 Correct 2 ms 640 KB Output is correct
5 Incorrect 2 ms 640 KB Output isn't correct
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 640 KB Output is correct
2 Correct 2 ms 640 KB Output is correct
3 Correct 2 ms 640 KB Output is correct
4 Correct 2 ms 640 KB Output is correct
5 Incorrect 2 ms 640 KB Output isn't correct
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 640 KB Output is correct
2 Correct 2 ms 640 KB Output is correct
3 Correct 2 ms 640 KB Output is correct
4 Correct 2 ms 640 KB Output is correct
5 Incorrect 2 ms 640 KB Output isn't correct
6 Halted 0 ms 0 KB -