Language: C++

#include "bits/stdc++.h"
using namespace std;

//! snippet-holder
//! use io, root

int main() {
	cin.tie(0)->sync_with_stdio(0);
	cin.exceptions(cin.failbit);

  int n, k; read(n, k);
  vector<ll> a(n), b;
  rep(i, 0, n) read(a[i]);
  rep(l, 0, n) rep(r, l, n) {
    ll m = 0;
    rep(i, l, r + 1) m += a[i];
    b.push_back(m);
  }
 
  ll ans = 0;
  for (int i = 60; i >= 0; i--) {
    vector<ll> c;
    for (ll v : b) if (v & (1ll << i)) c.push_back(v);
    if (c.size() >= k) (ans |= 1ll << i), (b = c);
  }

  write(ans);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: invalid conversion from 'int' to 'void*' [-fpermissive]
   11 |   int n, k; read(n, k);
      |                     ^
      |                     |
      |                     int
a.cc:11:17: error: too few arguments to function 'ssize_t read(int, void*, size_t)'
   11 |   int n, k; read(n, k);
      |             ~~~~^~~~~~
In file included from /usr/include/x86_64-linux-gnu/bits/sigstksz.h:24,
                 from /usr/include/signal.h:328,
                 from /usr/include/c++/14/csignal:42,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:116,
                 from a.cc:1:
/usr/include/unistd.h:371:16: note: declared here
  371 | extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur
      |                ^~~~
a.cc:12:10: error: 'll' was not declared in this scope
   12 |   vector<ll> a(n), b;
      |          ^~
a.cc:12:12: error: template argument 1 is invalid
   12 |   vector<ll> a(n), b;
      |            ^
a.cc:12:12: error: template argument 2 is invalid
a.cc:13:7: error: 'i' was not declared in this scope
   13 |   rep(i, 0, n) read(a[i]);
      |       ^
a.cc:13:3: error: 'rep' was not declared in this scope
   13 |   rep(i, 0, n) read(a[i]);
      |   ^~~
a.cc:14:7: error: 'l' was not declared in this scope
   14 |   rep(l, 0, n) rep(r, l, n) {
      |       ^
a.cc:20:5: error: expected ';' before 'ans'
   20 |   ll ans = 0;
      |     ^~~~
      |     ;
a.cc:22:14: error: template argument 2 is invalid
   22 |     vector<ll> c;
      |              ^
a.cc:23:12: error: expected ';' before 'v'
   23 |     for (ll v : b) if (v & (1ll << i)) c.push_back(v);
      |            ^~
      |            ;
a.cc:24:5: error: expected primary-expression before 'if'
   24 |     if (c.size() >= k) (ans |= 1ll << i), (b = c);
      |     ^~
a.cc:23:55: error: expected ';' before 'if'
   23 |     for (ll v : b) if (v & (1ll << i)) c.push_back(v);
      |                                                       ^
      |                                                       ;
   24 |     if (c.size() >= k) (ans |= 1ll << i), (b = c);
      |     ~~                                                 
a.cc:24:5: error: expected primary-expression before 'if'
   24 |     if (c.size() >= k) (ans |= 1ll << i), (b = c);
      |     ^~
a.cc:23:55: error: expected ')' before 'if'
   23 |     for (ll v : b) if (v & (1ll << i)) c.push_back(v);
      |         ~                                             ^
      |                                                       )
   24 |     if (c.size() >= k) (ans |= 1ll << i), (b = c);
      |     ~~                                                 
a.cc:24:11: error: request for member 'size' in 'c', which is of non-class type 'int'
   24 |     if (c.size() >= k) (ans |= 1ll << i), (b = c);
      |           ^~~~
a.cc:24:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   24 |     if (c.size() >= k) (ans |= 1ll << i), (b = c);
      |                         ^~~
      |                         abs
a.cc:27:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   27 |   write(ans);
      |         ^~~
      |         abs