Submission #1114057

# Submission time Handle Problem Language Result Execution time Memory
1114057 2024-11-18T07:17:40 Z Wansur Broken Device 2 (JOI22_device2) C++17
Compilation error
0 ms 0 KB
#include "Bruno.h"
#include <bits/stdc++.h>

typedef long long ll;
using namespace std;

int tk = 20;

long long Bruno(vector<int> u) {
    int n = (int) u.size();
    ll ans = 0, b = 0;
    for(int i = 0; i + 1 < (int)u.size(); i++) {
        if(u[i] == 0) {
            continue;
        }
        int fg = 0;
        for(int j = i + 1; j <= i + tk; j++) {
            fg |= u[j];
        }
        if(fg) {
            ans |= (1ll << b);
            int cnt = 0, j = i;
            while(cnt < tk) {
                j++;
                cnt += u[j];
            }
            i = j;
        }
        b++;
    }
    return ans;
}



    

Compilation message

Anna.cpp: In function 'long long int Bruno(std::vector<int>)':
Anna.cpp:10:9: warning: unused variable 'n' [-Wunused-variable]
   10 |     int n = (int) u.size();
      |         ^
/usr/bin/ld: /tmp/ccSkT4D7.o: in function `main':
grader_anna.cpp:(.text.startup+0xd2): undefined reference to `Declare()'
/usr/bin/ld: grader_anna.cpp:(.text.startup+0x1d5): undefined reference to `Anna(long long)'
collect2: error: ld returned 1 exit status

/usr/bin/ld: /tmp/ccstAUzS.o: in function `main':
grader_bruno.cpp:(.text.startup+0x3ab): undefined reference to `Bruno(std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status