# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
838951 | drkarlicio2107 | Bali Sculptures (APIO15_sculpture) | C++14 | 67 ms | 8668 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
long long int dp [50][210][210];
long long int l [2010];
long long int pref [210];
int main (){
int n, gra, grb; cin >> n >> gra >> grb;
for (int i=0; i<n; i++) cin >> l [i];
pref [0]=l [0];
for (int i=1; i<n; i++) pref [i]=pref [i-1]+l [i];
long long int ans=0;
for (long long int b=49; b>=0; b--){
for (int i=0; i<n; i++){
for (int j=0; j<n+1; j++){
if ((((ans >> b) | ((pref [i])>>b)) == (ans >> b))) dp [b][i][1]=1;
for (int k=i-1; k>=0; k--){
if ((((ans >> b) | ((pref [i]-pref [k])>>b)) == (ans >> b))) dp [b][i][j]=max (dp [b][i][j], dp [b][k][j-1]);
}
}
}
int da=0;
for (int i=gra; i<=grb; i++) if (dp [b][n-1][i]) da=1;
if (!da) ans|=((long long)1<<b);
}
cout << ans << endl;
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... |