Language: C++

// Author : SAGORIKA DAS
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define CLEAR(a) memset(a,0,sizeof a)
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define fr freopen("input.txt", "r", stdin);
#define fw freopen("output.txt", "w", stdout);
#define int long long 
typedef long long LL;
typedef pair<int,int> pii;
const int MOD = 1e9 + 7;
const int MAX = 1e5 + 5;
string s;
    
int eval(int i, int j){
  int ret = 0;
  for(int k=i;k<=j;k++){
    ret = ret*10 + (s[k]-'0');
  }
  return ret;
}

 main() {
    //fr;fw;
    cin >> s;
    int ret = 0;
    for(int i=0;i<s.size();i++){
      for(int j=i;j<s.size();j++){
        int val = eval(i,j);
        ret += val*(pow(2,max(i-1,0LL)))*(pow(2,max(0LL,s.size()-2-j)));
      }
    }
    cout << ret;
    return 0;
}

Compiler output:
a.cc:28:2: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   28 |  main() {
      |  ^~~~
a.cc: In function 'int main()':
a.cc:35:52: error: no matching function for call to 'max(long long int, long long unsigned int)'
   35 |         ret += val*(pow(2,max(i-1,0LL)))*(pow(2,max(0LL,s.size()-2-j)));
      |                                                 ~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:35:52: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long long unsigned int')
   35 |         ret += val*(pow(2,max(i-1,0LL)))*(pow(2,max(0LL,s.size()-2-j)));
      |                                                 ~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:35:52: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   35 |         ret += val*(pow(2,max(i-1,0LL)))*(pow(2,max(0LL,s.size()-2-j)));
      |                                                 ~~~^~~~~~~~~~~~~~~~~~