| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 489708 | mdn2002 | Bali Sculptures (APIO15_sculpture) | C++14 | 1087 ms | 16096 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
int n , a , b , y [2003] , dp [2003][2003];
long long mask;
bool f ( int x , int num )
{
if ( x == n )
{
if ( a <= num && num <= b ) return 1;
return 0;
}
if ( dp [x][num] != -1 ) return dp [x][num];
bool ans = 0;
long long sum = 0;
for ( int i = x ; i < n ; i ++ )
{
sum += y [i];
if ( ( mask | sum ) > mask ) continue;
ans = max ( ans , f ( i + 1 , num + 1 ) );
}
return dp [x][num] = ans;
}
bool ck ( )
{
memset ( dp , -1 , sizeof dp );
return f ( 0 , 0 );
}
int main()
{
//freopen ( "fence8.in" , "r" , stdin );
//freopen ( "fence8.out" , "w" , stdout );
scanf ( "%d%d%d" , &n , &a , &b );
for ( int i = 0 ; i < n ; i ++ ) scanf ( "%d" , &y [i] );
mask = ( 1ll << 50 ) - 1;
for ( int i = 49 ; i >= 0 ; i -- )
{
mask ^= ( 1ll << i );
if ( ck ( ) == 0 ) mask ^= ( 1ll << i );
}
printf ( "%lld" , mask );
}
컴파일 시 표준 에러 (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... | ||||
