Submission #110283

# Submission time Handle Problem Language Result Execution time Memory
110283 2019-05-10T13:10:57 Z tc_abd Bali Sculptures (APIO15_sculpture) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
ll n,a,b,arr[59];
ll dp[59][509];
ll bt(ll id,ll sum,ll curr,ll flag,bool flag2){
    if(id == n){
        if(flag < a || flag > b || !flag2) return 1000000009;
        return curr;
    }
    ll &ret = dp[id][sum];
    if(ret != -1) return ret;
    ret = 1000000009;
    sum += arr[id];
    ret = min(ret,bt(id+1,sum,curr,flag,0));
    curr |= sum;
    ret = min(ret,bt(id+1,0,curr,flag+1,1));
    return ret;
}
int main(){
    cin>>n>>a>>b;
    for(int i=0;i<n;i++) cin>>arr[i];
    memset(dp,-1,sizeof(dp));
    cout<<bt(0,0,0,0,0)<<endl;
}

Compilation message

sculpture.cpp:3:1: error: 'll' does not name a type
 ll n,a,b,arr[59];
 ^~
sculpture.cpp:4:1: error: 'll' does not name a type
 ll dp[59][509];
 ^~
sculpture.cpp:5:1: error: 'll' does not name a type
 ll bt(ll id,ll sum,ll curr,ll flag,bool flag2){
 ^~
sculpture.cpp: In function 'int main()':
sculpture.cpp:20:10: error: 'n' was not declared in this scope
     cin>>n>>a>>b;
          ^
sculpture.cpp:20:10: note: suggested alternative: 'yn'
     cin>>n>>a>>b;
          ^
          yn
sculpture.cpp:20:13: error: 'a' was not declared in this scope
     cin>>n>>a>>b;
             ^
sculpture.cpp:20:16: error: 'b' was not declared in this scope
     cin>>n>>a>>b;
                ^
sculpture.cpp:21:31: error: 'arr' was not declared in this scope
     for(int i=0;i<n;i++) cin>>arr[i];
                               ^~~
sculpture.cpp:22:12: error: 'dp' was not declared in this scope
     memset(dp,-1,sizeof(dp));
            ^~
sculpture.cpp:23:11: error: 'bt' was not declared in this scope
     cout<<bt(0,0,0,0,0)<<endl;
           ^~