# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
865159 | jk410 | Bali Sculptures (APIO15_sculpture) | C++17 | 1057 ms | 2904 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
using namespace std;
typedef long long ll;
const int MAX=40;
int N,A,B;
ll Y[2001];
bool DP[2001][2001];
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
DP[0][0]=true;
cin>>N>>A>>B;
for (int i=1; i<=N; i++){
cin>>Y[i];
Y[i]+=Y[i-1];
}
ll mask=0;
for (int t=MAX; t>=0; t--){
mask^=(1LL<<t);
for (int i=1; i<=N; i++){
for (int j=1; j<=i; j++){
DP[i][j]=false;
for (int k=0; k<i; k++)
DP[i][j]|=(DP[k][j-1]&!((Y[i]-Y[k])&mask));
}
}
bool flag=true;
for (int i=A; i<=B; i++){
if (DP[N][i]){
flag=false;
break;
}
}
if (flag)
mask^=(1LL<<t);
}
cout<<(((1LL<<MAX+1)-1)^mask);
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... |