Submission #132133

#TimeUsernameProblemLanguageResultExecution timeMemory
132133Tuk1352Bali Sculptures (APIO15_sculpture)C++11
0 / 100
2 ms380 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n, A, B; cin >> n >> A >> B; int a[n], D[n+1], S[n+1]; S[0] = 0; for (int i = 1; i <= n; i++) { D[i] = 2000000000; cin >> a[i-1]; S[i] = S[i-1] + a[i-1]; } D[0] = 0; for (int i = 1; i <= n; i++) { for (int y = A; y <= B; y++) { if (i-y >= 0) { D[i] = min(D[i], D[i-y] | (S[i]-S[i-y])); } } } cout << D[n]; return 0; }
#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...