Language: C++

#include <bits/stdc++.h>
using namespace std;
int MOD = 1000000007;
struct mint {
  long long x;
  mint(long long x=0):x(x%MOD){}
  mint& operator+=(const mint a) { if ((x+=a.x)>=MOD) x-=MOD; return *this; }
  mint& operator-=(const mint a) { if ((x+=MOD-a.x)>=MOD) x-=MOD; return *this; }
  mint& operator*=(const mint a) { (x*=a.x)%=MOD; return *this; }
  mint operator+(const mint a) const { mint res(*this); return res+=a; }
  mint operator-(const mint a) const { mint res(*this); return res-=a; }
  mint operator*(const mint a) const { mint res(*this); return res*=a; }
  mint operator++() { return *this=mint(x+1); }
  mint operator--() { return *this=mint(x-1); }
};
#define int mint

#define FOR(i,m,n) for(int i=(m);i<(n);++i)
typedef vector<int> vi;
//inline int in() { int x; cin >> x; return x; }
inline int in() { int x; scanf("%d",&x); return x;}
void solve() {
  int n = in(), m = 0;
  vi v(n); for (auto &i : v) i = in();
  FOR(i,0,60) {
    int odd = 0, even = 0;
    for (auto j : v) (((j>>i)&1) ? odd : even)++;
    int k = (int)1 << i;
    k %= MOD;
    k *= (odd*even) % MOD;
    m += k;
    m %= MOD;
  }
  cout << m << endl;
}

#undef int
int main() {
  solve();
  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:24:9: error: no matching function for call to 'std::vector<mint>::vector(mint&)'
   24 |   vi v(n); for (auto &i : v) i = in();
      |         ^
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate: 'template<class _InputIterator, class> std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) [with <template-parameter-2-2> = _InputIterator; _Tp = mint; _Alloc = std::allocator<mint>]'
  707 |         vector(_InputIterator __first, _InputIterator __last,
      |         ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:707:9: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:678:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = mint; _Alloc = std::allocator<mint>; allocator_type = std::allocator<mint>]'
  678 |       vector(initializer_list<value_type> __l,
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:678:43: note:   no known conversion for argument 1 from 'mint' to 'std::initializer_list<mint>'
  678 |       vector(initializer_list<value_type> __l,
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, std::__type_identity_t<_Alloc>&) [with _Tp = mint; _Alloc = std::allocator<mint>; std::__type_identity_t<_Alloc> = std::allocator<mint>]'
  659 |       vector(vector&& __rv, const __type_identity_t<allocator_type>& __m)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:659:7: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&, std::false_type) [with _Tp = mint; _Alloc = std::allocator<mint>; allocator_type = std::allocator<mint>; std::false_type = std::false_type]'
  640 |       vector(vector&& __rv, const allocator_type& __m, false_type)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:640:7: note:   candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&, std::true_type) [with _Tp = mint; _Alloc = std::allocator<mint>; allocator_type = std::allocator<mint>; std::true_type = std::true_type]'
  635 |       vector(vector&& __rv, const allocator_type& __m, true_type) noexcept
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:635:7: note:   candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&, std::__type_identity_t<_Alloc>&) [with _Tp = mint; _Alloc = std::allocator<mint>; std::__type_identity_t<_Alloc> = std::allocator<mint>]'
  624 |       vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:624:7: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&) [with _Tp = mint; _Alloc = std::allocator<mint>]'
  620 |       vector(vector&&) noexcept = default;
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:620:14: note:   no known conversion for argument 1 from 'mint' to 'std::vector<mint>&&'
  620 |       vector(vector&&) noexcept = default;
      |              ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = mint; _Alloc = std::allocator<mint>]'
  601 |       vector(const vector& __x)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:601:28: note:   no known conversion for argument 1 from 'mint' to 'const std::vector<mint>&'
  601 |       vector(const vector& __x)
      |              ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const value_type&, const allocator_type&) [with _Tp = mint; _Alloc = std::allocator<mint>; size_type = long unsigned int; value_type = mint; allocator_type = std::allocator<mint>]'
  569 |       vector(size_type __n, const value_type& __value,
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:569:7: note:   candidate expects 3 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:556:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const allocator_type&) [with _Tp = mint; _Alloc = std::allocator<mint>; size_type = long unsigned int; allocator_type = std::allocator<mint>]'
  556 |       vector(size_type __n, const allocator_type& __a = allocator_type())
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:556:24: note:   no known conversion for argument 1 from 'mint' to 'std::vector<mint>::size_type' {aka 'long unsigned int'}
  556 |       vector(size_type __n, const allocator_type& __a = allocator_type())
      |              ~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const allocator_type&) [with _Tp = mint; _Alloc = std::allocator<mint>; allocator_type = std::allocator<mint>]'
  542 |       vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:542:36: note:   no known conversion for argument 1 from 'mint' to 'const std::vector<mint>::allocator_type&' {aka 'const std::allocator<mint>&'}
  542 |       vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
      |              ~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector() [with _Tp = mint; _Alloc = std::allocator<mint>]'
  531 |       vector() = default;
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:531:7: note:   candidate expects 0 arguments, 1 provided
a.cc:18:35: error: no match for 'operator<' (operand types are 'mint' and 'int')
   18 | #define FOR(i,m,n) for(int i=(m);i<(n);++i)
      |                                   ^~~~
a.cc:25:3: note: in expansion of macro 'FOR'
   25 |   FOR(i,0,60) {
      |   ^~~
In file included from /usr/include/c++/14/regex:68,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181:
/usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
 1143 |     operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1143:5: note:   template argument deduction/substitution failed:
a.cc:18:38: note:   'mint' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
   18 | #define FOR(i,m,n) for(int i=(m);i<(n);++i)
      |                                      ^
a.cc:25:3: note: in expansion of macro 'FOR'
   25 |   FOR(i,0,60) {
      |   ^~~
/usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
 1224 |     operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1224:5: note:   template argument deduction/substitution failed:
a.cc:18:38: note:   'mint' is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
   18 | #define FOR(i,m,n) for(int i=(m);i<(n);++i)
      |                                      ^
a.cc:25:3: note: in expansion of macro 'FOR'
   25 |   FOR(i,0,60) {
      |   ^~~
/usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
 1317 |     operator<(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1317:5: note:   template argument deduction/substitution failed:
a.cc:18:38: note:   'mint' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
   18 | #define FOR(i,m,n) for(int i=(m);i<(n);++i)
      |                                      ^
a.cc:25:3: note: in expansion of macro 'FOR'
   25 |   FOR(i,0,60) {
      |   ^~~
/usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
 1391 |     operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1391:5: note:   template argument deduction/substitution failed:
a.cc:18:38: note:   mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
   18 | #define FOR(i,m,n) for(int i=(m);i<(n);++i)
      |                                      ^
a.cc:25:3: note: in expansion of macro 'FOR'
   25 |   FOR(i,0,60) {
      |   ^~~
/usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
 1485 |     operator<(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1485:5: note:   template argument deduction/substitution failed:
a.cc:18:38: note:   'mint' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
   18 | #define FOR(i,m,n) for(int i=(m);i<(n);++i)
      |                                      ^
a.cc:25:3: note: in expansion of macro 'FOR'
   25 |   FOR(i,0,60) {
      |   ^~~
/usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
 1560 |     operator<(typename iterator_traits<_Bi_iter>::value_type const&