Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <vector>
#include <unordered_map>
#include <numeric>
#include <algorithm>
#define rep(it, ifrom, ito) for (auto it = ifrom; it != ito; ++it)
#define all(a) a.begin(), a.end()

using namespace std;

int main(int argc, char* argv[]) {
    const char* debug_env = getenv("DEBUG");
    const bool debug = debug_env && atoi(debug_env) != 0;

    int64_t S;
    cin >> S;

    std::vector<int64_t> As;
    int64_t v = S;
    while (v > 0) {
        As.push_back(v % 10);
        v /= 10;
    }

    if (debug) {
        for (int i = 0; i < As.size(); ++i) {
            cout << As[i] << " ";
        }
        cout << endl;
    }

    int64_t mindiff = 10000000;
    for (int i = 0; i + 2 < As.size(); ++i) {
        int num = As[i] + As[i + 1] * 10 + As[i + 2] * 100;
        if (debug) cout << num << endl;
        mindiff = min(abs(num - 753ll), mindiff);
    }

    cout << mindiff;

    return 0;
}



Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:40:22: error: no matching function for call to 'min(long long int, int64_t&)'
   40 |         mindiff = min(abs(num - 753ll), mindiff);
      |                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/specfun.h:43,
                 from /usr/include/c++/14/cmath:3906,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:40:22: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int64_t' {aka 'long int'})
   40 |         mindiff = min(abs(num - 753ll), mindiff);
      |                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:9:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:40:22: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   40 |         mindiff = min(abs(num - 753ll), mindiff);
      |                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~