Submission #42102

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
421022018-02-22 13:34:53minchurlBali Sculptures (APIO15_sculpture)C++11
100 / 100
249 ms876 KiB
#include<bits/stdc++.h>
#define MAX_N 2005
#define inf (1LL<<62)
#define LL long long
using namespace std;
LL n,a,b,ans,arr[MAX_N];
LL t[MAX_N];
bool ct[MAX_N][MAX_N];
bool case1(LL x){
LL i,j,sum,test,y,z,k,l;
bool p=false;
y=inf-1;y-=(1LL<<x)-1;
z=ans&y;
for(i=0;i<=n;i++) for(j=0;j<=n;j++) ct[i][j]=false;
ct[0][0]=true;
for(l=1;l<=b;l++){
for(i=1;i<=n;i++){
sum=0;
for(j=i;j>=1;j--){
sum+=arr[j];
k=sum&y;
if((z|k)==z) ct[l][i]|=ct[l-1][j-1];
}
if(l>=a) p|=ct[l][n];
}
}
return p;
}
bool is_ok(LL x){
LL i,j,sum,test,y,z,k;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

sculpture.cpp: In function 'bool case1(long long int)':
sculpture.cpp:10:13: warning: unused variable 'test' [-Wunused-variable]
  LL i,j,sum,test,y,z,k,l;
             ^
sculpture.cpp: In function 'bool is_ok(long long int)':
sculpture.cpp:30:13: warning: unused variable 'test' [-Wunused-variable]
  LL i,j,sum,test,y,z,k;
             ^
sculpture.cpp: In function 'int main()':
sculpture.cpp:46:7: warning: unused variable 'x' [-Wunused-variable]
  LL i,x;
       ^
sculpture.cpp:47:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%lld",&n);
                  ^
sculpture.cpp:48:26: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%lld %lld",&a,&b);
                          ^
sculpture.cpp:49:41: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for(i=1;i<=n;i++) scanf("%lld",&arr[i]);
                                         ^
#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...