Language: C++

/**
 * Created by hiramekun at 20:53 on 2020-04-26.
 */
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using vb = vector<bool>;
using P = pair<ll, ll>;
template<typename T> using pq = priority_queue<T>;
template<typename T> using minpq = priority_queue<T, vector<T>, greater<T>>;
template<typename T, typename K> using ump = unordered_map<T, K>;
const ll dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll mod = 1000000007;
const ll inf = ll(1e9);
const ll e5 = ll(1e5);
const ll ll_inf = ll(1e9) * ll(1e9);

#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for(ll i = ll(n - 1); i >= 0; i--)
#define each(i, mp) for(auto& i:mp)
#define eb emplace_back
#define F first
#define S second
#define all(obj) (obj).begin(), (obj).end()

template<class T>
ostream &operator<<(ostream &out, const vector<T> &list) {
    ll n = list.size();
    rep(i, n) out << list[i] << ' ';
    return out;
}

template<class T>
istream &operator>>(istream &in, vector<T> &list) {
    ll n = list.size();
    rep(i, n) in >> list[i];
    return in;
}

template<class T>
ostream &operator<<(ostream &out, const vector<vector<T>> &list) {
    ll n = list.size();
    rep(i, n) out << list[i] << '\n';
    return out;
}

/* ------------- ANSWER ------------- */
/* ---------------------------------- */

void solve() {
    string s;
    cin >> s;

    ump<ll, ll> mp;
    ll now = 0;
    ll ans = 0;
    rep(i, s.size()) {
        now = now * 10 + (s[i] - '0');
        now %= 2019;
        ump<ll, ll> tmp;
        each(e, mp) {
            mp[(e.F * 10 + (s[i] - '0')) % 2019]++;
            tmp[(e.F * 10 + (s[i] - '0')) % 2019] = mp[(e.F * 10 + (s[i] - '0')) % 2019];
        }
        mp[now]++;
        tmp[now] = mp[now];
        ans += tmp[0];

        mp = map<ll, ll>(all(tmp));
    }
    cout << ll(sqrt(ans)) << '\n';
}

int main() {
#ifdef MY_DEBUG
    while (true) {
#endif
        solve();
#ifdef MY_DEBUG
    }
#endif
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:73:34: error: no match for 'operator=' (operand types are 'ump<long long int, long long int>' {aka 'std::unordered_map<long long int, long long int, std::hash<long long int>, std::equal_to<long long int>, std::allocator<std::pair<const long long int, long long int> > >'} and 'std::map<long long int, long long int>')
   73 |         mp = map<ll, ll>(all(tmp));
      |                                  ^
In file included from /usr/include/c++/14/unordered_map:41,
                 from /usr/include/c++/14/functional:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:4:
/usr/include/c++/14/bits/unordered_map.h:279:7: note: candidate: 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(const std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&) [with _Key = long long int; _Tp = long long int; _Hash = std::hash<long long int>; _Pred = std::equal_to<long long int>; _Alloc = std::allocator<std::pair<const long long int, long long int> >]'
  279 |       operator=(const unordered_map&) = default;
      |       ^~~~~~~~
/usr/include/c++/14/bits/unordered_map.h:279:17: note:   no known conversion for argument 1 from 'std::map<long long int, long long int>' to 'const std::unordered_map<long long int, long long int, std::hash<long long int>, std::equal_to<long long int>, std::allocator<std::pair<const long long int, long long int> > >&'
  279 |       operator=(const unordered_map&) = default;
      |                 ^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/unordered_map.h:283:7: note: candidate: 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&&) [with _Key = long long int; _Tp = long long int; _Hash = std::hash<long long int>; _Pred = std::equal_to<long long int>; _Alloc = std::allocator<std::pair<const long long int, long long int> >]'
  283 |       operator=(unordered_map&&) = default;
      |       ^~~~~~~~
/usr/include/c++/14/bits/unordered_map.h:283:17: note:   no known conversion for argument 1 from 'std::map<long long int, long long int>' to 'std::unordered_map<long long int, long long int, std::hash<long long int>, std::equal_to<long long int>, std::allocator<std::pair<const long long int, long long int> > >&&'
  283 |       operator=(unordered_map&&) = default;
      |                 ^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/unordered_map.h:297:7: note: candidate: 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(std::initializer_list<typename std::_Hashtable<_Key, std::pair<const _Key, _Val>, _Alloc, std::__detail::_Select1st, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::__is_nothrow_invocable<const _Hash&, const _Key&> > >::value, false, true> >::value_type>) [with _Key = long long int; _Tp = long long int; _Hash = std::hash<long long int>; _Pred = std::equal_to<long long int>; _Alloc = std::allocator<std::pair<const long long int, long long int> >; typename std::_Hashtable<_Key, std::pair<const _Key, _Val>, _Alloc, std::__detail::_Select1st, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::__is_nothrow_invocable<const _Hash&, const _Key&> > >::value, false, true> >::value_type = std::pair<const long long int, long long int>]'
  297 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/unordered_map.h:297:46: note:   no known conversion for argument 1 from 'std::map<long long int, long long int>' to 'std::initializer_list<std::pair<const long long int, long long int> >'
  297 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~