# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
213799 | DodgeBallMan | Bali Sculptures (APIO15_sculpture) | C++14 | 260 ms | 544 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define long long long
using namespace std;
const int N = 2e3 + 10;
long mx[N], mn[N], a[N], ans;
int n, l, r;
int main()
{
scanf("%d %d %d",&n,&l,&r);
for( int i = 1 ; i <= n ; i++ ) scanf("%d",&a[i]);
for( int bit = 61 ; bit >= 0 ; bit-- ) {
for( int i = 1 ; i <= n ; i++ ) {
long sum = 0;
mx[i] = -1e9, mn[i] = 1e9;
for( int j = i ; j >= 1 ; j-- ) {
sum += a[j];
if( sum - ( sum & ans ) < ( 1ll << bit ) && mn[j-1] + 1 <= r ) mn[i] = min( mn[i], mn[j-1] + 1 ), mx[i] = max( mx[i], mx[j-1] + 1 );
}
}
if( mn[n] > r || mx[n] < l ) ans |= ( 1ll << bit );
}
printf("%lld",ans);
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |