Submission #1273035

#TimeUsernameProblemLanguageResultExecution timeMemory
1273035DeathIsAweBali Sculptures (APIO15_sculpture)C++20
Compilation error
0 ms0 KiB
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define mp make_pair
#define ll long long
ll dp1[2000][2000], arr[2000], n, a, b;


ll powfunc(int a) {
    ll val = 1;
    for (int i=0;i<a;i++) {
        val *= 2;
    }
    return val;
}


bool solve(ll val) {
    if (a != 1) {
        
    } else {
        ll limit = 0, groups = 1, sum = 0;
        bool ans;
        while (limit != n) {
            sum = 0;
            ans = false;
            for (int i=limit;i<n;i++) {
                sum += arr[i];
                if ((sum & val) == sum) {
                    limit = i + 1;
                    ans = true;
                }
            }
            if (!ans) return false;
            groups += 1;
        }
        if (groups > b + 1) return false;
        return true;
    }
}

Compilation message (stderr)

sculpture.cpp: In function 'bool solve(long long int)':
sculpture.cpp:45:1: warning: control reaches end of non-void function [-Wreturn-type]
   45 | }
      | ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/crt1.o: in function `_start':
(.text+0x1b): undefined reference to `main'
collect2: error: ld returned 1 exit status