Submission #1031343

#TimeUsernameProblemLanguageResultExecution timeMemory
1031343_8_8_Bali Sculptures (APIO15_sculpture)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 2e3 + 21, MOD = (int)1e9+7; #define int ll int n,a,b,x[N],dp[N]; void test() { cin >> n >> a >> b; for(int i = 1;i <= n;i++) { cin >> x[i]; } ll cur = 0,res = 0; for(ll c = 41;c >= 0;c--){ for(int i = 1;i <= n;i++){ dp[i] = 1e9; } cur += (1ll << c); for(int i = 1;i <= n;i++){ ll s = 0; for(int j = i;j >= 1;j--){ s += x[j]; if((s & cur) == 0) { dp[i] = min(dp[i],dp[j - 1] + 1); } } } if(dp[n] == (int)1e9){ cur -= (1ll << c); res += (1ll << c); } } cout << res; } int main() { ios_base::sync_with_stdio(false);cin.tie(0); int t = 1; // cin >> t; while(t--) { test(); } }

Compilation message (stderr)

sculpture.cpp:8:13: error: '::main' must return 'int'
    8 | #define int ll
      |             ^~
sculpture.cpp:38:1: note: in expansion of macro 'int'
   38 | int main() {
      | ^~~