# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
14387 | woqja125 | Bali Sculptures (APIO15_sculpture) | C++14 | 827 ms | 8944 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<stdio.h>
#include<string.h>
int y[2001];
long long s[2001];
bool t1[2001][2001];
bool t2[2001][2001];
long long min(long long a, long long b){if(a<b)return a; return b;}
bool chk();
int n, a, b;
int main()
{
int i, j;
scanf("%d%d%d", &n, &a, &b);
for(i=1; i<=n; i++)scanf("%d", y+i);
for(i=1; i<=n; i++) s[i] = s[i-1] + y[i];
for(i=1; i<=n; i++)for(j=i; j<=n; j++) t1[i][j] = true;
long long ans = 0;
for(int B=50; B>=0; B--)
{
for(i=1; i<=n; i++)for(j=1; j<=n; j++) t2[i][j] = t1[i][j];
for(i=1; i<=n; i++) for(j=i; j<=n; j++) if( ((s[j] - s[i-1])&(1ll<<B)) != 0 ) t2[i][j] = false;
if(chk())
{
for(i=1; i<=n; i++)for(j=1; j<=n; j++) t1[i][j] = t2[i][j];
}
else ans += (1ll<<B);
}
printf("%lld\n", ans);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |