Language: C++

#include <iostream>
#include <map>
#include <vector>
#include <algorithm>

using namespace std;

typedef pair<int, int> P;
#define mp(a, b) makepair(a, b);

bool cmp(const P& a, const P&b){
  if (a.second == 0 || b.second == 0) return false;
  return a.second < b.second;
}

int main(){
  int A, B, C, D, E;
  cin >> A >> B >> C >> D >> E;
  int a = A%10, b = B%10, c = C%10, d = D%10, e = E%10;
  vector<P> v{mp(A,a), mp(B,b), mp(C,c), mp(D,d), mp(E,e)};
  sort(v.begin(), v.end(), cmp);
  int ans = 0, i = 0;
  for (auto& x : v){
    if (i == 0){
      ans += x.first;
    }else{
      if (x.second == 0) ans += x.first;
      else ans += (x.first/10+1)*10;
    }
    ++i;
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: 'makepair' was not declared in this scope
    9 | #define mp(a, b) makepair(a, b);
      |                  ^~~~~~~~
a.cc:20:15: note: in expansion of macro 'mp'
   20 |   vector<P> v{mp(A,a), mp(B,b), mp(C,c), mp(D,d), mp(E,e)};
      |               ^~
a.cc:9:32: error: expected '}' before ';' token
    9 | #define mp(a, b) makepair(a, b);
      |                                ^
a.cc:20:15: note: in expansion of macro 'mp'
   20 |   vector<P> v{mp(A,a), mp(B,b), mp(C,c), mp(D,d), mp(E,e)};
      |               ^~
a.cc:20:14: note: to match this '{'
   20 |   vector<P> v{mp(A,a), mp(B,b), mp(C,c), mp(D,d), mp(E,e)};
      |              ^
a.cc:9:32: error: no matching function for call to 'std::vector<std::pair<int, int> >::vector(<brace-enclosed initializer list>)'
    9 | #define mp(a, b) makepair(a, b);
      |                                ^
a.cc:20:15: note: in expansion of macro 'mp'
   20 |   vector<P> v{mp(A,a), mp(B,b), mp(C,c), mp(D,d), mp(E,e)};
      |               ^~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:3:
/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 = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >]'
  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 = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; allocator_type = std::allocator<std::pair<int, int> >]'
  678 |       vector(initializer_list<value_type> __l,
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:678:7: note:   conversion of argument 1 would be ill-formed:
/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 = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; std::__type_identity_t<_Alloc> = std::allocator<std::pair<int, int> >]'
  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 = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; allocator_type = std::allocator<std::pair<int, int> >; 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 = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; allocator_type = std::allocator<std::pair<int, int> >; 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 = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; std::__type_identity_t<_Alloc> = std::allocator<std::pair<int, int> >]'
  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 = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >]'
  620 |       vector(vector&&) noexcept = default;
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:620:7: note:   conversion of argument 1 would be ill-formed:
/usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >]'
  601 |       vector(const vector& __x)
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:601:7: note:   conversion of argument 1 would be ill-formed:
/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 = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; size_type = long unsigned int; value_type = std::pair<int, int>; allocator_type = std::allocator<std::pair<int, int> >]'
  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 = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; size_type = long unsigned int; allocator_type = std::allocator<std::pair<int, int> >]'
  556 |       vector(size_type __n, const allocator_type& __a = allocator_type())
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:556:7: note:   conversion of argument 1 would be ill-formed:
/usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const allocator_type&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; allocator_type = std::allocator<std::pair<int, int> >]'
  542 |       vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:542:7: note:   conversion of argument 1 would be ill-formed:
/usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector() [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >]'
  531 |       vector() = default;
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:531:7: note:   candidate expects 0 arguments, 1 provided
a.cc:20:22: error: expected primary-expression before ',' token
   20 |   vector<P> v{mp(A,a), mp(B,b), mp(C,c), mp(D,d), mp(E,e)};
      |                      ^
a.cc:20:31: error: expected primary-expression before ',' token
   20 |   vector<P> v{mp(A,a), mp(B,b), mp(C,c), mp(D,d), mp(E,e)};
      |                               ^
a.cc:20:40: error: expected primary-expression before ',' token
   20 |   vector<P> v{mp(A,a), mp(B,b), mp(C,c), mp(D,d), mp(E,e)};
      |                                        ^
a.cc:20:49: error: expected primary-expression before ',' token
   20 |   vector<P> v{mp(A,a), mp(B,b), mp(C,c), mp(D,d), mp(E,e)};
      |                                                 ^
a.cc: At global scope:
a.cc:21:7: error: expected constructor, destructor, or type conversion before '(' token
   21 |   sort(v.begin(), v.end(), cmp);
      |       ^
a.cc:23:3: error: expected unqualified-id before 'for'
   23 |   for (auto& x : v){
      |   ^~~
a.cc:32:3: error: 'cout' does not name a type
   32 |   cout << ans << endl;
      |   ^~~~
a.cc:33:1: error: expected declaration before '}' token
   33 | }
      | ^