criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
#define lli long long int

using namespace std;

int main() {

	ios::sync_with_stdio(0);
	cin.tie(0);

	lli n;
	cin >> n;

	vector<lli> a(n);
	lli stool = 0;
	for(lli i = 0; i < n; i++) {
		cin >> a[i];
		if(i > 0) {
			lli curr = max(a[i - 1] - a[i], 0);
			a[i] += curr;
			stool += curr;
		}
		// cout << a[i] << '\n';
	}

	cout << stool << '\n';

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:39: error: no matching function for call to 'max(__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type, int)'
   19 |                         lli curr = max(a[i - 1] - a[i], 0);
      |                                    ~~~^~~~~~~~~~~~~~~~~~~~
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:1:
/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:19:39: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   19 |                         lli curr = max(a[i - 1] - a[i], 0);
      |                                    ~~~^~~~~~~~~~~~~~~~~~~~
/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:19:39: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   19 |                         lli curr = max(a[i - 1] - a[i], 0);
      |                                    ~~~^~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define repit(it, li) for(auto it=li.begin(); it!=li.end(); it++)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main(){
   int n;
   cin>>n;
   vector<int> a(n);
   rep(i, n) cin>>a[i];

   ll c=0, t=0;
   rep(i, n){
      if(c>a[i]) t+=c-a[i];
      c=max(c, a[i]);
   }

   cout<<t<<endl;
   return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:12: error: no matching function for call to 'max(ll&, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   17 |       c=max(c, a[i]);
      |         ~~~^~~~~~~~~
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:1:
/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:17:12: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'})
   17 |       c=max(c, a[i]);
      |         ~~~^~~~~~~~~
/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:17:12: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   17 |       c=max(c, a[i]);
      |         ~~~^~~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

void solve() {
    int N;
    cin >> N;
    vector<int> A(N);
    for (int i = 0; i < N; i++)
    {
        cin >> A[i];
    }
    long long a_max = 0, ans = 0;
    for (int i = 0; i < N; i++)
    {
        if (a_max > A[i])
        {
            ans += a_max - A[i];
        }
        a_max = max(a_max, A[i]);
    }
    
    cout << ans << endl;
}

int main() {
    solve();
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:20:20: error: no matching function for call to 'max(long long int&, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   20 |         a_max = max(a_max, A[i]);
      |                 ~~~^~~~~~~~~~~~~
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:1:
/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:20:20: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'})
   20 |         a_max = max(a_max, A[i]);
      |                 ~~~^~~~~~~~~~~~~
/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:20:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   20 |         a_max = max(a_max, A[i]);
      |                 ~~~^~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int main()
{
	ll n;
	cin >> n;

	vector<ll> h(n);
	for(ll i = 0; i < n; i++)
		cin >> h[i];

	ll ans = 0;
	for(ll i = 1; i < n; i++)
	{
		ans = ans + max(0, h[i - 1] - h[i]);
		h[i] = max(h[i], h[i - 1]);
	}

	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:32: error: no matching function for call to 'max(int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)'
   19 |                 ans = ans + max(0, h[i - 1] - h[i]);
      |                             ~~~^~~~~~~~~~~~~~~~~~~~
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:1:
/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:19:32: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'})
   19 |                 ans = ans + max(0, h[i - 1] - h[i]);
      |                             ~~~^~~~~~~~~~~~~~~~~~~~
/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:19:32: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   19 |                 ans = ans + max(0, h[i - 1] - h[i]);
      |                             ~~~^~~~~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif

	long long int n, maxx, a;
	cin >> n;
	cin >> maxx;
	long long int ans = 0;
	for(long long int i = 1; i < n; i++) {
		cin >> a;
		ans += max(0, maxx - a);
		maxx = max(a, maxx);
	}
	cout << ans;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:27: error: no matching function for call to 'max(int, long long int)'
   20 |                 ans += max(0, maxx - a);
      |                        ~~~^~~~~~~~~~~~~
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:1:
/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:20:27: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   20 |                 ans += max(0, maxx - a);
      |                        ~~~^~~~~~~~~~~~~
/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:20:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   20 |                 ans += max(0, maxx - a);
      |                        ~~~^~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define ll long long
#define ld long double
#define mp make_pair
#define pb push_back
#define fo(i,n) for(ll i=0;i<n;i++)
#define fo1(i,n) for(ll i=1;i<=n;i++)
#define loop(i,a,b)for(ll i=a;i<=b;i++)
#define loopr(i,a,b)for(ll i=b;i>=a;i--)
#define all(x) x.begin(), x.end()
#define sz(x) (ll)(x).size()
#define vll vector<ll> 
#define vvl vector<vll>
#define vpll vector<pll>
#define pll pair<ll,ll>
#define F first
#define S second
#define MOD 1000000007
ll max(ll a,ll b){if (a>b) return a; else return b;}
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b, a%b);}
ll lcm(ll a, ll b){return a*b/gcd(a, b);}
ll fexp(ll a, ll b){ll ans = 1;while(b){if(b&1) ans = ans*a%MOD; b/=2;a=a*a%MOD;}return ans;}
ll inverse(ll a, ll p){return fexp(a, p-2);}
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	ll T=1;
	//cin >> T;
	ll t=0;
	while(t++<T){
		ll n;
		cin>>n;
		vll a(n);
		fo(i,n)cin>>a[i];
		ll mx=-1;
		ll ans=0;
		fo(i,n){
			mx=max(mx,a[i]);
			ll ans+=mx-a[i];
		}
		cout<<ans<<endl;
		
	}
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:31: error: expected initializer before '+=' token
   42 |                         ll ans+=mx-a[i];
      |                               ^~
Language: C++

#define errOut(s) \
  { std::cerr << __LINE__ << ":" << #s << ":" << (s) << std::endl; }

#include <bits/stdc++.h>
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
//#include <boost/multi_array.hpp>
//#include <boost/optional.hpp>
//#include <boost/range/adaptors.hpp>
//#include <boost/range/algorithm.hpp>
//#include <boost/range/irange.hpp>
#pragma clang diagnostic pop

using namespace std;

int64_t solve(int64_t  /*n*/, std::vector<int64_t> as) {
  int64_t maximum = -1;
  int64_t ret = 0;
  for (auto a : as) {
    maximum = std::max(a, maximum);
    ret += std::max(0LL, maximum - a);
  }
  return ret;
}

int main() {
  std::cin.tie(nullptr);
  std::ios::sync_with_stdio(false);
  int64_t n;
  std::cin >> n;
  std::vector<int64_t> as(n);
  for (int i = 0; i < n; i++) {
    std::cin >> as[i];
  }
  auto const res = solve(n, std::move(as));
  std::cout << res << std::endl;
  return 0;
}


Compiler output:
a.cc: In function 'int64_t solve(int64_t, std::vector<long int>)':
a.cc:21:20: error: no matching function for call to 'max(long long int, int64_t)'
   21 |     ret += std::max(0LL, maximum - a);
      |            ~~~~~~~~^~~~~~~~~~~~~~~~~~
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:4:
/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:21:20: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int64_t' {aka 'long int'})
   21 |     ret += std::max(0LL, maximum - a);
      |            ~~~~~~~~^~~~~~~~~~~~~~~~~~
/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:21:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   21 |     ret += std::max(0LL, maximum - a);
      |            ~~~~~~~~^~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include<bits/stdc++.h>
#define pb(x) push_back(x

using namespace std;


int main() {
    int n,x;
    cin>>n;
    vector<int> A
    int max=0, ans = 0;
    for(int i=0; i<n; i++)
    {
        cin>>x;
        if(x<max)
        {
            ans+=max-ans;
        }
        else
            max = x;
    }
    cout<<ans;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: expected initializer before 'int'
   12 |     int max=0, ans = 0;
      |     ^~~
a.cc:16:13: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<'
   16 |         if(x<max)
      |            ~^~~~
a.cc:18:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |             ans+=max-ans;
      |             ^~~
      |             abs
a.cc:21:19: error: overloaded function with no contextual type information
   21 |             max = x;
      |                   ^
a.cc:23:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |     cout<<ans;
      |           ^~~
      |           abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
//型に気を付けよう
//a=0x61=97 '0'=0x30=48
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long  ll;
typedef long double  ld;
typedef string str;
typedef pair<int,int> pairii;
typedef vector<int> veci;
const double pi=3.1415926535;
const ll  mod=1000000007;
//桁数指定　cout << fixed << setprecision(2)
int main() {
  ll n;
  cin>>n;
  veci v(n);
  {rep(i,n)cin>>v[i];}
  ll ans=0;
  ll  ma=0;
  rep(i,n){
    ma=max(ma,v[i]);
    ans+=ma-v[i];
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:11: error: no matching function for call to 'max(ll&, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   22 |     ma=max(ma,v[i]);
      |        ~~~^~~~~~~~~
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:1:
/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:22:11: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'})
   22 |     ma=max(ma,v[i]);
      |        ~~~^~~~~~~~~
/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:22:11: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   22 |     ma=max(ma,v[i]);
      |        ~~~^~~~~~~~~
Language: C++

#include<vector>
#include<algorithm>
#include<iostream>
using namespace std;
int gcd(int a,int b)
{
    if(!b)return a;
    else return gcd(b,a%b);
}
/*int n,q,ara[200001],st[800004],a,b,mx=2000000000;
void build(int si,int ss,int se)
{
    if(ss==se){
        st[si]=ara[ss];
        return;
    }
    int mid=(ss+se)/2;
    build(2*si,ss,mid),build(2*si+1,mid+1,se);
    st[si]=min(st[2*si],st[2*si+1]);
}
int query(int si,int ss,int se,int qs,int qe)
{
    if(qe<ss || se<qs)return mx;
    if(ss>=qs && qe>=se)return st[si];
    int mid=(ss+se)/2;
    return min(query(2*si,ss,mid,qs,qe),query(2*si+1,mid+1,se,qs,qe));
}
int main()
{
    //freopen ("input.txt","r",stdin);
    //freopen ("output1.txt","w",stdout);
    cin>>n>>q;
    for(int i=1;i<=n;i++)cin>>ara[i];
    build(1,1,n);
    while(q--){
        cin>>a>>b;
        cout<<query(1,1,n,a,b)<<"\n";
    }
}*/
int main()
{
    int n;
    cin>>n;
    int ara[n];
    long long int ans=0;
    cin>>ara[0];
    for(int i=1;i<n;i++){
        cin>>ara[i];
        if(ara[i]<ara[i-1])ans+=ara[i-1]-ara[i],ara[i]=ara[i-1],;
    }
    cout<<ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:49:65: error: expected primary-expression before ';' token
   49 |         if(ara[i]<ara[i-1])ans+=ara[i-1]-ara[i],ara[i]=ara[i-1],;
      |                                                                 ^
Language: C++

#include<bits/stdc++.h>
#define st first
#define nd second
#define PQ priority_queue

using ll = long long ;
using namespace std;
using pii = pair<int,int>;

int main(){
	int n;
	ll sum = 0;
	scanf("%d", &n);
	int x, pre = 0;
	for(int i = 1; i <= n; i++){
		scanf("%d", &x);
		if(x < pre){
			sum += pre - x;
			x = pre;
		}
		pre = x;
	}
	printf("%lld", sum);


}#include<bits/stdc++.h>
#define st first
#define nd second
#define PQ priority_queue

using ll = long long ;
using namespace std;
using pii = pair<int,int>;

int main(){
	int n;
	ll sum = 0;
	scanf("%d", &n);
	int x, pre = 0;
	for(int i = 1; i <= n; i++){
		scanf("%d", &x);
		if(x < pre){
			sum += pre - x;
			x = pre;
		}
		pre = x;
	}
	printf("%lld", sum);


}

Compiler output:
a.cc:26:2: error: stray '#' in program
   26 | }#include<bits/stdc++.h>
      |  ^
a.cc:26:3: error: 'include' does not name a type
   26 | }#include<bits/stdc++.h>
      |   ^~~~~~~
a.cc:35:5: error: redefinition of 'int main()'
   35 | int main(){
      |     ^~~~
a.cc:10:5: note: 'int main()' previously defined here
   10 | int main(){
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
const int N=1e3+5;
char S[N][N];
int f[N][N],dr[4][2]={{1,0},{-1,0},{0,1},{0,-1}};
int que[N*N],s,t,h,w,sx,sy,tx,ty;
signed main(void){
	cin>>h>>w>>sx>>sy>>tx>>ty;
    for(int i=0;i<h;i++) {
	    cin>>S[i];
       for(int j=0;j<w;j++)
           f[i][j]=S[i][j]=='#';
    }
	f[--sx][--sy]=1;
    tx--;
	ty--;
    que[t++]=sx*N+sy;
    while(s<t){
       	int s1=s;
       	while(s<t){
           	int x=que[s++],y=x%N;
           	x/=N;
           	for(int i=0;i<4;i++){
               	int x1=x+dr[i][0];
			   	y1=y+dr[i][1];
               	if((unsigned)x1>=h||(unsigned)y1>=w||f[x1][y1]){
               		continue;
			   	}
                f[x1][y1]=f[x][y];
               	que[t++]=x1*N+y1;
           	}
       	}
       	while(s1<s){
           	int x=que[s1++];
			int y=x%N;
           	x/=N;
           	for(int i=-2;i<3;i++) {
                for(int j=-2;j<3;j++) {
                    int x1=x+i;
					int y1=y+j;
                    if((unsigned)x1>=h||(unsigned)y1>=w||f[x1][y1]){
                    	continue;
					}
                    f[x1][y1]=f[x][y]+1;
                    que[t++]=x1*N+y1;
                }
            }
        }
    }
	cout<<(f[tx][ty]?f[tx][ty]-1:-1)<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:35: error: assignment of function 'double y1(double)'
   25 |                                 y1=y+dr[i][1];
      |                                 ~~^~~~~~~~~~~
a.cc:26:37: error: cast from 'double (*)(double) noexcept' to 'unsigned int' loses precision [-fpermissive]
   26 |                 if((unsigned)x1>=h||(unsigned)y1>=w||f[x1][y1]){
      |                                     ^~~~~~~~~~~~
a.cc:26:59: error: invalid types 'int [1005][double(double) noexcept]' for array subscript
   26 |                 if((unsigned)x1>=h||(unsigned)y1>=w||f[x1][y1]){
      |                                                           ^
a.cc:29:22: error: invalid types 'int [1005][double(double) noexcept]' for array subscript
   29 |                 f[x1][y1]=f[x][y];
      |                      ^
a.cc:30:30: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   30 |                 que[t++]=x1*N+y1;
      |                          ~~~~^~~
a.cc:30:30: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive]
   30 |                 que[t++]=x1*N+y1;
      |                          ~~~~^~~
      |                              |
      |                              double (*)(double) noexcept
Language: C++

#include <bits/stdc++.h>
//#include <atcoder/all>
#define rep(i,n) for (int i=0;i<(n);i++)
using ll = long long;
using namespace std;
//using namespace atcoder;

int main() {
    int h,w,sy,sx,gy,gx;
    cin>>h>>w>>sy>>sx>>gy>>gx;
    sy--,sx--,gy--,gx--;
    string s[h];
    for (int i=0;i<h;i++)
        cin>>s[i];
    int dis[h][w];
    rep(i,h) rep(j,w) dis[i][j]=1e9;
    dis[sy][sx]=0;
    deque<pair<int,int>> q;
    q.push_back({sy,sx});
    int dy[]={0,0,-1,1},dx[]={-1,1,0,0};
    while (q.size()) {
        auto a=q.frons();q.pop_front();
        int y=a.first,x=a.second;
        rep(i,4) {
            int ny=y+dy[i],nx=x+dx[i];
            if (0<=ny&&ny<h&&0<=nx&&nx<w&&s[ny][nx]=='.'&&dis[y][x]<dis[ny][nx]) {
                dis[ny][nx]=dis[y][x];
                q.push_front({ny,nx});
            }
        }
        for (int i=-2;i<=2;i++) for (int j=-2;j<=2;j++) {
            int ny=y+i,nx=x+j;
            if (0<=ny&&ny<h&&0<=nx&&nx<w&&s[ny][nx]=='.'&&dis[y][x]+1<dis[ny][nx]) {
                dis[ny][nx]=dis[y][x]+1;
                q.push_back({ny,nx});
            }
        }
    }
    if (dis[gy][gx]==1e9)
        cout<<-1<<endl;
    else
        cout<<dis[gy][gx]<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:18: error: 'class std::deque<std::pair<int, int> >' has no member named 'frons'; did you mean 'front'?
   22 |         auto a=q.frons();q.pop_front();
      |                  ^~~~~
      |                  front
a.cc:25:31: error: 'x' was not declared in this scope; did you mean 'nx'?
   25 |             int ny=y+dy[i],nx=x+dx[i];
      |                               ^
      |                               nx
a.cc:32:27: error: 'x' was not declared in this scope; did you mean 'nx'?
   32 |             int ny=y+i,nx=x+j;
      |                           ^
      |                           nx
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main()
{
    int h,w;
    cin>>h>>w;
  	vector<int> dx {-1, 0, 1, 0};
  	vector<int> dy {0, -1, 0, 1};

    pair<int,int>c,d;
    cin>>c.first>>c.second>>d.first>>d.second;
    c.first--;
    c.second--;
    d.first--;
    d.second--;
    vector<string>a(h);
    vector<vector<long long > > b(h);
    for(int i=0;i<h;i++)cin>>a[i]; 
  
    for(int i=0;i<h;i++)
    {  
        b[i].resize(w);
      	for(int j=0;j<w;j++)b[i][j]=1000000000;
    }

    queue<pair<int,int> >q1,q2;
    q1.push(c);
    b[c.first][c.second] = 0;
    while(!q1.empty() || !q2.empty())
    {
        if(!q1.empty())
        {
            auto u=q1.front();
            q1.pop();
            q2.push(u);
          	for(int i=0;i<4;i++)
            {
              int nx= u.first + dx[i];
              int ny= u.second + dy[i];
              if (ny<0 || ny>=h || nx<0 || nx>=w || a[nx][ny] == '#') continue;
              if(b[nx][ny] > b[u.first][u.second] && a[nx][ny] == '.'){
                    b[nx][ny]=b[u.first][u.second];
                    q1.push(make_pair(nx,ny));
              }
            }
        }
        else 
        {
            auto v= q2.front();
            q2.pop();
            for(int i=-2;i<=2;i++ )
            {
                for(int j=-2;j<=2;j++)
                {
                  	int nx = v.first + i;
                  	int ny = v.second + j;
                  	if (ny<0 || ny>=h || nx<0 || nx>=w || a[nx][ny] == '#')  continue;
                    if(b[nx][ny] > (b[x][y]+1) && a[nx][ny] == '.')
                    {
                        b[nx][ny]=b[x][y]+1;
                        q1.push(make_pair(nx,ny));
                    }
                }
            }
        }

    }
    if(b[d.first][d.second] == 1000000000)cout<<-1<<endl;
    else cout<<b[d.first][d.second]<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:59:39: error: 'x' was not declared in this scope; did you mean 'nx'?
   59 |                     if(b[nx][ny] > (b[x][y]+1) && a[nx][ny] == '.')
      |                                       ^
      |                                       nx
a.cc:59:42: error: 'y' was not declared in this scope; did you mean 'ny'?
   59 |                     if(b[nx][ny] > (b[x][y]+1) && a[nx][ny] == '.')
      |                                          ^
      |                                          ny
Language: C++

#include "stdc++.h"
using namespace std;
#define rep(i,n) for(int i = 0; i < n; i++)
using ll = long long;
using graph = vector<vector<int>>;

const ll mod = 1000000007;
const int INF = 1001001001;

int dx[4] = { -1, 0, 1, 0 };
int dy[4] = { 0, 1, 0, -1 };

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int h, w;
	cin >> h >> w;

	vector<string> mp(h);

	int sx, sy, gx, gy;
	cin >> sx >> sy >> gx >> gy;
	sx -= 1, sy -= 1, gx -= 1, gy -= 1;

	for (int i = 0; i < h; i++) 
		cin >> mp[i];

	vector<vector<int>> cost(h, vector<int>(w, INF));
	cost[sx][sy] = 0;

	deque<pair<int, int>> dq;
	dq.push_front({ sx, sy });

	while (!dq.empty()) {
		auto p = dq.front(); 
		dq.pop_front();
		int x = p.first, y = p.second;

		// 상,하,좌,우
		for (int i = 0; i < 4; i++) {
			int nx = x + dx[i], ny = y + dy[i];
			// 예외처리
			if (nx < 0 || nx >= h || ny < 0 || ny >= w)
				continue;
			// 예외처리
			if (mp[nx][ny] == '#')
				continue;
			if (cost[nx][ny] > cost[x][y]) {
				cost[nx][ny] = cost[x][y];
				dq.push_front({ nx, ny });
			}
		}

		// 5x5 탐색
		for (int i = -2; i <= 2; i++) {
			for (int j = -2; j <= 2; j++) {
				// 예외처리
				if (i == 0 && j == 0)
					continue;
				int nx = x + i, ny = y + j;
				// 예외처리
				if (nx < 0 || nx >= h || ny < 0 || ny >= w)
					continue;
				// 예외처리
				if (mp[nx][ny] == '#')
					continue;
				if (cost[nx][ny] > cost[x][y] + 1) {
					cost[nx][ny] = cost[x][y] + 1;
					dq.push_back({ nx, ny });
				}
			}
		}
	}

	int ans = cost[gx][gy] - cost[sx][sy];

	if (ans == INF)
		cout << -1;
	else
		cout << ans << endl;
}

Compiler output:
a.cc:1:10: fatal error: stdc++.h: No such file or directory
    1 | #include "stdc++.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <math.h>
int acs(const void *a, const void *b) { 
  return *(int*)a - *(int*)b;
} /* 1,2,3,4.. */
int des(const void *a, const void *b) {
  return *(int*)b - *(int*)a;
} /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b) { 
  return *(char*)a - *(char*)b;
} /* a,b,c,d.. */
int cmp_str(const void *a, const void *b) {
  return strcmp(*(const char **)a, *(const char **)b);
} /* aaa,aab.. */
#define min(a,b) (a < b ? a : b)
#define max(a,b) (a > b ? a : b)
#define rep(i, l, r) for (int i = l; i < r; i++)
#define MAX 1001
#define MOD 1000000007
#define INF 1000000009
typedef long long int lli;

typedef struct {
  int front;
  int rear;
  int data[1000000005][2];
} queue;

queue que;

void initQueue(queue *p) {
  p->front = p->rear = 0;
}

bool emptyQueue(queue *p) {
  return p->front == p->rear;
}

bool fullQueue(queue *p) {
  return (p->front - 1 == p->rear) || (p->front == 0 && p->rear == MAX - 1);
}

void queuePop(queue *p) {
  if ( emptyQueue(p) ) {
    printf("UnderFlow\n");
    exit(1);
  } else {
    p->front++;
    if (p->front == MAX)
      p->front = 0;
  }
}

void queuePush(queue *p, int y, int x) {
  if ( fullQueue(p) ) {
    printf("OverFlow\n");
    exit(1);
  } else {
    p->data[p->rear][0] = y;
    p->data[p->rear][1] = x;
    p->rear++;
    if ( p->rear == MAX )
      p->rear = 0;
  }
}


int H, W, Ch, Cw, Dh, Dw;

char S[MAX][MAX];

int main(void) {
  scanf("%d %d", &H, &W);
  scanf("%d %d", &Ch, &Cw);
  scanf("%d %d", &Dh, &Dw);

  rep(i, 0, H) scanf("%s", S[i]);

  int dist[MAX][MAX];
  rep(i, 0, MAX) rep(j, 0, MAX) dist[i][j] = INF;


  int ax[4] = {0, 1, 0, -1};
  int ay[4] = {1, 0, -1, 0};

  int bx[4] = {1, 1, -1, -1};
  int by[4] = {1, -1, -1, 1};

  initQueue(&que);
  queuePush(&que, Ch-1, Cw-1);
  dist[Ch-1][Cw-1] = 0;
  while ( !emptyQueue(&que) ) {
    int y = que.data[que.front][0];
    int x = que.data[que.front][1];
    queuePop(&que);
    if ( y == Dh-1 && x == Dw-1 ) {
      printf("%d\n", dist[y][x]);
      return 0;
    }
    for (int i = 0; i < 4; i++) {
      int ny = y + ay[i];
      int nx = x + ax[i];
      if ( ny < 0 || H <= ny ) continue;
      if ( nx < 0 || W <= nx ) continue;
      if ( S[ny][nx] == '#' ) continue;
      if ( dist[ny][nx] <= dist[y][x] ) continue;
      dist[ny][nx] = dist[y][x];
      queuePush(&que, ny, nx); 
    }

    for (int i = 0; i < 4; i++) {
      int ny = y + by[i];
      int nx = x + bx[i];
      if ( ny < 0 || H <= ny ) continue;
      if ( nx < 0 || W <= nx ) continue;
      if ( S[ny][nx] == '#' ) continue;
      if ( dist[ny][nx] <= dist[y][x] + 1 ) continue;
      dist[ny][nx] = dist[y][x] + 1;
      queuePush(&que, ny, nx);
    }
  }
  printf("-1\n";
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:125:16: error: expected ')' before ';' token
  125 |   printf("-1\n";
      |         ~      ^
      |                )
main.c:126:12: error: expected ';' before '}' token
  126 |   return 0;
      |            ^
      |            ;
  127 | }
      | ~
Language: C++

#include <bits/stdc++.h>
using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define ALL(a)     (a).begin(),(a).end()
#define RALL(a)     (a).rbegin(),(a).rend()
#define PRINT(a)   cout << (a) << endl

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fi first
#define Se second

#define debug(x) cerr << x << " " << "(L:" << __LINE__ << ")" << '\n';

using ll = long long int;
using P = pair<int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using pii = pair<int, int>;

template <typename T> using PQ = priority_queue<T>;
template <typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7;

int dx[4] = {1,0,-1,0};
int dy[4] = {0,1,0,-1};


int main(){
  int H,W;
  cin >> H >> W;
  int ch, cw, dh, dw;
  cin >> ch >> cw >> dh >> dw;
  ch--;cw--;dh--;dw--;

  vector<string> s(H);
  REP(i,H)cin >> s[i];

  deque<P> q;
  q.emplace_front(ch,cw);

  vvi dist(H, vi(W,INF));
  dist[ch][cw]=0;

  while(!q.empty()){
    int x = q.front().Fi;
    int y = q.front().Se;
//    printf("%d : %d -- %d\n",x,y,dist[x][y]);
    q.pop_front();
    int now = dist[x][y];
    if(dost[x][y] != now) continue;
    REP(i,4){
      int nx = x + dx[i];
      int ny = y + dy[i];

      if(nx < 0 || nx >= H || ny < 0 || ny >= W)continue;
      if(s[nx][ny]=='#')continue;
      if(dist[nx][ny]<=now)continue;
      dist[nx][ny]=now;
      q.emplace_front(nx,ny);
    }

    FOR(i,-2,3)FOR(j,-2,3){
      int nx=x+i;
      int ny=y+i;
      if(nx < 0 || nx >= H || ny < 0 || ny >= W)continue;
      if(s[nx][ny]=='#')continue;
      if(dist[nx][ny]<=now+1)continue;
      dist[nx][ny] = now+1;

      q.emplace_back(nx,ny);
    }
  }

  // REP(i,H)REP(j,W){
  //   cout << dist[i][j] << (j==W-1 ? "\n" : " ");
  // }

  int ans = dist[dh][dw];
  if(ans==INF)ans=-1;
  cout << ans << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:61:8: error: 'dost' was not declared in this scope; did you mean 'dist'?
   61 |     if(dost[x][y] != now) continue;
      |        ^~~~
      |        dist
Language: C++

#include <bits/stdc++.h>
using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define ALL(a)     (a).begin(),(a).end()
#define RALL(a)     (a).rbegin(),(a).rend()
#define PRINT(a)   cout << (a) << endl

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fi first
#define Se second

#define debug(x) cerr << x << " " << "(L:" << __LINE__ << ")" << '\n';

using ll = long long int;
using P = pair<int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using pii = pair<int, int>;

template <typename T> using PQ = priority_queue<T>;
template <typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7;

int dx[4] = {1,0,-1,0};
int dy[4] = {0,1,0,-1};


int main(){
  int H,W;
  cin >> H >> W;
  int ch, cw, dh, dw;
  cin >> ch >> cw >> dh >> dw;
  ch--;cw--;dh--;dw--;

  vector<string> s(H);
  REP(i,H)cin >> s[i];

  deque<P> q;
  q.emplace_front(ch,cw);

  vvi dist(H, vi(W,INF));
  dist[ch][cw]=0;

  while(!q.empty()){
    int x = q.front().Fi;
    int y = q.front().Se;
//    printf("%d : %d -- %d\n",x,y,dist[x][y]);
    q.pop_front();
    int now = dist[x][y];
    if(dost[x][y] != d) continue;
    REP(i,4){
      int nx = x + dx[i];
      int ny = y + dy[i];

      if(nx < 0 || nx >= H || ny < 0 || ny >= W)continue;
      if(s[nx][ny]=='#')continue;
      if(dist[nx][ny]<=now)continue;
      dist[nx][ny]=now;
      q.emplace_front(nx,ny);
    }

    FOR(i,-2,3)FOR(j,-2,3){
      int nx=x+i;
      int ny=y+i;
      if(nx < 0 || nx >= H || ny < 0 || ny >= W)continue;
      if(s[nx][ny]=='#')continue;
      if(dist[nx][ny]<=now+1)continue;
      dist[nx][ny] = now+1;

      q.emplace_back(nx,ny);
    }
  }

  // REP(i,H)REP(j,W){
  //   cout << dist[i][j] << (j==W-1 ? "\n" : " ");
  // }

  int ans = dist[dh][dw];
  if(ans==INF)ans=-1;
  cout << ans << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:61:8: error: 'dost' was not declared in this scope; did you mean 'dist'?
   61 |     if(dost[x][y] != d) continue;
      |        ^~~~
      |        dist
a.cc:61:22: error: 'd' was not declared in this scope
   61 |     if(dost[x][y] != d) continue;
      |                      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

conest

deque<pair<int,int> > q;
long long h,w,cx,cy,dx,dy;
bool visited[1050][1050];
long long d[1050][1050];

int main()
{
	cin>>h>>w>>cx>>cy>>dx>>dy;
	
	memset(visited,0,sizeof(visited));
	memset(d,1LL<<60,sizeof(d));
	
	string s[h];
	for(int i=1;i<=h;i++)
	   cin>>s[i];
	
	d[cx][cy]=0;
	visited[cx][cy]=true;
	
	while(!q.empty())
	{
		pair<int,int> p=q.front();
		long long x=p.first,y=p.second;
		if(x==dx&&y==dy)
		{
			cout<<d[x][y];
			return 0;
		}
		visited[x][y]=true;
		q.pop_front();
		for(int i=-2;i<=2;i++)
		   for(int j=-2;j<=2;j++)
		   {
		   	  long nx=x+i,ny=y+j;
		   	  if(nx<=h&&nx>0&&ny<=w&&ny>0&&s[nx][ny]=='.');
		   	    if(visited[nx][ny]) continue;
		   	    if(abs(i)+abs(j)<2)
		   	    {
		   	    	q.push_front(make_pair(nx,ny));
		   	    	d[nx][ny]=d[x][y];
				}
				else if(d[x][y]+1<d[nx][ny])
				     {
				     	d[nx][ny]=d[x][y]+1;
				     	q.push_back(make_pair(nx,ny));
					 }
		   }
	}
	
	cout<<-1;
	
	return 0;
	
}

Compiler output:
a.cc:4:1: error: 'conest' does not name a type; did you mean 'const'?
    4 | conest
      | ^~~~~~
      | const
a.cc: In function 'int main()':
a.cc:16:21: warning: overflow in conversion from 'long long int' to 'int' changes value from '1152921504606846976' to '0' [-Woverflow]
   16 |         memset(d,1LL<<60,sizeof(d));
      |                  ~~~^~~~
a.cc:25:16: error: 'q' was not declared in this scope
   25 |         while(!q.empty())
      |                ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const int inf = 1000000000;

int main(){
    int h,w;
    cin >> h >> w;
    int ch,dh,cw,dw;
    cin >> ch >> dh >> cw >> dw;
    vector<string> s(h);
    int dx[]={1,0,-1,0};
    int dy[]={0,1,0,-1};
    ch--; cw--; dh--; dw--;
    rep(i,h){
        cin >> s[i];
    }
    vector<vector<int>> dist(h,vector<int>(w,inf));
    deque<pair<int,int>> q;
    dist[ch][cw] = 0;
    q.emplace_back(ch,cw);
    while(!q.empty()){
        int i = q.front.first();
        int j = q.front.second();
        q.pop_front();
        int d = dist[i][j];
        rep(k,4){
            int nx = i+dx[k];
            int ny = j+dy[k];
            if(nx < 0 || nx>=w || ny<0 || ny>=h) continue;
            if(s[nx][ny] == '#') continue;
            if(dist[nx][ny]<=d) continue;
            dist[nx][ny] = d;
            q.emplace_front(nx,ny);
        }
        for(int ai=-2; ai<=2; ai++){
            for(int aj=-2; aj<=2; aj++){
            int nx = i+ai;
            int ny = j+aj;
            if(nx < 0 || nx>=w || ny<0 || ny>=h) continue;
            if(s[nx][ny] == '#') continue;
            if(dist[nx][ny]<=d+1) continue;
            dist[nx][ny] = d+1;
            q.emplace_back(nx,ny);
            }
        }
    }
    int ans = dist[dh][dw];
    if(ans == inf){
        cout << -1 << endl;
    }
    cout << ans << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:19: error: invalid use of member function 'std::deque<std::pair<int, int> >::front' (did you forget the '()' ?)
   24 |         int i = q.front.first();
      |                 ~~^~~~~
a.cc:25:19: error: invalid use of member function 'std::deque<std::pair<int, int> >::front' (did you forget the '()' ?)
   25 |         int j = q.front.second();
      |                 ~~^~~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <numeric>
#include <cmath>
#include <iomanip> //cout << fixed << setprecision(15) << << endl;
#include <cassert>

using namespace std;
using namespace atcoder;

#define ll long long int
#define pb push_back
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define P pair<int,int>

int mx8[] = {0,0,1,-1,-1,1,-1,1};
int my8[] = {-1,1,0,0,-1,-1,1,1};
int mx4[] = {1,-1,0,0};
int my4[] = {0,0,-1,1};
const int MOD = 1000000007;


int main(){
    cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);
    int h,w,ch,cw,dh,dw;
    cin >> h >> w >> ch >> cw >> dh >> dw;
    ch--; cw--; dh--; dw--;
    int dist[h][w];
    char s[h][w];
    const int INF = 1000000000;
    rep(i,h) rep(j,w){
        dist[i][j] = INF;
        cin >> s[i][j];
    }
    deque<P> que;
    dist[ch][cw] = 0;
    que.emplace_front(P(ch,cw));
    while(!que.empty()){
        int y = que.front().first;
        int x = que.front().second;
        que.pop_front();
        int d = dist[y][x];
        rep(i,4){
            int yi = y + my4[i];
            int xi = x + mx4[i];
            if(yi < 0 || xi < 0 || xi >= w || yi >= h) continue;
            if(dist[yi][xi] <= d) continue;
            if(s[yi][xi] == '#') continue;
            dist[yi][xi] = d;
            que.emplace_front(P(yi,xi));
        }
        for(int i = -2; i <= 2; ++i){
            for(int j = -2; j <= 2; ++j){
                int yi = y + i;
                int xi = x + j;
                if(yi < 0 || xi < 0 || yi >= h || xi >= w) continue;
                if(dist[yi][xi] <= d+1) continue;
                if(s[yi][xi] == '#') continue;
                dist[yi][xi] = d+1;
                que.emplace_back(P(yi,xi));
            }
        }
    }
    int ans = dist[dh][dw];
    if(dist[dh][dw] == INF) ans = -1;
    cout << ans << endl;
}



Compiler output:
a.cc:24:17: error: 'atcoder' is not a namespace-name
   24 | using namespace atcoder;
      |                 ^~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <numeric>
#include <cmath>
#include <iomanip> //cout << fixed << setprecision(15) << << endl;
#include <cassert>
#include "atcoder/segtree"

using namespace std;
using namespace atcoder;

#define ll long long int
#define pb push_back
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define P pair<int,int>

int mx8[] = {0,0,1,-1,-1,1,-1,1};
int my8[] = {-1,1,0,0,-1,-1,1,1};
int mx4[] = {1,-1,0,0};
int my4[] = {0,0,-1,1};
const int MOD = 1000000007;


int main(){
    cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);
    int h,w,ch,cw,dh,dw;
    cin >> h >> w >> ch >> cw >> dh >> dw;
    ch--; cw--; dh--; dw--;
    int dist[h][w];
    char s[h][w];
    const int INF = 1000000000;
    rep(i,h) rep(j,w){
        dist[i][j] = INF;
        cin >> s[i][j];
    }
    deque<P> que;
    dist[ch][cw] = 0;
    que.emplace_front(P(ch,cw));
    while(!que.empty()){
        int y = que.front().first;
        int x = que.front().second;
        que.pop_front();
        int d = dist[y][x];
        rep(i,4){
            int yi = y + my4[i];
            int xi = x + mx4[i];
            if(yi < 0 || xi < 0 || xi >= w || yi >= h) continue;
            if(dist[yi][xi] <= d) continue;
            if(s[yi][xi] == '#') continue;
            dist[yi][xi] = d;
            que.emplace_front(P(yi,xi));
        }
        for(int i = -2; i <= 2; ++i){
            for(int j = -2; j <= 2; ++j){
                int yi = y + i;
                int xi = x + j;
                if(yi < 0 || xi < 0 || yi >= h || xi >= w) continue;
                if(dist[yi][xi] <= d+1) continue;
                if(s[yi][xi] == '#') continue;
                dist[yi][xi] = d+1;
                que.emplace_back(P(yi,xi));
            }
        }
    }
    int ans = dist[dh][dw];
    if(dist[dh][dw] == INF) ans = -1;
    cout << ans << endl;
}



Compiler output:
a.cc:22:10: fatal error: atcoder/segtree: No such file or directory
   22 | #include "atcoder/segtree"
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.