# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
584723 | 2022-06-27T22:22:56 Z | sofapuden | Bali Sculptures (APIO15_sculpture) | C++14 | 1 ms | 212 KB |
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int mxN = 2e3+5; ll n, a, b, v[mxN], pre[mxN]; bool g1(ll mask){ vector<int> dp(n+1, mxN); dp[0] = 0; for(int i = 1; i <= n; ++i){ for(int j = 0; j < i; ++j){ if((mask|(pre[i]-pre[j])) == mask)dp[i] = min(dp[i],dp[j]+1); } } return dp[n] <= b; } bool g2(ll mask){ } int main(){ cin >> n >> a >> b; pre[0] = 0; for(int i = 1; i <= n; ++i)cin >> v[i], pre[i] = pre[i-1] + v[i]; ll ans = (1ll<<50)-1; for(int i = 49; ~i; --i){ if(a == 1 && g1(ans^(1ll<<i)))ans^=(1<<i); if(a > 1 && g2(ans^(1ll<<i)))ans^=(1<<i); } cout << ans << '\n'; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |