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

/**Author:Sagor*/

#include<bits/stdc++.h>
#include<numeric>

using namespace std;
#define pri(n)          printf("%d\n",n)
#define prll(n)         printf("%lld\n",n)
#define prd(n)          printf("%lf\n",n)
#define scll(n)         scanf("%lld",&n)
#define sci(n)          scanf("%d",&n)
#define scd(n)          scanf("%lf",&n)
#define pi              acos(-1)//inbuilt M_PI
#define ll              long long
#define pb              push_back
#define vsort(v)        sort(v.begin(),v.end())
#define asort(n)        sort(ar,ar+n)
#define yes             cout<<"Yes\n"
#define no              cout<<"No\n"
#define for1(i,n)       for(i=1;i<=n;i++)
#define for0(i,n)       for(i=0;i<n;i++)
#define mod             1000000007
#define watch(x)        cout << (#x) << " is " << (x) <<"\n";

/** for print with quote \"hello world\"
    1LL is used to convert into long long*/


int main()
{
    /*freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);*/
    /**ios_base::sync_with_stdio(false);
    cin.tie(NULL);/**Dont't use scanf of printf*/
    ll n,sum=0,i,a;
    cin>>n;
    for0(i,n){
        cin>>a;
        sum+=(a-1);
    }
    cout<<sum<<endl;


    return;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
   44 |     return;
      |     ^~~~~~
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);
}


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:14:   required from here
    7 |   cout << max(A,B,C)-min(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:7:25:   required from here
    7 |   cout << max(A,B,C)-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 <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;

int main() {
  int a1,a2,a3;cin>>a1>>a2>>a3;
  cout << abs(a1-a2)+abs(a2-a3)+abs(a1-a3)-max(max(abs(a1-a2),abs(a1-a3)),abs(a2-a3) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:86: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
    8 |   cout << abs(a1-a2)+abs(a2-a3)+abs(a1-a3)-max(max(abs(a1-a2),abs(a1-a3)),abs(a2-a3) << endl;
      |                                                                           ~~~~~~~~~~~^~~~~~~
Language: C++

#include<bits?stdc++.h>
using namespace std;
int main(){
  int a[3];
  cin >> a[0] >> a[1] >> a[2];
  sort(a.begin(),a.end());
  cout << (a[2] - a[1]) + (a[1] - a[0]) << endl;
}

Compiler output:
a.cc:1:9: fatal error: bits?stdc++.h: No such file or directory
    1 | #include<bits?stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#include <math.h>
#define rep(i,n) for (int i=0;i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:49: error: expected primary-expression before '<' token
   12 |     cout << max(a,max(b,c)) - min(a,min(b,c)) <<< endl;
      |                                                 ^
Language: C++

#include<bits.stdc++.h>
using namespace std;
int main(){
  int a,b,c;
  cin>>a>>b>>c;
  int ans;
  if(a>=b&&a>=c){
    ans=min(b+abs(b-c),c+abs(b-c));
  }
  else if(b>=a&&b>=c){
    ans=min(a+abs(a-c),c+abs(a-c));
  }
  else{
    ans=min(a+abs(a-b),b+abs(a-b));
  }
  cout<<ans<<endl;
}

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

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

int main(){
  int a1, a2, a3;
  cin >> a1 >> a2 >> a3;
  
  int m = max(a1, a2, a3);
  int s = min(a1, a2, a3);
  
  int ans = m - s;
  cout << ans << 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:8:14:   required from here
    8 |   int m = max(a1, a2, a3);
      |           ~~~^~~~~~~~~~~~
/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:9:14:   required from here
    9 |   int s = min(a1, a2, a3);
      |           ~~~^~~~~~~~~~~~
/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;

int main(){
  int a = a1, a2, a3;
  cin >> a1 >> a2 >> a3;
  
  int m = max(a1, a2, a3);
  int s = min(a1, a2, a3);
  
  int ans = m - s;
  cout << ans << endl;
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: error: 'a1' was not declared in this scope; did you mean 'a'?
    5 |   int a = a1, a2, a3;
      |           ^~
      |           a
a.cc:6:16: error: 'a2' was not declared in this scope; did you mean 'a'?
    6 |   cin >> a1 >> a2 >> a3;
      |                ^~
      |                a
a.cc:6:22: error: 'a3' was not declared in this scope; did you mean 'a'?
    6 |   cin >> a1 >> a2 >> a3;
      |                      ^~
      |                      a
Language: C++

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

int main() {
  vactor<int> a;
  rep(i, 3) cin >> a.at(i);
  sort(a.begin(), a.end());
  cout << a.at(2) - a.at(0) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vactor' was not declared in this scope
    6 |   vactor<int> a;
      |   ^~~~~~
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vactor<int> a;
      |          ^~~
a.cc:7:20: error: 'a' was not declared in this scope
    7 |   rep(i, 3) cin >> a.at(i);
      |                    ^
a.cc:8:8: error: 'a' was not declared in this scope
    8 |   sort(a.begin(), a.end());
      |        ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:28: error: expected ';' before '}' token
   12 |     count+=abs(A[i-1]-A[i])
      |                            ^
      |                            ;
   13 |   }
      |   ~
Language: C++

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

int main(){
    vector<int> a(3);
    rep(i,n) cin >> a[i];
    sort(a.begin(),a.end());
    int ans = 0;
    ans += abs(a[1] - a[0]);
    ans += abs(a[2] - a[1]);
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: 'n' was not declared in this scope
    9 |     rep(i,n) cin >> a[i];
      |           ^
a.cc:2:37: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i = 0;i < (n);i++)
      |                                     ^
Language: C++

#include<stdio.h>
#include<algorithm>
int main(void){
  int a1,a2,a3;
  scanf("%df %d %d",&a1,&a2,&a3);
  int ans=max({a1,a2,a3})-min({a1,a2,a3});
  printf("%d",ans);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:11: error: 'max' was not declared in this scope; did you mean 'std::max'?
    6 |   int ans=max({a1,a2,a3})-min({a1,a2,a3});
      |           ^~~
      |           std::max
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:6:27: error: 'min' was not declared in this scope; did you mean 'std::min'?
    6 |   int ans=max({a1,a2,a3})-min({a1,a2,a3});
      |                           ^~~
      |                           std::min
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define ll long long int

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


  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'ciut' was not declared in this scope
   11 |   ciut<<max({a,b,c})-min({a,b,c})<<endl;
      |   ^~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:13: error: expected initializer before 'ans'
    5 |     int a[3]ans;cin>>a[0]>>a[1]>>a[2];
      |             ^~~
a.cc:5:22: error: 'a' was not declared in this scope
    5 |     int a[3]ans;cin>>a[0]>>a[1]>>a[2];
      |                      ^
a.cc:7:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
    7 |     ans=a[2]-a[0];
      |     ^~~
      |     abs
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:13: error: expected initializer before 'ans'
    5 |     int a[3]ans;cin>>a[0]>>a[1]>>a[2];
      |             ^~~
a.cc:5:22: error: 'a' was not declared in this scope
    5 |     int a[3]ans;cin>>a[0]>>a[1]>>a[2];
      |                      ^
a.cc:7:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
    7 |     ans=a[2]--a[0];
      |     ^~~
      |     abs
Language: C++

#include <iostream>

int main() {
    int A, B, C;
    std::cin >> A >> B >> C;
  
    std::cout << std::max({A, B, C}) - std::min({A, B, C});
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:26: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
    7 |     std::cout << std::max({A, B, C}) - std::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:48: error: no matching function for call to 'min(<brace-enclosed initializer list>)'
    7 |     std::cout << std::max({A, B, C}) - std::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<iostream>
using namespace std;
#include<vector>
#include<algorithm>
int main()
{
  ios_base::sync_stdio(0);
  cin.tie(0);
  vector<int> v;
  int a;
  for(int i =0; i<3; i++)
  {
    cin>>a;
    v.push_back(a);
  }
  int sum = 0;
  sort(v.begin(), v.end());
  for(int i = 0; i<2; i++)
  {
    sum = sum + (v[i+1] - v[i]);
  }
  cout<<sum;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: 'sync_stdio' is not a member of 'std::ios_base'
    7 |   ios_base::sync_stdio(0);
      |             ^~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c;
  cin >> a >> b >> c;
  cout << min(min(abs(a-b),abs(b-c)),abs(c-a));
}
/*
  for(int i=0;i<4;i++){
    if(s[i]=='-')o----;
    o++;
  }
  cout << o;
}


Compiler output:
a.cc:8:1: error: unterminated comment
    8 | /*
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
   vector<int> a(n);
   for (int i = 0; i < 3; i++) {
    cin >> a.at(i);
  }
  
  sort(a.begin(), a.end());
 
reverse(a.begin(), a.end());
 
  int sum=0;
  for (int i = 0; i < 3; i++) {
 sum += a[i+1] -a[i];
}
cout<<sum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:18: error: 'n' was not declared in this scope
    5 |    vector<int> a(n);
      |                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
   vector<int> a(n);
   for (int i = 0; i < n; i++) {
    cin >> a.at(i);
  }
  
  sort(a.begin(), a.end());

reverse(a.begin(), a.end());

  int sum=0;
  for (int i = 0; i < 3; i++) {
 sum += a[i+1] -a[i]
}
cout<<sum<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:18: error: 'n' was not declared in this scope
    5 |    vector<int> a(n);
      |                  ^
a.cc:16:21: error: expected ';' before '}' token
   16 |  sum += a[i+1] -a[i]
      |                     ^
      |                     ;
   17 | }
      | ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
using p=pair<int,int>;
#define int long long
#define rep(i,N) for(int i=0;i<N;i++)

signed main(){
  int A,B,C;
  cin>>A>>B>>C;
  int ans=mx({A,B,C})-min({A,B,C});
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: 'mx' was not declared in this scope
   10 |   int ans=mx({A,B,C})-min({A,B,C});
      |           ^~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: 'n' was not declared in this scope
    6 |   for(int i=0;i<n;i++) cin>>a[i];
      |                 ^
Language: Java

#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int c,a[3],n,b=0,i,j;
    //scanf("%d%d%d",&a,&b,&c);
    for(i=0;i<3;i++)
    {
        cin>>a[i];
    }
    sort(a,a+3);
    for(i=0;i<2;i++)
    {
        b=b+abs(a[i]-a[i+1]);
    }
    cout<<b<<"\n";
    return 0;
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include<iostream>
^
Main.java:2: error: illegal character: '#'
#include<bits/stdc++.h>
^
Main.java:6: error: not a statement
    int c,a[3],n,b=0,i,j;
               ^
Main.java:6: error: not a statement
    int c,a[3],n,b=0,i,j;
                     ^
Main.java:6: error: not a statement
    int c,a[3],n,b=0,i,j;
                       ^
Main.java:10: error: not a statement
        cin>>a[i];
           ^
Main.java:17: error: not a statement
    cout<<b<<"\n";
           ^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
int main()
^
  (use --enable-preview to enable unnamed classes)
Main.java:6: error: ']' expected
    int c,a[3],n,b=0,i,j;
            ^
Main.java:6: error: ';' expected
    int c,a[3],n,b=0,i,j;
                ^
Main.java:6: error: ';' expected
    int c,a[3],n,b=0,i,j;
                    ^
Main.java:6: error: ';' expected
    int c,a[3],n,b=0,i,j;
                      ^
12 errors
Language: C++

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

using namespace std;

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

    cout << vec[2]-vec[0] << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:33: error: expected ';' before 'cout'
   13 |     sort(vec.begin(), vec.end())
      |                                 ^
      |                                 ;
   14 | 
   15 |     cout << vec[2]-vec[0] << endl;
      |     ~~~~
Language: C++

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

int main()
{
    int A,B,C;
    cin >> A >> B >> C;
    vector<int> v {A,B,C};
    sort(v.begin(),v.end());
    string one = to_string(v[2]);
    string two = to_string(v[1]);
    int three = v[0];
    string onetwo = one + two;
    cout << stoi(onetwo) + three;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |     sort(v.begin(),v.end());
      |     ^~~~
      |     short
Language: C++

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

int main()
{
    int A,B,C;
    cin >> A >> B >> C;
    vector<int> v {A,B,C};
    sort(v.begin(),v.end());
    string one = to_string(v[2]);
    string two = to_string(v[1]);
    int three = v[0];
    string onetwo = one + two;
    cout << stoi(onetwo) + three;

}

Compiler output:
a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
    1 | #include<bits\stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
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;
}

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

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

int main(){
  vector<int> A(3);
  for(int i=0;i<3;i++){
    cin >> A.at(i);
  }
  int m = min(min(A.at(0),A.at(1)),A.at(2));
  int M = max(max(A.at(0),A.at(1)),A.at(2))
  
  cout << M-m << endl;
  
  return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
 
int main(){
  int A,B,C;
  cin>>A>>B>>C;
  int a=max({A,B,C});
  int b=min({A,B,C});
  int c=(A+B+C-a-b)
  int ans=a-c+c-b;
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: expected ',' or ';' before 'int'
   10 |   int ans=a-c+c-b;
      |   ^~~
a.cc:11:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
int main()
{
    
    int a1,2,a3;
  scanf("%d%d%d",&a1,&a2,&a3);
  int a[3]={a1,a2,a3};
  sort(a,a+3);
    int ans=a[2]-a[1]+a[1]-a[0];
  
  printf("%d",ans);
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: expected unqualified-id before numeric constant
    8 |     int a1,2,a3;
      |            ^
a.cc:9:23: error: 'a2' was not declared in this scope; did you mean 'a1'?
    9 |   scanf("%d%d%d",&a1,&a2,&a3);
      |                       ^~
      |                       a1
a.cc:9:27: error: 'a3' was not declared in this scope; did you mean 'a1'?
    9 |   scanf("%d%d%d",&a1,&a2,&a3);
      |                           ^~
      |                           a1
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
int main()
{
    
    int a1,2,a3;
  scanf("%d%d%d",&a1,&a2,&a3);
  int a[3]={a1,a2,a3};
  sort(a,a+3);
    int ans=a[3]-a[2]+a[2]-a[1];
  
  printf("%d",ans);
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: expected unqualified-id before numeric constant
    8 |     int a1,2,a3;
      |            ^
a.cc:9:23: error: 'a2' was not declared in this scope; did you mean 'a1'?
    9 |   scanf("%d%d%d",&a1,&a2,&a3);
      |                       ^~
      |                       a1
a.cc:9:27: error: 'a3' was not declared in this scope; did you mean 'a1'?
    9 |   scanf("%d%d%d",&a1,&a2,&a3);
      |                           ^~
      |                           a1
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#define F(i,a,n) for(int i=a; i<n; i++)

typedef struct{
    int a;
    int b;
} War;

int compare(const void *b1, const void *b2){ // 昇順
    if(((War*)b1)->b > ((War*)b2)->b) return 1;
    else if(((War*)b1)->b < ((War*)b2)->b) return -1;
    else return 0;
}

int main(){
    int n,m;
    scanf("%d%d",&n,&m);
    
    War data[m];
    F(i,0,m){
        scanf("%d%d",&(data[i].a),&(data[i].b));
    }
    
    qsort(data,m,sizeof(War),compare);
    
   int rem_num=1;
    int tmp=data[0].b-1;
    F(j,0,m-1){
        if(tmp < data[j+1].a) {
            rem_num++;
            tmp=data[j+1].b-1;
        }
    }
    printf("%d\n",rem_num);
    return　0;
}

Compiler output:
main.c: In function 'main':
main.c:38:11: error: stray '\343' in program
   38 |     return<U+3000>0;
      |           ^~~~~~~~
Language: C++

#include<bits/c++.h>

using namespace std;

int main(){
    int tmp;
    vector<int>v(3);

    for(int i = 0; i < 3;i++)
        cin >> v[i];

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

    tmp = abs(v[0]-v[1]);

    cout << tmp + abs(v[1]-v[2]) << endl;


    return 0;
}


Compiler output:
a.cc:1:9: fatal error: bits/c++.h: No such file or directory
    1 | #include<bits/c++.h>
      |         ^~~~~~~~~~~~
compilation terminated.
Language: C

#include(stdio.h)
#include(stdlib.h)
#include(math.h)
#include(string.h)
#define F(i,a,n) for(int i=a; i<n; i++)

int main(){
    int tmp,min=100,max=0;
    F(i,0,3){
        scanf("%d",&tmp);
        if(max<tmp) max=tmp;
        if(min>tmp) min=tmp;
    }
    printf("%d\n",max-min);
    return 0;
}

Compiler output:
main.c:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include(stdio.h)
      |         ^
main.c:2:9: error: #include expects "FILENAME" or <FILENAME>
    2 | #include(stdlib.h)
      |         ^
main.c:3:9: error: #include expects "FILENAME" or <FILENAME>
    3 | #include(math.h)
      |         ^
main.c:4:9: error: #include expects "FILENAME" or <FILENAME>
    4 | #include(string.h)
      |         ^
main.c: In function 'main':
main.c:10:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   10 |         scanf("%d",&tmp);
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #include(stdio.h)
main.c:10:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   10 |         scanf("%d",&tmp);
      |         ^~~~~
main.c:10:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:14:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   14 |     printf("%d\n",max-min);
      |     ^~~~~~
main.c:14:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:14:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:14:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

include<stdio.h>
int main()
{
    int x,y,z;
    scanf("%d%d%d",&x,&y,&z);
    if(x>=y&&y>=z)
       {
        printf("%d",x-z);
       }
       else if(y>=z&&z>=x)
       {
           printf("%d",y-x);
       }
       else if(z>=x&&x>=y)
       {
           printf("%d",z-y);
       }
       return 0;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C

Previous12345…NextFilterReset
Username

Prob
	Result 
	Time
(ms)	Mem
(MB)	Lang 
	Submit Time
riazahmed1927
N
Runtime Error
Bash (GNU bash v4.3.11)
53 min ago
riazahmed1927
N
Runtime Error
Bash (GNU bash v4.3.11)
55 min ago
riazahmed1927
N
Wrong Answer
C
12 hr ago
riazahmed1927
N
Wrong Answer
C
5 days ago
riazahmed1927
N
Wrong Answer
C
5 days ago
           
All Copyright Reserved © 2010-2020 Xu Han
Server Time: 2020-03-05 12:24:16 BST

#24577327 | riazahmed1927's solution for [Problem N]
Status
Runtime Error
Length
304
Lang
Bash (GNU bash v4.3.11)
Submitted
2020-03-05 11:30:23
Shared

0.0 / 13.0
Select Code
include<stdio.h>
int main()
{
    int x,y,z;
    scanf("%d%d%d",&x,&y,&z);
    if(x>=y&&y>=z)
       {
        printf("%d",x-z);
       }
       else if(y>=z&&z>=x)
       {
           printf("%d",y-x);
       }
       else if(z>=x&&x>=y)
       {
           printf("%d",z-y);
       }
       return 0;
}

Compiler output:
main.c:1:14: error: stray '\342' in program
    1 | Previous12345<U+2026>NextFilterReset
      |              ^~~~~~~~
main.c:1:1: error: unknown type name 'Previous12345'
    1 | Previous12345…NextFilterReset
      | ^~~~~~~~~~~~~
main.c:2:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Username'
    2 | Username
      | ^~~~~~~~
main.c:2:1: error: unknown type name 'Username'
main.c:13:18: error: too many decimal points in number
   13 | Bash (GNU bash v4.3.11)
      |                  ^~~~~
main.c:18:18: error: too many decimal points in number
   18 | Bash (GNU bash v4.3.11)
      |                  ^~~~~
main.c:36:24: error: stray '\302' in program
   36 | All Copyright Reserved <U+00A9> 2010-2020 Xu Han
      |                        ^~~~~~~~
main.c:39:11: error: "|" is not a valid filename
   39 | #24577327 | riazahmed1927's solution for [Problem N]
      |           ^
main.c:39:26: warning: missing terminating ' character
   39 | #24577327 | riazahmed1927's solution for [Problem N]
      |                          ^
main.c:45:18: error: too many decimal points in number
   45 | Bash (GNU bash v4.3.11)
      |                  ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
 vcetor<int> p(3);
  for(int i=0;i<3;i++){
    cin>>p.at(i);
  }
  sort(p.begin(),p.end());
  cout<<p.at(2)-p.at(0)<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:2: error: 'vcetor' was not declared in this scope
    4 |  vcetor<int> p(3);
      |  ^~~~~~
a.cc:4:9: error: expected primary-expression before 'int'
    4 |  vcetor<int> p(3);
      |         ^~~
a.cc:6:10: error: 'p' was not declared in this scope
    6 |     cin>>p.at(i);
      |          ^
a.cc:8:8: error: 'p' was not declared in this scope
    8 |   sort(p.begin(),p.end());
      |        ^
Language: C++

#include<iostream>
using namespace std ;

void swap(int &a,int &b){
  int c = b ;
  b = a ; a = c ;
}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: expected unqualified-id before ',' token
   10 |   int a,b,,c ;
      |           ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:20:23: error: 'N' was not declared in this scope
   20 |   for (int i = 1; i < N; i++) {
      |                       ^
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a[] = new int[3];
    for(int i = 0;i<3;i++){
      a[i] = sc.nextInt();
    }
    Arrays.sort(a);
    int dis = 0;
    for(int i = 0;i<2;i++){
      dis += a[i+1] - a[i];
    }
    System.out.println(ans);
  }
}


Compiler output:
Main.java:14: error: cannot find symbol
    System.out.println(ans);
                       ^
  symbol:   variable ans
  location: class Main
1 error
Language: C++

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

int main() {
    vector<int> A(3)
    for (int i=0, i<3, i++) cin >> A.at(i);

    sort(A.begin(), A.end())

    cout >> A.end() - A.begin >> endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: expected ',' or ';' before 'for'
    6 |     for (int i=0, i<3, i++) cin >> A.at(i);
      |     ^~~
a.cc:8:29: error: expected ';' before 'cout'
    8 |     sort(A.begin(), A.end())
      |                             ^
      |                             ;
    9 | 
   10 |     cout >> A.end() - A.begin >> endl;
      |     ~~~~
Language: C++


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

int main()
{
  int A[3];
  for (auto & a : A)
    cin >> a;
  sort(A.begin(), A.end());
  int cost = 0;
  for (int i = 1; i < 3; ++i)
    cost += abs(A[i] - A[i - 1]);
  cout << cost;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: request for member 'begin' in 'A', which is of non-class type 'int [3]'
   11 |   sort(A.begin(), A.end());
      |          ^~~~~
a.cc:11:21: error: request for member 'end' in 'A', which is of non-class type 'int [3]'
   11 |   sort(A.begin(), A.end());
      |                     ^~~
Language: C++

#include <iostream>
using namespace std;

void insertionSort(int A[], N){
  for ( int i = 1; i < N; i++) {
    v = A[i];
    j = i - 1;
    while (j >= 0 && A[j] > v) {
      A[j+1] = A[j];
      j--;
    }
    A[j+1] = v;
  }
}

int main(void){

  int A[3];

  for ( int i = 0; i < 3; i++){
    cin >> A[i];
  }

  insertionSort(A, 3);

  int cost = 0;
  for ( int i = 0; i < 3; i++){
    if (i == 0){
      continue
    }
    cost += abs(A[i+1] - A[i])
  }

  cout << cost;

  return 0;
}

Compiler output:
a.cc:4:29: error: 'N' has not been declared
    4 | void insertionSort(int A[], N){
      |                             ^
a.cc: In function 'void insertionSort(int*, int)':
a.cc:5:24: error: 'N' was not declared in this scope
    5 |   for ( int i = 1; i < N; i++) {
      |                        ^
a.cc:6:5: error: 'v' was not declared in this scope
    6 |     v = A[i];
      |     ^
a.cc:7:5: error: 'j' was not declared in this scope
    7 |     j = i - 1;
      |     ^
a.cc: In function 'int main()':
a.cc:29:15: error: expected ';' before '}' token
   29 |       continue
      |               ^
      |               ;
   30 |     }
      |     ~          
a.cc:31:31: error: expected ';' before '}' token
   31 |     cost += abs(A[i+1] - A[i])
      |                               ^
      |                               ;
   32 |   }
      |   ~
Language: C++

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

int main(){
	int a, b, c;
    
  	int total = max{(a,b,c)} - min{(a,b,c)}
    cout << total;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:21: error: cannot resolve overloaded function 'max' based on conversion to type 'int'
    7 |         int total = max{(a,b,c)} - min{(a,b,c)}
      |                     ^~~
a.cc:7:36: error: wrong type argument to unary minus
    7 |         int total = max{(a,b,c)} - min{(a,b,c)}
      |                                    ^~~
Language: C++

# include < iostream >
# include < algorithm >
using namespace std ;
int main () {
int A1 , A2 , A3 ; cin >> A1 >> A2 >> A3 ;
int ans = max ({ A1 , A2 , A3 }) - min ({ A1 , A2 , A3 });
cout << ans << endl ;
}

Compiler output:
a.cc:1:11: fatal error:  iostream : No such file or directory
    1 | # include < iostream >
      |           ^~~~~~~~~~~~
compilation terminated.
Language: C++

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

int main() {

   /* int N,M,L;
    cin >> N>>M>>L;*/
    vector<int>A(N);
    for (int i = 0; i < 3; i++) {
        cin >> A.at(i);
    }
  sort(A.begin(),A.end());
  
    cout<<A.at(2)-A.at(0)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: 'N' was not declared in this scope
    9 |     vector<int>A(N);
      |                  ^
Language: C++

#include <iostream>
#inlcude <algorithm>
#include <chrono>
usign namespace std;
int main(){
  int a,b,c,x,y,z;
  cin >> a >> b >> c;
  x=abs(b-a)+abs(c-b);
  y=abs(c-a)+abs(b-c);
  z=abs(a-c)+abs(b-a);
  cout << min (x,min(y,z)) << endl;
  return 0;
}

Compiler output:
a.cc:2:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    2 | #inlcude <algorithm>
      |  ^~~~~~~
      |  include
a.cc:4:1: error: 'usign' does not name a type
    4 | usign namespace std;
      | ^~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin >> a >> b >> c;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:11:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |   cout << min (x,min(y,z)) << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:11:18: error: 'min' was not declared in this scope; did you mean 'std::min'?
   11 |   cout << min (x,min(y,z)) << endl;
      |                  ^~~
      |                  std::min
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:
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: 'std::min' declared here
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
a.cc:11:11: error: 'min' was not declared in this scope; did you mean 'std::min'?
   11 |   cout << min (x,min(y,z)) << endl;
      |           ^~~
      |           std::min
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: 'std::min' declared here
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
a.cc:11:31: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   11 |   cout << min (x,min(y,z)) << endl;
      |                               ^~~~
      |                               std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

int main(void)
{
  int a; cin>>a;
  int b; cin>>b; int x = abs(a-b);
  int c; cin>>c; int y = abs(b-c);
  int l = max(x,y); int z = abs(c-a);
  int l = max(l,z);
  int ans = x+y+z-l;
  cout << ans << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: redeclaration of 'int l'
   12 |   int l = max(l,z);
      |       ^
a.cc:11:7: note: 'int l' previously declared here
   11 |   int l = max(x,y); int z = abs(c-a);
      |       ^
Language: C++

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

int main(void)
{
  int a; cin>>a;
  int b; cin>>b; int x = abs(a-b);
  int c; cin>>c; int y = abs(b-c);
  int l = max(x,y); int z = abs(c-a);
  int l = max(l,z);
  int ans = x+y+z-l;
  cout << ans << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: redeclaration of 'int l'
   11 |   int l = max(l,z);
      |       ^
a.cc:10:7: note: 'int l' previously declared here
   10 |   int l = max(x,y); int z = abs(c-a);
      |       ^
Language: C++

#include <bits/stdc++.h>
#include <string>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <numeric>
using namespace std;


int main(){
  vector<int> task(3);
  cin >> task.at(0) >> task.at(1) >> task.at(2);
  sort(task.begin()task.end());
  cout << 0 + task.at(1)-task.at(0) + task.at(2) - task.at(1) << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: expected ')' before 'task'
   13 |   sort(task.begin()task.end());
      |       ~            ^~~~
      |                    )
a.cc:13:7: error: no matching function for call to 'sort(std::vector<int>::iterator)'
   13 |   sort(task.begin()task.end());
      |   ~~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/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 <bits/stdc++.h>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'vec' was not declared in this scope
    5 |   vec<int> num(3);
      |   ^~~
a.cc:5:7: error: expected primary-expression before 'int'
    5 |   vec<int> num(3);
      |       ^~~
a.cc:7:12: error: 'num' was not declared in this scope; did you mean 'enum'?
    7 |     cin >> num[i];
      |            ^~~
      |            enum
a.cc:9:8: error: 'num' was not declared in this scope; did you mean 'enum'?
    9 |   sort(num.begin(), num.end());
      |        ^~~
      |        enum
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a[3];
  for(int i = 0; i < 3; i++)
    cin >> a[i];
  sort(a.begin(),a.end());
  int cnt = 0;
  for(int i = 0; i < 2; i++)
    cnt += abs(a.[i] - a.[i + 1])
    cout << cnt << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: request for member 'begin' in 'a', which is of non-class type 'int [3]'
    7 |   sort(a.begin(),a.end());
      |          ^~~~~
a.cc:7:20: error: request for member 'end' in 'a', which is of non-class type 'int [3]'
    7 |   sort(a.begin(),a.end());
      |                    ^~~
a.cc:10:18: error: expected unqualified-id before '[' token
   10 |     cnt += abs(a.[i] - a.[i + 1])
      |                  ^
a.cc:10:26: error: expected unqualified-id before '[' token
   10 |     cnt += abs(a.[i] - a.[i + 1])
      |                          ^
Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main(){
  int a[3];
  cin>>a[0]>>a[1]>>a[2];
  for(int i=0;i<n-1;i++){
    for(int j=i+1;j<n;j++){
      if(a[i]>a[j])swap(a[i],a[j]);
    }
  }
  cout<<a[2]-a[1]+a[1]-a[0]<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: 'n' was not declared in this scope
    8 |   for(int i=0;i<n-1;i++){
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
	int a,b,c;
    char d,e;
  	string s;
  	cin>>a>>b>>c;
 cout<<a+b+c-max({a,b,c})-2*min({a,b,c])<<endl;}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:39: error: expected '}' before ']' token
    9 |  cout<<a+b+c-max({a,b,c})-2*min({a,b,c])<<endl;}
      |                                 ~     ^
a.cc:9:39: error: expected ')' before ']' token
    9 |  cout<<a+b+c-max({a,b,c})-2*min({a,b,c])<<endl;}
      |                                ~      ^
      |                                       )
Language: C++

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

vector <int> v;

int main() {
	clog << "Ready\n";
	
	int a, b, c;
	cin >> a >> b >> c;
	#define eb emplace_back
	v.eb(a);
	v.eb(b);
	v.eb(c);
	
	#define all(x) x.begin(), x.end()
	
	sort(all(v));
	
	cout << abs(v[1] - v[0]) + abs(v[2] - v[1]);
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   19 |         sort(all(v));
      |         ^~~~
      |         short
Language: C++

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

const int N = 2e6;

int main() {
	clog << "Ready\n";
	
	vector <int> v(3);
	cin >> v[0] >> v[1] >> v[2];
	
	#define all(x) x.begin(), x.end()
	
	sort(all(v));
	
	cout << abs(v[1] - v[0]) + abs(v[2] - v[1]);
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   15 |         sort(all(v));
      |         ^~~~
      |         short
Language: C++

#include <bits/stdc++.h>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:133: error: invalid operands of types 'const int' and '<unresolved overloaded function type>' to binary 'operator<<'
    8 |   min(abs(a-b)+abs(b-c),min(abs(a-c)+abs(c-b),min(abs(b-a)+abs(a-c),min(abs(b-c)+(c-a),min(abs(c-a)+abs(a-b),abs(c-b)+abs(c-a)))))) << endl;
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
Language: C++

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

#define endl '\n'
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define test cout<<"test"<<endl;
#define fi first
#define se second
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = (n); i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = (m) - 1; i >= (ll)(n); i--)
using ll = long long;
using ld = long double;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T>
void chmin(T &a,T b){if(a>b)a=b;}
template<typename T>
void chmax(T &a,T b){if(a<b)a=b;}
void pmod(ll &a,ll b){a=(a+b)%MOD;}
void pmod(ll &a,ll b,ll c){a=(b+c)%MOD;}
void qmod(ll &a,ll b){a=(a*b)%MOD;}
void qmod(ll &a,ll b,ll c){a=(b*c)%MOD;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>
void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
template<typename T>
void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cout<<v[i][0];for(ll j=1;j<w;j++)cout spa v[i][j];cout<<endl;}};
void debug(vector<string>&v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
template<typename T>
void debug(vector<T>&v,ll n){if(n!=0)cout<<v[0];
for(ll i=1;i<n;i++)cout spa v[i];cout<<endl;};
template<typename T>
vector<vector<T>>vec(ll x, ll y, T w){
  vector<vector<T>>v(x,vector<T>(y,w));return v;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
vector<ll>dx={1,0,-1,0,1,1,-1,-1};
vector<ll>dy={0,1,0,-1,1,-1,1,-1};
template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}
ostream &operator<<(ostream &os, pair<ll, ll>&p){
  return os << p.first << " " << p.second;
}  
int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  //cout<<fixed<<setprecision(10);
  ll res=0,buf=0;
  bool judge = true;
  ll a;cin>>a;
  //ll a,b;cin>>a>>b;
  ll a,b,c;cin>>a>>b>>c;
  //ll a,b,c,d;cin>>a>>b>>c>>d;
  //string s;cin>>s;
  cout<<max({a,b,c})-min({a-b-c})<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:67:6: error: redeclaration of 'll a'
   67 |   ll a,b,c;cin>>a>>b>>c;
      |      ^
a.cc:65:6: note: 'll a' previously declared here
   65 |   ll a;cin>>a;
      |      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define Sort(x) sort((x).begin(), (x).end())
#define Reverse(x) reverse((x).begin(), (x).end())
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define INF INT_MAX
#define MOD 1000000007
#define fcout cout << fixed << setprecision(15) //15桁まで表示
#define str string
typedef std::pair<int,int> pii;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<ui,ui> puu;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<str> vs;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a * b / gcd(a, b);};
int floor(int a,int b){return (a+b-1)/b;};
int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
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 main() {
    vi a(n);
    cin >> a[0]>>a[1]>>a[2];
    cout << max({a[0],a[1],a[2]})-min({a[0],a[1],a[2]}) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:10: error: 'n' was not declared in this scope
   28 |     vi a(n);
      |          ^