# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
129350 | 2019-07-12T04:35:29 Z | ksmzzang2003 | Bali Sculptures (APIO15_sculpture) | C++14 | 2 ms | 376 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; int N,A,B; vector <ll> arr,psum; ll f(int i,int j) { if(j==1) return psum[i]; ll ret = 1987654321*1987654321; for(int k = 0;k<i;k++) ret = min(ret,f(k,j-1)|(psum[i]-psum[k])); return ret; } int main() { scanf("%d %d %d",&N,&A,&B); arr.resize(N); psum.resize(N); for(int i=0;i<N;i++) scanf("%lld",&arr[i]); psum[0] = arr[0] ; for(int i=1;i<N;i++) psum[i] = psum[i-1] + arr[i]; ll ans = 1987654321*1987654321; for(int i=A;i<=B;i++) ans = min(ans,f(N-1,i)); printf("%lld",ans); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Incorrect | 2 ms | 376 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Incorrect | 2 ms | 376 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Incorrect | 2 ms | 256 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Incorrect | 2 ms | 376 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Incorrect | 2 ms | 376 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |