Language: C++

#include<bits/stdc++.h>
using namespace std;
using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
using pqueg = priority_queue<int, vector<int>, greater<int>>;
using pquel = priority_queue<int, vector<int>, less<int>>;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
int lcm(int a, int b){
  return a / __gcd(a, b) * b;
}
int r_int(int a, int b){
  return rand() % b + a;
}
const lint mod=1e9+7;

map<lint, lint> kill;

lint attack(lint h){
  if(h == 1) kill[1] = 1;
  if(kill.find(h/2) != end(kill)){
    return kill[h/2]*2;
  }else{
    return attack(h/2)*2;
  }
}

int main()
{
  lint h;
  cin >> h;

  lint cnt = 0, sum = 1;
  while(h != 1){
    h /= 2;
    cnt ++;
    sum += pow(2,cnt);
  }

  cout << sum << "\n";
  return 0;
}


Compiler output:
a.cc:23:17: error: 'std::map<long long int, long long int> kill' redeclared as different kind of entity
   23 | map<lint, lint> kill;
      |                 ^~~~
In file included 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/signal.h:112:12: note: previous declaration 'int kill(__pid_t, int)'
  112 | extern int kill (__pid_t __pid, int __sig) __THROW;
      |            ^~~~
a.cc: In function 'lint attack(lint)':
a.cc:26:20: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   26 |   if(h == 1) kill[1] = 1;
      |                    ^
a.cc:26:22: error: assignment of read-only location '*(kill + 1)'
   26 |   if(h == 1) kill[1] = 1;
      |              ~~~~~~~~^~~
a.cc:27:11: error: request for member 'find' in 'kill', which is of non-class type 'int(__pid_t, int) noexcept' {aka 'int(int, int) noexcept'}
   27 |   if(kill.find(h/2) != end(kill)){
      |           ^~~~
a.cc:27:27: error: no matching function for call to 'end(int (&)(__pid_t, int) noexcept)'
   27 |   if(kill.find(h/2) != end(kill)){
      |                        ~~~^~~~~~
In file included from /usr/include/c++/14/bits/algorithmfwd.h:39,
                 from /usr/include/c++/14/bits/stl_algo.h:59,
                 from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/initializer_list:99:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
   99 |     end(initializer_list<_Tp> __ils) noexcept
      |     ^~~
/usr/include/c++/14/initializer_list:99:5: note:   template argument deduction/substitution failed:
a.cc:27:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'int (*)(__pid_t, int) noexcept' {aka 'int (*)(int, int) noexcept'}
   27 |   if(kill.find(h/2) != end(kill)){
      |                        ~~~^~~~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/range_access.h:74:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)'
   74 |     end(_Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:74:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/range_access.h: In substitution of 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&) [with _Container = int(int, int) noexcept]':
a.cc:27:27:   required from here
   27 |   if(kill.find(h/2) != end(kill)){
      |                        ~~~^~~~~~
/usr/include/c++/14/bits/range_access.h:74:48: error: request for member 'end' in '__cont', which is of non-class type 'int(int, int) noexcept'
   74 |     end(_Container& __cont) -> decltype(__cont.end())
      |                                         ~~~~~~~^~~
/usr/include/c++/14/bits/range_access.h:85:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)'
   85 |     end(const _Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:85:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/range_access.h: In substitution of 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&) [with _Container = int(int, int) noexcept]':
a.cc:27:27:   required from here
   27 |   if(kill.find(h/2) != end(kill)){
      |                        ~~~^~~~~~
/usr/include/c++/14/bits/range_access.h:85:54: error: request for member 'end' in '__cont', which is of non-class type 'int(int, int) noexcept'
   85 |     end(const _Container& __cont) -> decltype(__cont.end())
      |                                               ~~~~~~~^~~
/usr/include/c++/14/bits/range_access.h:106:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])'
  106 |     end(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~
/usr/include/c++/14/bits/range_access.h:106:5: note:   template argument deduction/substitution failed:
a.cc:27:27: note:   mismatched types '_Tp [_Nm]' and 'int(__pid_t, int) noexcept' {aka 'int(int, int) noexcept'}
   27 |   if(kill.find(h/2) != end(kill)){
      |                        ~~~^~~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/valarray:1249:5: note: candidate: 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)'
 1249 |     end(valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/valarray:1249:5: note:   template argument deduction/substitution failed:
a.cc:27:27: note:   mismatched types 'std::valarray<_Tp>' and 'int(__pid_t, int) noexcept' {aka 'int(int, int) noexcept'}
   27 |   if(kill.find(h/2) != end(kill)){
      |                        ~~~^~~~~~
/usr/include/c++/14/valarray:1265:5: note: candidate: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/valarray:1265:5: note:   template argument deduction/substitution failed:
a.cc:27:27: note:   mismatched types 'const std::valarray<_Tp>' and 'int(__pid_t, int) noexcept' {aka 'int(int, int) noexcept'}
   27 |   if(kill.find(h/2) != end(kill)){
      |                        ~~~^~~~~~
a.cc:28:20: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   28 |     return kill[h/2]*2;
      |                    ^
a.cc:28:21: error: invalid operands of types 'int(__pid_t, int) noexcept' {aka 'int(int, int) noexcept'} and 'int' to binary 'operator*'
   28 |     return kill[h/2]*2;
      |            ~~~~~~~~~^~
      |                    | |
      |                    | int
      |                    int(__pid_t, int) noexcept {aka int(int, int) noexcept}