Language: C++

#include "bits/stdc++.h"

#define all_of(x) std::begin(x), std::end(x)
#ifdef _GLIBCXX_DEBUG
    #define debug(x) cerr << #x << ": " << x << endl
#else
    #define debug(x) 
#endif

using namespace std;

using LL = long long;

template<typename T>
ostream& operator << (ostream& out, const vector<T>& v) {
    out << "[";
    for(const auto& x : v) {
        out << x << ", ";
    }
    return out << "]";
}
template<typename T>
istream& operator >> (istream& in, vector<T>& v) {
    for(auto& x : v) {
        in >> x;
    }
    return in;
}

template<typename S, typename T>
ostream& operator << (ostream& out, const pair<S, T>& p) {
    return out << "{" << p.first << ", " << p.second << "}";
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    
    int N;
    cin >> N;
    vector<int> D(N, 0);
    for(int n = 1; n < N; ++n) {
        for(int q = n; q < N; q += n) {
            D[q]++;
        }
    }
    LL ans = 0;
    for(int n = 1; n < N; ++n) {
        ans += D[n];
    }
    cout << ans << "\n";
    
    
    
    return 0;
}
#include "bits/stdc++.h"

#define all_of(x) std::begin(x), std::end(x)
#ifdef _GLIBCXX_DEBUG
    #define debug(x) cerr << #x << ": " << x << endl
#else
    #define debug(x) 
#endif

using namespace std;

using LL = long long;

template<typename T>
ostream& operator << (ostream& out, const vector<T>& v) {
    out << "[";
    for(const auto& x : v) {
        out << x << ", ";
    }
    return out << "]";
}
template<typename T>
istream& operator >> (istream& in, vector<T>& v) {
    for(auto& x : v) {
        in >> x;
    }
    return in;
}

template<typename S, typename T>
ostream& operator << (ostream& out, const pair<S, T>& p) {
    return out << "{" << p.first << ", " << p.second << "}";
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    
    int N;
    cin >> N;
    vector<int> D(N, 0);
    for(int n = 1; n < N; ++n) {
        for(int q = n; q < N; q += n) {
            D[q]++;
        }
    }
    LL ans = 0;
    for(int n = 1; n < N; ++n) {
        ans += D[n];
    }
    cout << ans << "\n";
    
    
    
    return 0;
}


Compiler output:
a.cc:72:10: error: redefinition of 'template<class T> std::ostream& operator<<(std::ostream&, const std::vector<_Tp>&)'
   72 | ostream& operator << (ostream& out, const vector<T>& v) {
      |          ^~~~~~~~
a.cc:15:10: note: 'template<class T> std::ostream& operator<<(std::ostream&, const std::vector<_Tp>&)' previously declared here
   15 | ostream& operator << (ostream& out, const vector<T>& v) {
      |          ^~~~~~~~
a.cc:80:10: error: redefinition of 'template<class T> std::istream& operator>>(std::istream&, std::vector<_Tp>&)'
   80 | istream& operator >> (istream& in, vector<T>& v) {
      |          ^~~~~~~~
a.cc:23:10: note: 'template<class T> std::istream& operator>>(std::istream&, std::vector<_Tp>&)' previously declared here
   23 | istream& operator >> (istream& in, vector<T>& v) {
      |          ^~~~~~~~
a.cc:88:10: error: redefinition of 'template<class S, class T> std::ostream& operator<<(std::ostream&, const std::pair<_T1, _T2>&)'
   88 | ostream& operator << (ostream& out, const pair<S, T>& p) {
      |          ^~~~~~~~
a.cc:31:10: note: 'template<class S, class T> std::ostream& operator<<(std::ostream&, const std::pair<_T1, _T2>&)' previously declared here
   31 | ostream& operator << (ostream& out, const pair<S, T>& p) {
      |          ^~~~~~~~
a.cc:92:5: error: redefinition of 'int main()'
   92 | int main() {
      |     ^~~~
a.cc:35:5: note: 'int main()' previously defined here
   35 | int main() {
      |     ^~~~