Submission #127618

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1276182019-07-09 16:41:02MohamedAhmed04Bali Sculptures (APIO15_sculpture)C++14
100 / 100
172 ms9592 KiB
#include <bits/stdc++.h>
using namespace std;
const int MAX = 2005 ;
const int MAX2 = 105 ;
long long arr[MAX] , pref[MAX];
long long dp[MAX2][MAX2][MAX2] ;
long long dp2[MAX];
int n , a , b ;
long long now = 0 ;
long long bit1 = 0 , bit2 = 0;
long long calc1(int idx , int st , int groups)
{
if(idx == n && groups >= a && groups <= b)
{
long long val ;
if(st == 0)
val = pref[idx-1] ;
else
val = pref[idx-1] - pref[st-1] ;
if(!((val & bit1)))
return val ;
return (1ll << 58) ;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

sculpture.cpp: In function 'long long int calc1(int, int, int)':
sculpture.cpp:34:17: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
     if(idx == n && groups < a || groups > b)
        ~~~~~~~~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...