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

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

int main(){
    std:vector<int> vec(3);
    std::cin >> vec.at(0) >> vec.at(1) >> vec.at(2);

    std::sort(vec.begin(), vec.end());
    std::cout << abs(vec.at(1) - vec.at(0)) + abs(vec.at(2) - vec.at(1)) << std::endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'vector' was not declared in this scope
    6 |     std:vector<int> vec(3);
      |         ^~~~~~
a.cc:6:9: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:6:16: error: expected primary-expression before 'int'
    6 |     std:vector<int> vec(3);
      |                ^~~
a.cc:7:17: error: 'vec' was not declared in this scope
    7 |     std::cin >> vec.at(0) >> vec.at(1) >> vec.at(2);
      |                 ^~~
Language: C++

#include<string>
int main() {
	int g[3];
	int temp=0,s=0;
	std::cin >> g[0]>>g[1]>>g[2];

	for (int j = 0; j < 3; j++) {
		for (int i = 1; i < 3; i++) {
			if (g[i] > g[i - 1]) {
				temp = g[i];
				g[i] = g[i - 1];
				g[i - 1] = temp;
			}
		}
	}

	
	
	
	s= abs(g[0] - g[1]);
	
	 s+= abs(g[1]-g[2]);

	std::cout << s << std::endl;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:14: error: 'cin' is not a member of 'std'
    5 |         std::cin >> g[0]>>g[1]>>g[2];
      |              ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<string>
  +++ |+#include <iostream>
    2 | int main() {
a.cc:24:14: error: 'cout' is not a member of 'std'
   24 |         std::cout << s << std::endl;
      |              ^~~~
a.cc:24:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:24:32: error: 'endl' is not a member of 'std'
   24 |         std::cout << s << std::endl;
      |                                ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include<string>
  +++ |+#include <ostream>
    2 | int main() {
Language: C++

using namespace std;
#include<bits/stdc++.h>
#define BEGIN ios_base::sync_with_stdio(0);cin.tie(0);
#define END return EXIT_SUCCESS;
#define FOR(I,A,B) for((I)=(A);(I)<(B);(I)++)
#define REP(I,N) FOR((I),0,(N))
#define UP(I,A,B) for((I)=(A);(I)<=(B);(I)++)
#define DW(I,A,B) for((I)=(A);(I)>=(B);(I)--)
#define IN(P) cin>>(P)
#define IN2(P1,P2) cin>>(P1)>>(P2)
#define IN3(P1,P2,P3) cin>>(P1)>>(P2)>>(P3)
#define INS(I,N,V) REP((I),(N)) cin>>(V[I])
#define INS2(I,N,V1,V2) REP((I),(N)) cin>>(V1[I])>>(V2[I]);
#define INS3(I,N,V1,V2,V3) REP((I),(N)) cin>>(V1[I])>>(V2[I])>>(V3[I]);
#define OUT(P) cout<<(P)<<endl
#define OUT2(P1,P2) cout<<(P1)<<" "<<(P2)<<endl
#define OUT3(P1,P2,P3) cout<<(P1)<<" "<<(P2)<<" "<<(P3)<<endl
#define OUTS(I,N,V) REP((I),(N)) cout<<(V[i])<<endl
#define ALL(C) (C).begin(),(C).end()
#define RALL(C) (C).rbegin(),(C).rend()
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}

int A[3],i;
inline void solve(){
  INS(i,3,A);
  sort(ALL(A));
  OUT(A[3]-A[0]);
}

int main(int argc,char**argv){
  BEGIN
  solve();
  END
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:19:20: error: request for member 'begin' in 'A', which is of non-class type 'int [3]'
   19 | #define ALL(C) (C).begin(),(C).end()
      |                    ^~~~~
a.cc:31:8: note: in expansion of macro 'ALL'
   31 |   sort(ALL(A));
      |        ^~~
a.cc:19:32: error: request for member 'end' in 'A', which is of non-class type 'int [3]'
   19 | #define ALL(C) (C).begin(),(C).end()
      |                                ^~~
a.cc:31:8: note: in expansion of macro 'ALL'
   31 |   sort(ALL(A));
      |        ^~~
Language: C

int max2(int a, int b){return a<b?b:a;}
int min2(int a, int b){return a>b?b:a;}
int max3(int a, int b, int c){return max2(a,max2(b,c);}
int min3(int a, int b, int c){return min2(a,min2(b,c);}
 

int A1, A2, A3, ans;
int main(){
  scanf("%d%d%d", &A1, &A2, &A3);
  ans = max3(A1, A2, A3) - min3(A1, A2, A3);
  printf("%d\n", ans); 
}

Compiler output:
main.c: In function 'max3':
main.c:3:54: error: expected ')' before ';' token
    3 | int max3(int a, int b, int c){return max2(a,max2(b,c);}
      |                                          ~           ^
      |                                                      )
main.c:3:55: error: expected ';' before '}' token
    3 | int max3(int a, int b, int c){return max2(a,max2(b,c);}
      |                                                       ^
      |                                                       ;
main.c: In function 'min3':
main.c:4:54: error: expected ')' before ';' token
    4 | int min3(int a, int b, int c){return min2(a,min2(b,c);}
      |                                          ~           ^
      |                                                      )
main.c:4:55: error: expected ';' before '}' token
    4 | int min3(int a, int b, int c){return min2(a,min2(b,c);}
      |                                                       ^
      |                                                       ;
main.c: In function 'main':
main.c:9:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    9 |   scanf("%d%d%d", &A1, &A2, &A3);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int max2(int a, int b){return a<b?b:a;}
main.c:9:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    9 |   scanf("%d%d%d", &A1, &A2, &A3);
      |   ^~~~~
main.c:9:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:11:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   11 |   printf("%d\n", ans);
      |   ^~~~~~
main.c:11:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:11:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:11:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

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

int main()
{
    int a,b,c;
    cin >> a >> b >> c;
    minc = min({a,b,c});
    maxc = max({a,b,c});
    mid = a + b + c - minc - maxc;
    cout << (maxc - mid) + (mid - minc) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'minc' was not declared in this scope
    8 |     minc = min({a,b,c});
      |     ^~~~
a.cc:9:5: error: 'maxc' was not declared in this scope
    9 |     maxc = max({a,b,c});
      |     ^~~~
a.cc:10:5: error: 'mid' was not declared in this scope
   10 |     mid = a + b + c - minc - maxc;
      |     ^~~
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        int[] A = new int[3];

        for(int i = 0; i < 3; i++ ) A[i] = sc.nextInt();
        
        Array.sort(A);
        int ans = A[2] - A[0];
        
        System.out.println(ans);
    }
}


Compiler output:
Main.java:11: error: cannot find symbol
        Array.sort(A);
        ^
  symbol:   variable Array
  location: class Main
1 error
Language: C++

#include <iostream>
#include <vector>
#include <cstdlib>
#include <cmath>
using namespace std;


int main (int argc, char const *argv[])
{
    int A,B,C;
    cin>>A>>B>>C;

    cout<<max({A,B,C})-min({A,B,C})<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:13:14: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   13 |     cout<<max({A,B,C})-min({A,B,C})<<endl;
      |           ~~~^~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 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:   candidate expects 2 arguments, 1 provided
/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, 1 provided
a.cc:13:27: error: no matching function for call to 'min(<brace-enclosed initializer list>)'
   13 |     cout<<max({A,B,C})-min({A,B,C})<<endl;
      |                        ~~~^~~~~~~~~
/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:   candidate expects 2 arguments, 1 provided
/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, 1 provided
Language: C++

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

int main() {
  int a,b,c;
  cin>>a>>b>>c;
  cout<<max(a,b,c)-min(a,b,c)<<endl;
}


Compiler output:
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: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:7:12:   required from here
    7 |   cout<<max(a,b,c)-min(a,b,c)<<endl;
      |         ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:7:23:   required from here
    7 |   cout<<max(a,b,c)-min(a,b,c)<<endl;
      |                    ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;

int main(){
  vector<int> a(3);
  
  for(int i = 0; i < 3; i++){
	int b;
    cin >> b;
    a.push_back(b);
  }
  sort(a.begin(), a.end());
  
  int sum = 0;
  for(int i = 1 i > -1; i--){
	sum += abs(a[i] - a[i+1]);
  }
  
  cout << sum << endl;
  return 0;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |   sort(a.begin(), a.end());
      |   ^~~~
      |   short
a.cc:16:16: error: expected ';' before 'i'
   16 |   for(int i = 1 i > -1; i--){
      |                ^~
      |                ;
Language: C++

#include"bits/stdc++.h"

using namespace std;

int main() {
	int A1, A2, A3;
	cin >> A1 >> A2 >> A3;
	cout << max(A1,A2,A3)-min(A1,A2,A3) << endl;

	return 0;
}

Compiler output:
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: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:8:13:   required from here
    8 |         cout << max(A1,A2,A3)-min(A1,A2,A3) << endl;
      |                 ~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:8:27:   required from here
    8 |         cout << max(A1,A2,A3)-min(A1,A2,A3) << endl;
      |                               ~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i <= n; i++)
#define FORR(i, m, n) for(int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)

ll mod = 1e9 + 7;

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

  int a, b, c;
  cin >> a >> b >> c;
  int t = min(a, min(b, c));
  int ans = - a + max(b, c)
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:3: error: expected ',' or ';' before 'cout'
   22 |   cout << ans << endl;
      |   ^~~~
Language: C++

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

int main () {
  vector<int> line(3) ;
  for ( int i = 0 ; i < 3 ; i++ ) {
    cin >> line.at(i) ;
  }
  sort(line.begin() , line.at.end() ) ;
  
  cout << line.at(2) - line.at(0) << endl ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:28: error: invalid use of member function 'std::vector<int>::at' (did you forget the '()' ?)
    9 |   sort(line.begin() , line.at.end() ) ;
      |                       ~~~~~^~
Language: C++

#include<iostream>
#include<cmath>

using namespace std;
int main(void){
    int a,b,c,d,e,f,g;
    cin>>a>>b>>c;
    d=abs(a-b);
    e=abs(a-c);
    f=abs(b-c);
    g=(min)({d+e,e+f,f+d});
    cout<<g<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: no matching function for call to 'min(<brace-enclosed initializer list>)'
   11 |     g=(min)({d+e,e+f,f+d});
      |       ~~~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/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:   candidate expects 2 arguments, 1 provided
/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, 1 provided
Language: C++

#include <iostream>
#include <algorithm>
#include <math.h>
#include <string>
using namespace std;
int main(){
  int A, B, C, D ,E ,F;
  string S,Sa,Sb,Sc;
  cin >> A >> B >> C;
  D = max(A, B , C);
  E = min(A, B, C);
  cout << D - E << endl;
        return 0;
}

Compiler output:
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:10:10:   required from here
   10 |   D = max(A, B , C);
      |       ~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:11:10:   required from here
   11 |   E = min(A, B, C);
      |       ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
  vector<int> task(3);
  for (int i = 0; i < 3; i++) {
    cin >> task[i];
  }
  sort(task.begin(), task.end());
  cout << task[2] - task[0] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'vector' was not declared in this scope
    5 |   vector<int> task(3);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:5:10: error: expected primary-expression before 'int'
    5 |   vector<int> task(3);
      |          ^~~
a.cc:7:12: error: 'task' was not declared in this scope
    7 |     cin >> task[i];
      |            ^~~~
a.cc:9:8: error: 'task' was not declared in this scope
    9 |   sort(task.begin(), task.end());
      |        ^~~~
a.cc:9:3: error: 'sort' was not declared in this scope; did you mean 'short'?
    9 |   sort(task.begin(), task.end());
      |   ^~~~
      |   short
Language: C++

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

int main() {
  int vector<int> a;
  cin >> a.at(0) >>a.at(1)>>a.at(2);
  
  sort(a.begin(), a.end());
  
  cout << a.at(2)-a.at(0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:19: error: invalid declarator before 'a'
    5 |   int vector<int> a;
      |                   ^
a.cc:6:10: error: 'a' was not declared in this scope
    6 |   cin >> a.at(0) >>a.at(1)>>a.at(2);
      |          ^
Language: C++

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

int main() {
  int vector<int> a;
  cin >> a.at(0) >>a.at(1)>>a.at(2);
  
  sort(a.begin(), a.end());
  
  cout << a.at(2)-a.at(0)
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:19: error: invalid declarator before 'a'
    5 |   int vector<int> a;
      |                   ^
a.cc:6:10: error: 'a' was not declared in this scope
    6 |   cin >> a.at(0) >>a.at(1)>>a.at(2);
      |          ^
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <cmath>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define REP(i,n) for(int i=0;i<n;i++)
#define pb push_back


// vectorの中身をcout << vs;で表示
template <class T>
ostream &operator<<(ostream &o, const vector<T> &v)
{
    o << "{";
    for (int i = 0; i < (int)v.size(); i++) o << (i > 0 ? ", " : "") << v[i];
    o << "}";
    return o;
}

int cost(int a, int b, int c) {
	return abs(a - b) + abs(b - c);
}

int main(void) {
	// cin, coutの結びつきを解除し、速くする
	cin.tie(0);
   	ios::sync_with_stdio(false);

	int a, b, c;
	cin >> a >> b >> c;
	vi vs;

	vs.pb(cost(a, b, c));
	vs.pb(cost(a, c, b));
	vs.pb(cost(b, a, c));
	vs.pb(cost(b, c, a));
	vs.pb(cost(c, a, b));
	vs.pb(cost(c, b, a));

	sort(vs.begin(), vs.end());

	cout << vs.at(0) << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:49:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   49 |         sort(vs.begin(), vs.end());
      |         ^~~~
      |         sqrt
Language: C

#include<stdio.h>
int main(void){
  	int yjsnpi[3];
 	int max=114514;
  	int min=-810;
  	for(int i=0;i<3;i++){
      scanf("%d",&yjsnpi[i]);
      if(yjsnpi[i]<max)max=yjsnpi[i];
      if(yjsnpi[i]>min)min=yjsnpi[i];
    }
  printfY("%d\n",max-min);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:3: error: implicit declaration of function 'printfY'; did you mean 'printf'? [-Wimplicit-function-declaration]
   11 |   printfY("%d\n",max-min);
      |   ^~~~~~~
      |   printf
Language: C++

#include<iostream>
#include<algorithm>
#include<math.h>
#include<string>
using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define ci cin >>
#define co cout <<

int main() {
	int A[3];
	ci A[0] >> A[1] >> A[2];
	co max(A[0],A[1],A[2]) - min(A[0], A[1], A[2]);
	return 0;

}

Compiler output:
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:15:8:   required from here
   15 |         co max(A[0],A[1],A[2]) - min(A[0], A[1], A[2]);
      |            ~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:15:30:   required from here
   15 |         co max(A[0],A[1],A[2]) - min(A[0], A[1], A[2]);
      |                                  ~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
 
int main()
{
  int a, b, c;
  cin >> a >> b >> c;
  int m = max(max(a, b), c);
  int n = min(min(a, b), c);
  cout << m - n << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: expected '}' at end of input
   11 |   cout << m - n << endl;
      |                         ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
 
int main()
{
  cin a, b, c;
  m = max(max(a, b), c);
  n = min(min(a, b), c);
  cout << m - n << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:6: error: expected ';' before 'a'
    7 |   cin a, b, c;
      |      ^~
      |      ;
a.cc:8:3: error: 'm' was not declared in this scope; did you mean 'tm'?
    8 |   m = max(max(a, b), c);
      |   ^
      |   tm
a.cc:8:15: error: 'a' was not declared in this scope
    8 |   m = max(max(a, b), c);
      |               ^
a.cc:8:18: error: 'b' was not declared in this scope
    8 |   m = max(max(a, b), c);
      |                  ^
a.cc:8:22: error: 'c' was not declared in this scope
    8 |   m = max(max(a, b), c);
      |                      ^
a.cc:9:3: error: 'n' was not declared in this scope
    9 |   n = min(min(a, b), c);
      |   ^
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
  cin a, b, c;
  m = max(max(a, b), c);
  n = min(min(a, b), c);
  cout << m - n << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:7:6: error: expected ';' before 'a'
    7 |   cin a, b, c;
      |      ^~
      |      ;
a.cc:8:3: error: 'm' was not declared in this scope; did you mean 'tm'?
    8 |   m = max(max(a, b), c);
      |   ^
      |   tm
a.cc:8:15: error: 'a' was not declared in this scope
    8 |   m = max(max(a, b), c);
      |               ^
a.cc:8:18: error: 'b' was not declared in this scope
    8 |   m = max(max(a, b), c);
      |                  ^
a.cc:8:22: error: 'c' was not declared in this scope
    8 |   m = max(max(a, b), c);
      |                      ^
a.cc:9:3: error: 'n' was not declared in this scope
    9 |   n = min(min(a, b), c);
      |   ^
a.cc:10:25: error: expected '}' at end of input
   10 |   cout << m - n << endl;
      |                         ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: Java

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in);) {
            solve(sc);
        }
    }

    public static void solve(Scanner sc) {
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int ab = Math.abs(a - b);
        int bc = Math.abs(b - c);
        int ca = Math.abs(c - a);
        int min = Mth.min(a, b);
        min = Math.min(min, c);
        int max = Math.max(a, b);
        max = Math.max(max, c);

        if (min == a && max == b) {
            System.out.println(ca +bc);
        } else if (min == b && max == c) {
            System.out.println(ab + ca);
        } else if (min == c && max == a) {
            System.out.println(bc + ab);
        }
    }
}

Compiler output:
Main.java:17: error: cannot find symbol
        int min = Mth.min(a, b);
                  ^
  symbol:   variable Mth
  location: class Main
1 error
Language: Java

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in);) {
            solve(sc);
        }
    }

    public static void solve(Scanner sc) {
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int ab = Math.abs(a - b);
        int bc = Math.abs(b - c);
        int ca = Math.abs(c - a);
        int min = Mth.min(a, b);
        min = Math.min(min, c);
        int max = Mth.max(a, b);
        max = Math.max(max, c);

        if (min == a && max == b) {
            System.out.println(ca +bc);
        } else if (min == b && max == c) {
            System.out.println(ab + ca);
        } else if (min == c && max == a) {
            System.out.println(bc + ab);
        }
    }
}

Compiler output:
Main.java:17: error: cannot find symbol
        int min = Mth.min(a, b);
                  ^
  symbol:   variable Mth
  location: class Main
Main.java:19: error: cannot find symbol
        int max = Mth.max(a, b);
                  ^
  symbol:   variable Mth
  location: class Main
2 errors
Language: C

#include<stdio.h>
int A1,A2,A3;
scanf("%d%d%d",&A1,&A2,&A3);
if(A1>=A2>=A3)printf("%d\n",A1-A3);
if(A2>=A3>=A1)printf("%d\n",A2-A1);
if(A3>=A1>=A2)printf("%d\n",A3-A2);
if(A1>=A3>=A2)printf("%d\n",A1-A2);
if(A2>=A1>=A3)printf("%d\n",A2-A3);
if(A3>=A2>=A1)printf("%d\n",A3-A1);
return 0;
}


Compiler output:
main.c:3:7: error: expected declaration specifiers or '...' before string constant
    3 | scanf("%d%d%d",&A1,&A2,&A3);
      |       ^~~~~~~~
main.c:3:16: error: expected declaration specifiers or '...' before '&' token
    3 | scanf("%d%d%d",&A1,&A2,&A3);
      |                ^
main.c:3:20: error: expected declaration specifiers or '...' before '&' token
    3 | scanf("%d%d%d",&A1,&A2,&A3);
      |                    ^
main.c:3:24: error: expected declaration specifiers or '...' before '&' token
    3 | scanf("%d%d%d",&A1,&A2,&A3);
      |                        ^
main.c:4:1: error: expected identifier or '(' before 'if'
    4 | if(A1>=A2>=A3)printf("%d\n",A1-A3);
      | ^~
main.c:5:1: error: expected identifier or '(' before 'if'
    5 | if(A2>=A3>=A1)printf("%d\n",A2-A1);
      | ^~
main.c:6:1: error: expected identifier or '(' before 'if'
    6 | if(A3>=A1>=A2)printf("%d\n",A3-A2);
      | ^~
main.c:7:1: error: expected identifier or '(' before 'if'
    7 | if(A1>=A3>=A2)printf("%d\n",A1-A2);
      | ^~
main.c:8:1: error: expected identifier or '(' before 'if'
    8 | if(A2>=A1>=A3)printf("%d\n",A2-A3);
      | ^~
main.c:9:1: error: expected identifier or '(' before 'if'
    9 | if(A3>=A2>=A1)printf("%d\n",A3-A1);
      | ^~
main.c:10:1: error: expected identifier or '(' before 'return'
   10 | return 0;
      | ^~~~~~
main.c:11:1: error: expected identifier or '(' before '}' token
   11 | }
      | ^
Language: C++

#include<iostream>
#include<iostream>
using namespace std;
int main(){
int a,b,c;
cin >> a >> b >> c;
int ans = max({a,b,c}) - min({a,b,c});
cout << ans << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
    7 | int ans = max({a,b,c}) - min({a,b,c});
      |           ~~~^~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 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:   candidate expects 2 arguments, 1 provided
/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, 1 provided
a.cc:7:29: error: no matching function for call to 'min(<brace-enclosed initializer list>)'
    7 | int ans = max({a,b,c}) - min({a,b,c});
      |                          ~~~^~~~~~~~~
/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:   candidate expects 2 arguments, 1 provided
/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, 1 provided
Language: C++

#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vii = vector<vector<int>>;
using vl = vector<ll>;
using vll = vector<vector<ll>>;
using pii = pair<int,int>;
#define FOR(i,a,b) for(ll i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(obj) (obj).begin(), (obj).end()
#define pb push_back
const double PI = acos(-1);
const double EPS = 1e-10;
const ll MOD = 1000000007;
int main(){
 int a,b,c;
 cin >> a >> b >> c;
 vi d(3);
 d[0]=abs(b-a);d[1]=abs(c-a); d[2]=abs(c-b);
 sort(ALL(d));
 cout << d[0]+d[1] << endl;
}
}

Compiler output:
a.cc:25:1: error: expected declaration before '}' token
   25 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)  
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)  
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

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

int main(){

  int a,b,c;
  cin>>a>>b>>c;
  int x,y;
  x = max(c,max(a,b));
  y = min(c,min(a,b));
  cout<<x-y<<endl;


  return 0;
}> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

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

int main(){

  int a,b,c;
  cin>>a>>b>>c;
  int x,y;
  x = max(c,max(a,b));
  y = min(c,min(a,b));
  cout<<x-y<,endl;


  return 0;
}

Compiler output:
a.cc:13:26: error: stray '#' in program
   13 | typedef pair<llong, llong#include <bits/stdc++.h>
      |                          ^
a.cc:23:17: error: template argument 2 is invalid
   23 | using namespace std;
      |                 ^~~
a.cc:13:1: warning: 'typedef' was ignored in this declaration
   13 | typedef pair<llong, llong#include <bits/stdc++.h>
      | ^~~~~~~
a.cc:43:2: error: expected unqualified-id before '>' token
   43 | }> LP;
      |  ^
a.cc:47:5: error: redefinition of 'int dy []'
   47 | int dy[]={0, 0, 1, -1};
      |     ^~
a.cc:29:5: note: 'int dy [4]' previously defined here
   29 | int dy[]={0, 0, 1, -1};
      |     ^~
a.cc:48:5: error: redefinition of 'int dx []'
   48 | int dx[]={1, -1, 0, 0};
      |     ^~
a.cc:30:5: note: 'int dx [4]' previously defined here
   30 | int dx[]={1, -1, 0, 0};
      |     ^~
a.cc:50:5: error: redefinition of 'int main()'
   50 | int main(){
      |     ^~~~
a.cc:32:5: note: 'int main()' previously defined here
   32 | int main(){
      |     ^~~~
a.cc: In function 'int main()':
a.cc:57:13: error: expected primary-expression before ',' token
   57 |   cout<<x-y<,endl;
      |             ^
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)  
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

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

int main(){

  int a,b,c;
  cin>>a>>b>>c;
  int x,y;
  x = max(c,max(a,b));
  y = min(c,min(a,b));
  cout<<x-y<,endl;


  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:13: error: expected primary-expression before ',' token
   27 |   cout<<x-y<,endl;
      |             ^
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<functional>
#include<vector>
#include<queue>
#include<stack>
#include<set>
#include<map>
using namespace std;
#define MOD 1000000007
#define f(i,n) for(int i=0;i<int(n);i++)
#define N 200000

int main(){	
	int a[3];
	cin>>a[0]>>a[1]>>a[2];

	sort(a,a+3);
	cout<<a[2]-a[0]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'cin' was not declared in this scope
   19 |         cin>>a[0]>>a[1]>>a[2];
      |         ^~~
a.cc:12:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
   11 | #include<map>
  +++ |+#include <iostream>
   12 | using namespace std;
a.cc:22:9: error: 'cout' was not declared in this scope
   22 |         cout<<a[2]-a[0]<<endl;
      |         ^~~~
a.cc:22:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:22:26: error: 'endl' was not declared in this scope
   22 |         cout<<a[2]-a[0]<<endl;
      |                          ^~~~
a.cc:12:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
   11 | #include<map>
  +++ |+#include <ostream>
   12 | using namespace std;
Language: C++

function Main(input){
  var arr = input.split(" ").map(x => parseInt(x,10));
  var a = Math.max.apply(null,arr);
  var b = Math.min.apply(null,arr);
  console.log(a - b);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
function Main(input){
  var arr = input.split(" ").map(x => parseInt(x,10));
  var a = Math.max.apply(null,arr);
  var b = Math.min.apply(null,arr);
  console.log(a - b);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Compiler output:
a.cc:1:1: error: 'function' does not name a type; did you mean 'union'?
    1 | function Main(input){
      | ^~~~~~~~
      | union
a.cc:8:5: error: expected constructor, destructor, or type conversion before '(' token
    8 | Main(require("fs").readFileSync("/dev/stdin", "utf8"));
      |     ^
a.cc:9:1: error: 'function' does not name a type; did you mean 'union'?
    9 | function Main(input){
      | ^~~~~~~~
      | union
a.cc:15:5: error: expected constructor, destructor, or type conversion before '(' token
   15 | Main(require("fs").readFileSync("/dev/stdin", "utf8"));
      |     ^
Language: C++

#include <iostream>
using namespace std;
int main() {
  int a,b;
  cin >>a>>b>>c;
  if(a>b && b>>c) cout<<a+b-2*c<<endl;
  if(a>c && c>b) cout<<a+c-2*b<<endl;
  if(b>c && c>a) cout<<b+c-2*a<<endl;
  if(b>a && a>c) cout<<a+c-2*c<<endl;
    if(a>c && c>b) cout<<b+a-2*b<<endl;
    if(a>c && c>b) cout<<a+c-2*b<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:15: error: 'c' was not declared in this scope
    5 |   cin >>a>>b>>c;
      |               ^
Language: C++

#include <iostream>

using namespace std;

int main() {
    int a1, a2, a3;
    int x, y, z;
    cin >> a1 >> a2 >> a3;

    if (a1 > a2) {
        x = a1;
        a1 = a2;
        a2 = m;
    }
    if (a2 > a3) {
        y = a2;
        a2 = a3;
        a3 = m;
    }
    if (a1 > a3) {
        z = a1;
        a1 = a2;
        a2 = m;
    }

    int t = (a3 - a2) + (a2 - a1);
    cout << t;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: 'm' was not declared in this scope
   13 |         a2 = m;
      |              ^
a.cc:18:14: error: 'm' was not declared in this scope
   18 |         a3 = m;
      |              ^
a.cc:23:14: error: 'm' was not declared in this scope
   23 |         a2 = m;
      |              ^
Language: C++

#include <iostream>

using namespace std;

int main() {
    int a1, a2, a3;
    cin >> a1 >> a2 >> a3;

    if (a1 > a2) {
        m = a1;
        a1 = a2;
        a2 = m;
    }
    if (a2 > a3) {
        m = a2;
        a2 = a3;
        a3 = m;
    }
    if (a1 > a3) {
        m = a1;
        a1 = a2;
        a2 = m;
    }

    int t = (a3 - a2) + (a2 - a1);
    cout << t;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'm' was not declared in this scope; did you mean 'tm'?
   10 |         m = a1;
      |         ^
      |         tm
a.cc:15:9: error: 'm' was not declared in this scope; did you mean 'tm'?
   15 |         m = a2;
      |         ^
      |         tm
a.cc:20:9: error: 'm' was not declared in this scope; did you mean 'tm'?
   20 |         m = a1;
      |         ^
      |         tm
Language: C++

#include <iostream>

using namespace std;

int main() {
    int a1, a2, a3;
    cin >> a1 >> a2 >> a3;

    if (a1 > a2) {
        m = a1;
        a1 = a2;
        a2 = m;
    }
    if (a2 > a3) {
        m = a1;
        a2 = a3;
        a3 = m;
    }
    if (a1 > a3) {
        m = a1;
        a1 = a2;
        a2 = m;
    }

    int t = (a3 - a2) + (a2 - a1);
    cout << t;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'm' was not declared in this scope; did you mean 'tm'?
   10 |         m = a1;
      |         ^
      |         tm
a.cc:15:9: error: 'm' was not declared in this scope; did you mean 'tm'?
   15 |         m = a1;
      |         ^
      |         tm
a.cc:20:9: error: 'm' was not declared in this scope; did you mean 'tm'?
   20 |         m = a1;
      |         ^
      |         tm
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
    int a,b,c;
    cin>>a>>b>>c;

    int ans[3];

    //|a-b|+|b-c|が答えで中間値bは相殺される
    cout<<(max(a,max(b,c)-min(a,min(b,c)))<<endl;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:43: error: invalid operands of types 'const int' and '<unresolved overloaded function type>' to binary 'operator<<'
   11 |     cout<<(max(a,max(b,c)-min(a,min(b,c)))<<endl;
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
a.cc:11:49: error: expected ')' before ';' token
   11 |     cout<<(max(a,max(b,c)-min(a,min(b,c)))<<endl;
      |           ~                                     ^
      |                                                 )
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main() {
  int a[3];
  cin>>a[0]>>a[1]>>a[2];
  
  sort(a,a+N);
  
  cout<<(a[2]-a[1])+(a[1]-a[0])<<endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: 'N' was not declared in this scope
   10 |   sort(a,a+N);
      |            ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main() {
  int a[3];
  cin>>a[0]>>a[1]>>a[2];
  
  sort(a,a+N,greater<int>());
  
  cout<<(a[2]-a[1])+(a[1]-a[0])<<endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: 'N' was not declared in this scope
   10 |   sort(a,a+N,greater<int>());
      |            ^
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main()
{
  vector<int> a(3);
  for(int i = 0; i <= 2; ++i) {
    cin >> a[i];
    sort(a.begin(), a.end(), greater<int>);
  }
  int count = 0;
  for(int i = 0;i <= 1; ++i){
    int div = a[i + 1] - a[i];
    count += div;
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:42: error: expected primary-expression before ')' token
   10 |     sort(a.begin(), a.end(), greater<int>);
      |                                          ^
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main()
{
  vector<int> a(3);
  for(int i = 0; i <= 2; ++i) {
    cin >> a[i];
    sort(a);
  }
  int count = 0;
  for(int i = 0;i <= 1; ++i){
    int div = a[i+1] -a[i];
    count += div;
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: no matching function for call to 'sort(std::vector<int>&)'
   10 |     sort(a);
      |     ~~~~^~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 1 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 1 provided
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main()
{
  vector<int> a(3);
  for(int i = 0; i <= 2; ++i) {
    cin >> a[i];
    a.sort();
  }
  int count = 0;
  for(int i = 0;i <= 1; ++i){
    int div = a[i+1] -a[i];
    count += div;
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: 'class std::vector<int>' has no member named 'sort'
   10 |     a.sort();
      |       ^~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main()
{
  vector<int> a(3);
  for(int i = 0; i <= 2; ++i) {
    cin >> a[i];
    sort(a[i]);
  }
  int count = 0;
  for(int i = 0;i <= 1; ++i){
    int div = a[i+1] -a[i];
    count += div;
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: no matching function for call to 'sort(__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   10 |     sort(a[i]);
      |     ~~~~^~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 1 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 1 provided