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

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <cmath>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define MA(i,j) make_pair(i,j)
#define PA pair<int,int>
#define PB push_back
#define PQ priority_queue<int>
#define PGQ priority_queue<int,vector<int>,greater<int> >
#define VE vector<int>
#define VP vector<PA>
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
#define MOD 1000000007
#define INF 1000000007
#define PI 3.14159265358979323846
using namespace std;
//
int main(){
  long long N,A,B;
  cin>>N>>A>>B;
  long long L=A*(N-1)+B,U=A+(N-1)*B;
  cout<<max(0,U-L+1)<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:12: error: no matching function for call to 'max(int, long long int)'
   30 |   cout<<max(0,U-L+1)<<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:   template argument deduction/substitution failed:
a.cc:30:12: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   30 |   cout<<max(0,U-L+1)<<endl;
      |         ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:30:12: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   30 |   cout<<max(0,U-L+1)<<endl;
      |         ~~~^~~~~~~~~
Language: C++

#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
#define int long long
int n,l,r;
main(){
  cin>>n>>l>>r;
  else if(l<r&&(r-l)<=n)cout<<(n-1)*r+l-n*l<<endl;
  else if(l==r)cout<<1<<endl;
  else cout<<0<<endl;
}

Compiler output:
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'else' without a previous 'if'
    8 |   else if(l<r&&(r-l)<=n)cout<<(n-1)*r+l-n*l<<endl;
      |   ^~~~
Language: C++

use std::io;

fn next_vec() -> Vec<i64> {
    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.split_whitespace().map(|n| n.parse().unwrap()).collect()
}

fn main() {
    let v = next_vec();
    let n = v[0];
    let a = v[1];
    let b = v[2];

    let minimum = a * (n - 1) + b;
    let maximum = a + b * (n - 1);
    let ans = maximum - minimum + 1;
    println!("{:?}", if ans < 0 {0} else {ans});
}


Compiler output:
a.cc:1:1: error: 'use' does not name a type
    1 | use std::io;
      | ^~~
a.cc:3:1: error: 'fn' does not name a type
    3 | fn next_vec() -> Vec<i64> {
      | ^~
a.cc:9:1: error: 'fn' does not name a type
    9 | fn main() {
      | ^~
Language: C++

#include<bits/sdtc++.h>
using namespace std;
int n,a,b;
int main(){
       cin>>n>>a>>b;
       if(n==1&&a!=b)printf("0");
       else if(a>b)printf("0");
       else{
                long long sm=1LL*a*(n-1)+b;
                long long bi=1LL*b*(n-1)+a;
               printf("%lld",bi-sm+1);
              return 0;
    }
}

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

#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string>
#include<iostream>
#include<cctype>
#include<cstdio>
#include<vector>
#include<stack>
#include<queue>
#include <algorithm>
#include<math.h>
#include<set>
#include<map>
#include <sstream>
#include<iomanip>
#include <ctype.h>

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


using namespace std;



int main() {

	long long  int a, b, c;
	cin >> a >> b >> c;
	long long int ans = 0,m=0;
	if (b > c) {
		cout << 0 << endl;
		return 0;
	}
	m = b*a - b;
	m += c;
	/*
	if (a == 1) {
		cout << max(c - b + 1,0) << endl;
	}
	*/cout << max(c*a-c+b - m+1,0) << endl;

	return 0;

}




Compiler output:
a.cc: In function 'int main()':
a.cc:41:22: error: no matching function for call to 'max(long long int, int)'
   41 |         */cout << max(c*a-c+b - m+1,0) << endl;
      |                   ~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:41:22: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   41 |         */cout << max(c*a-c+b - m+1,0) << endl;
      |                   ~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:11:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:41:22: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   41 |         */cout << max(c*a-c+b - m+1,0) << endl;
      |                   ~~~^~~~~~~~~~~~~~~~~
Language: C++

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


int main(){
	int n,a,b;
	cin >> n >> a >> b;
	ans=(b-a)*(n-2)+1;
	cout << (ans<0?0:ans) << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
    8 |         ans=(b-a)*(n-2)+1;
      |         ^~~
      |         abs
Language: C++

#include<iostream>
using namespace std;

int main() {
	string s;
	cin >> s;
	long long int ans = 0;
	for (int i = 0; i < s.size(); ++i) {
		if (s[i] = 'U') {
			ans += (2 * (i - 1) + s.size() - 2;
		}
		else { ans += i - 1 + (s.size() - 2) * 2; }
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:59: error: expected ')' before ';' token
   10 |                         ans += (2 * (i - 1) + s.size() - 2;
      |                                ~                          ^
      |                                                           )
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int __int64
main() {
	int n, a, b;
	cin >> n >> a >> b;
	if (n == 1)  {
		cout << (a == b ? 1 : 2);
	} else if (b < a) {
		cout << 0; 
	} else if (n == 2) {
		cout << 1;
	} else {
		cout << ((a+b * (n-1)) - (a * (n-1) + b) + 1);
	}              
}

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:3:13: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
    3 | #define int __int64
      |             ^~~~~~~
a.cc:5:9: note: in expansion of macro 'int'
    5 |         int n, a, b;
      |         ^~~
a.cc:6:16: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |         cin >> n >> a >> b;
      |                ^
      |                yn
a.cc:6:21: error: 'a' was not declared in this scope
    6 |         cin >> n >> a >> b;
      |                     ^
a.cc:6:26: error: 'b' was not declared in this scope
    6 |         cin >> n >> a >> b;
      |                          ^
Language: C++

#include <iostream>
#include <cstdio>
#include <stdlib.h>
using namespace std;
typedef long long LL;
int main()
{
    __int64 n,a,b;
    scanf("%I64d%I64d%I64d",&n,&a,&b);

        if(a>b )
        {
            printf("0\n");
            return 0;
        }
        if(n == 1 && a != b)
        {
            printf("0\n");
            return 0;
        }
        printf("%I64d\n",(b-a)*(n-2)+1);



    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
    8 |     __int64 n,a,b;
      |     ^~~~~~~
      |     __int64_t
a.cc:9:30: error: 'n' was not declared in this scope
    9 |     scanf("%I64d%I64d%I64d",&n,&a,&b);
      |                              ^
a.cc:9:33: error: 'a' was not declared in this scope
    9 |     scanf("%I64d%I64d%I64d",&n,&a,&b);
      |                                 ^
a.cc:9:36: error: 'b' was not declared in this scope
    9 |     scanf("%I64d%I64d%I64d",&n,&a,&b);
      |                                    ^
Language: C++

#include <iostream>
#include <cstdio>
using namespace std;
typedef long long LL;
int main()
{
    __int64 n,a,b;
    scanf("%I64d%I64d%I64d",&n,&a,&b);

        if(a>b )
        {
            printf("0\n");
            return 0;
        }
        if(n == 1 && a != b)
        {
            printf("0\n");
            return 0;
        }
        printf("%I64d\n",(b-a)*(n-2)+1);



    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
    7 |     __int64 n,a,b;
      |     ^~~~~~~
      |     __int64_t
a.cc:8:30: error: 'n' was not declared in this scope
    8 |     scanf("%I64d%I64d%I64d",&n,&a,&b);
      |                              ^
a.cc:8:33: error: 'a' was not declared in this scope
    8 |     scanf("%I64d%I64d%I64d",&n,&a,&b);
      |                                 ^
a.cc:8:36: error: 'b' was not declared in this scope
    8 |     scanf("%I64d%I64d%I64d",&n,&a,&b);
      |                                    ^
Language: C++

#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
    int n,a,b;
    while(cin>>n>>a>>b)
    {
        if(a>b )
        {
            cout<<"0"<<endl;
            continue;
        }
        if(n == 1 && a != b)
        {
            cout<<"0"<<endl;
            continue;
        }
        cout<<(b-a)*(n-2)+1)<<endl;;


    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:28: error: expected ';' before ')' token
   19 |         cout<<(b-a)*(n-2)+1)<<endl;;
      |                            ^
      |                            ;
Language: C++

#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
    __in64  n,a,b;
    while(~scanf("%I64d%I64d%I64d",&n,&a,&b))
    {
        if(a>b )
        {
            printf("0\n");
            continue;
        }
        if(n == 1 && a != b)
        {
            printf("0\n");
            continue;
        }
        printf("%I64d\n",(b-a)*(n-2)+1);


    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: '__in64' was not declared in this scope; did you mean '__u64'?
    6 |     __in64  n,a,b;
      |     ^~~~~~
      |     __u64
a.cc:7:37: error: 'n' was not declared in this scope
    7 |     while(~scanf("%I64d%I64d%I64d",&n,&a,&b))
      |                                     ^
a.cc:7:40: error: 'a' was not declared in this scope
    7 |     while(~scanf("%I64d%I64d%I64d",&n,&a,&b))
      |                                        ^
a.cc:7:43: error: 'b' was not declared in this scope
    7 |     while(~scanf("%I64d%I64d%I64d",&n,&a,&b))
      |                                           ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

typedef long long int64;

int main()
{
  int64 N, A, B;
  cin >> N >> A >> B;

  if(N == 1) {
    if(A == B) cout << 1 << endl;
    else cout << 0 << endl;
  } else {
    cout << max(0, (N * B - B + A) - (N * A - A + B) + 1) << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:16: error: no matching function for call to 'max(int, int64)'
   16 |     cout << max(0, (N * B - B + A) - (N * A - A + B) + 1) << endl;
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:16:16: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'int64' {aka 'long long int'})
   16 |     cout << max(0, (N * B - B + A) - (N * A - A + B) + 1) << endl;
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:16:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   16 |     cout << max(0, (N * B - B + A) - (N * A - A + B) + 1) << endl;
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <cmath>

int main(){
    int N, A, B, tmp;
    std::cin >> N >> A >> B;
    tmp = (B - A) * (N - 2) + 1;
    if(N < 1) std::cout << 0 << std::endl;
    else if(A != B && N = 1) std::cout << 0 << std::endl;
    else std::cout << tmp << std::endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: lvalue required as left operand of assignment
    9 |     else if(A != B && N = 1) std::cout << 0 << std::endl;
      |             ~~~~~~~^~~~
Language: C++

#include<iostream>
using namespace std;

int main()
{
	long N,A,B,result;
	int temp;
	cin>>N>>A>>B;

	if (A>B)
	{
		temp=0;
		cout<<temp<<endl;
	}

	else if((B-A+1)>N)
	{
		temp=0;
		cout<<temp<<endl;
	}

	else if(n==1 && A==B)
	{
		temp=1;
		cout<<temp<<endl;

	}

	else
	{
		result= (A+(N-1)*B)-((N-1)*A+B)+1;
		cout<<result<<endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:17: error: 'n' was not declared in this scope
   22 |         else if(n==1 && A==B)
      |                 ^
Language: C++

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
import java.util.*;
/**
 *
 * @author Jeel
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        long n=sc.nextLong();
        long a=sc.nextLong();
        long b=sc.nextLong();
        if(n==1&a!=b)
        {
            System.out.print("0");
            return;
        }
        else if(b<a)
        {
            System.out.print("0");
            return;
        }
        System.out.print((b*(n-1)+a)-((a*(n-1))+b)+1);
    }
    
}


Compiler output:
a.cc:6:1: error: 'import' does not name a type
    6 | import java.util.*;
      | ^~~~~~
a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:11:1: error: expected unqualified-id before 'public'
   11 | public class Main {
      | ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int,int> pint;
typedef vector<pint> vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=n-1;i>=(0);i--)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define all(v) (v).begin(),(v).end()
#define eall(v) unique(all(v), v.end())
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll INFF = 1e18;

int main(void) {
	ll N, A, B;
	cin >> N >> A >> B;
	if(N == 1){
		if(A != B)printf("0\n");
		else printf("1\n");
		return 0;
	}

	ll ma = A + B * (N - 1);
	ll mi = A * (N - 1) + B;
	printf("%lld\n", max(0, ma - mi + 1));
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:29: error: no matching function for call to 'max(int, ll)'
   34 |         printf("%lld\n", max(0, ma - mi + 1));
      |                          ~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:34:29: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   34 |         printf("%lld\n", max(0, ma - mi + 1));
      |                          ~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:34:29: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   34 |         printf("%lld\n", max(0, ma - mi + 1));
      |                          ~~~^~~~~~~~~~~~~~~~
Language: C++

/*
 _    _    _______   _    _
| |  / /  |  _____| | |  / /
| | / /   | |       | | / /
| |/ /    | |_____  | |/ /
| |\ \    |  _____| | |\ \
| | \ \   | |       | | \ \
| |  \ \  | |_____  | |  \ \
|_|   \_\ |_______| |_|   \_\

*/
/*#include <iostream>
#include <cstdio>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#include <cstring>
#include <string>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <assert.h>*/

#include <bits/stdc++.h>

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef double ld;
typedef pair <int, int> PII;
typedef pair <ll, ll> PLL;

#define F first
#define S second
#define pb push_back
#define eb emplace_back
#define right(x) x << 1 | 1
#define left(x) x << 1
#define forn(x, a, b) for (int x = a; x <= b; ++x)
#define for1(x, a, b) for (int x = a; x >= b; --x)
#define mkp make_pair
#define sz(a) (int)a.size()
#define all(a) a.begin(), a.end()
#define y1 kekekek

const ll ool = 1e18 + 9;
const int oo = 1e9 + 9, base = 1e9 + 7;
const ld eps = 1e-7;
const int N = 2e6 + 6;

int main() {
	ios_base :: sync_with_stdio(0), cin.tie(0), cout.tie(0);
    //freopen("in", "r", stdin);

    ll n, A, B;
    cin >> n >> A >> B:
    cout << (n - 1) * A + B - ((n - 1) * B + A) << "\n";

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:59:23: error: found ':' in nested-name-specifier, expected '::'
   59 |     cin >> n >> A >> B:
      |                       ^
      |                       ::
a.cc:59:22: error: 'B' is not a class, namespace, or enumeration
   59 |     cin >> n >> A >> B:
      |                      ^
Language: C++

#define debug(x) cout<<#x<<": "<<x<<endl
#define rep(a, b) for(int unsafe_cnt=a; unsafe_cnt < b;unsafe_cnt++)
#define fn auto
#include <iostream>
#include <stdio.h>
#include <vector>
#include <math.h>
#include <algorithm>
#include <string>
using namespace std;

void newline() {cout << endl;}
template <typename T> void display(T input){cout << input;}
template <typename T> void put(T input){display(input); newline();}
void iput(int input) {put(input);}
void lput(long long input) {put(input);}

void main() {
  long long n, a, b, max, min, ans;
  cin >> n >> a >> b;
  if(a > b){
    ans = 0;
  }else if(n==1 && a==b){
    ans = 1;
  }else if(n==1 && a!=b){
    ans = 0;
  } else {
    min = a * (n-1) + b;
    max = a + (n-1) * b;
    ans = max - min + 1;
  }
  lput(ans);
}


Compiler output:
a.cc:18:1: error: '::main' must return 'int'
   18 | void main() {
      | ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
int a, n, b;
int main(){
cin >> n >> a >> b;
cout << 1LL * (n - 2) * ( b - a) + 1
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:37: error: expected ';' before '}' token
    7 | cout << 1LL * (n - 2) * ( b - a) + 1
      |                                     ^
      |                                     ;
    8 | }
      | ~
Language: C++

#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
using namespace std;
inline void read(int &x){
	x=0;char ch=getchar();int f=1;
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=10*x+ch-'0';ch=getchar();}x*=f;
}
inline void judge(){
	freopen("in.txt","r",stdin);
	freopen("out.txt","w",stdout);
}
i64 n,a,b;
int main(){
	cin>>n>>a>>b;
	i64 v1=n*a,v2=n*b;
	cout<<v2-v1+1;
}

Compiler output:
a.cc:14:1: error: 'i64' does not name a type
   14 | i64 n,a,b;
      | ^~~
a.cc: In function 'int main()':
a.cc:16:14: error: 'n' was not declared in this scope; did you mean 'yn'?
   16 |         cin>>n>>a>>b;
      |              ^
      |              yn
a.cc:16:17: error: 'a' was not declared in this scope
   16 |         cin>>n>>a>>b;
      |                 ^
a.cc:16:20: error: 'b' was not declared in this scope
   16 |         cin>>n>>a>>b;
      |                    ^
a.cc:17:9: error: 'i64' was not declared in this scope
   17 |         i64 v1=n*a,v2=n*b;
      |         ^~~
a.cc:18:15: error: 'v2' was not declared in this scope
   18 |         cout<<v2-v1+1;
      |               ^~
a.cc:18:18: error: 'v1' was not declared in this scope; did you mean '__pstl::execution::v1'?
   18 |         cout<<v2-v1+1;
      |                  ^~
      |                  __pstl::execution::v1
In file included from /usr/include/c++/14/pstl/glue_algorithm_defs.h:15,
                 from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/pstl/execution_defs.h:19:18: note: '__pstl::execution::v1' declared here
   19 | inline namespace v1
      |                  ^~
Language: C++

#include <iostream>
using namespace std;

int solve(int N, int B){
  if(B < 0) return 0;
  if(N == 1) return (B == 0) ? 1 : 0;
  else{
    return (N - 2) * B + 1;
  }
}

int main(){
  int N, A, B;
  cin >> N >> A >> B;
  cout << solve(N, B - A) << endl;
}#include <iostream>
using namespace std;

int solve(int N, int B){
  if(B < 0) return 0;
  if(N == 1) return (B == 0) ? 1 : 0;
  else{
    return (N - 2) * B + 1;
  }
}

int main(){
  int N, A, B;
  cin >> N >> A >> B;
  cout << solve(N, B - A) << endl;
}

Compiler output:
a.cc:16:2: error: stray '#' in program
   16 | }#include <iostream>
      |  ^
a.cc:16:3: error: 'include' does not name a type
   16 | }#include <iostream>
      |   ^~~~~~~
a.cc:19:5: error: redefinition of 'int solve(int, int)'
   19 | int solve(int N, int B){
      |     ^~~~~
a.cc:4:5: note: 'int solve(int, int)' previously defined here
    4 | int solve(int N, int B){
      |     ^~~~~
a.cc:27:5: error: redefinition of 'int main()'
   27 | int main(){
      |     ^~~~
a.cc:12:5: note: 'int main()' previously defined here
   12 | int main(){
      |     ^~~~
Language: C++

#include<cstdio>
int main(){
 int n,a,b;
if(a > b)
return 0*printf("0\n");
if(n == 1 && a < b)
return 0*printf("0\n");
printf("%d\n",a+b*(n-1)-(b+a*(n-1)+1);
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:38: error: expected ')' before ';' token
    8 | printf("%d\n",a+b*(n-1)-(b+a*(n-1)+1);
      |       ~                              ^
      |                                      )
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;

#define pb push_back
#define rep(i, a, n) for(int i = (a); i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
#define vin(n, d) rep(i, 0, n) cin >> d[i]
#define out(n) cout << (n) << endl

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

int main() {
  int n, a, b;
  cin >> n >> a >> b;
  out((b * n) - (a * n))
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:1: error: expected ';' before '}' token
   25 | }
      | ^
Language: C++

#include <iostream>

int main()
{
	long N, A, B;
	std::cin >> N >> A >> B;
	std::cout <<  std::max( 0, ( A + B * ( N - 1 ) ) - ( A * ( N - 1 ) + B ) + 1 ) << std::endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:31: error: no matching function for call to 'max(int, long int)'
    7 |         std::cout <<  std::max( 0, ( A + B * ( N - 1 ) ) - ( A * ( N - 1 ) + B ) + 1 ) << std::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:   template argument deduction/substitution failed:
a.cc:7:31: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long int')
    7 |         std::cout <<  std::max( 0, ( A + B * ( N - 1 ) ) - ( A * ( N - 1 ) + B ) + 1 ) << std::endl;
      |                       ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
Language: C


#include<stdio.h>
 
int main() {
 
	long n, a, b, m;
 
	scanf("%d %d %d", &n, &a, &b);
 
	if (a > b) {
		m = 0;
	}
	else {
		if (n == 1) {
			if (a == b) {
				m = 1;
			}
			else {
				m = 0;
			}
		}
 
		else if (n > 1) {
			m = (b - a)*(n - 2) + 1;
		}
		else {
			m = 0;
		}
	}
	printf("%d\n", m);
	return 0;
}


Compiler output:
main.c:3:1: error: stray '\302' in program
    3 | <U+00A0>
      | ^~~~~~~~
main.c: In function 'main':
main.c:5:1: error: stray '\302' in program
    5 | <U+00A0>
      | ^~~~~~~~
main.c:7:1: error: stray '\302' in program
    7 | <U+00A0>
      | ^~~~~~~~
main.c:9:1: error: stray '\302' in program
    9 | <U+00A0>
      | ^~~~~~~~
main.c:22:1: error: stray '\302' in program
   22 | <U+00A0>
      | ^~~~~~~~
Language: C++


#include <bits/stdc++.h>
 
using namespace std;
 
long long n,a,b;
 
int main() {
 ios_base::sync_with_stdio(0); cin.tie(0);
 cin>>n>>a>>b;
 cout<<max(0,(n-2)*(b-a+1))<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: no matching function for call to 'max(int, long long int)'
   11 |  cout<<max(0,(n-2)*(b-a+1))<<endl;
      |        ~~~^~~~~~~~~~~~~~~~~
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:2:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:11:11: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   11 |  cout<<max(0,(n-2)*(b-a+1))<<endl;
      |        ~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:11:11: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   11 |  cout<<max(0,(n-2)*(b-a+1))<<endl;
      |        ~~~^~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
#include<stdlib.h>
using namespace std;
 
int main(){
  int n,a,b;
  cin>>n>>a>>b;
  if((n==1)&&(a!=b)) cout<<0<<endl; exit(0);
  if(a>b) cout<<0<<endl; exit(0);
  if((n!=1)&&(a==b)) cout<<0<<endl; exit(0);
  int min=a*(n-1)+b;
  int max=a+b*(n-1);
  cout<<max-min+1<<endl;
}

Compiler output:
a.cc:4:1: error: extended character   is not valid in an identifier
    4 |  
      | ^
a.cc:4:1: error: '\U000000a0' does not name a type
    4 |  
      | ^
Language: C++

#include <stdio.h>
int main(){
	long int N,A,B,OUTPUT;
	scanf("%ld %ld %ld",&N,&A,&B);
	if(A>B){
		printf("0");
		return 0;
	}
	if(N==1){
		if(A!=B){
			printf("0");
			return 0;
		}
		printf("1");
		return 0;
	}
	OUTPUT = (n-2)*(B-A);
//	OUTPUT=(B*(N-1)+A) - (A*(N-1)+B);
	if(OUTPUT>0)OUTPUT++;
	if(OUTPUT==0)OUTPUT=1;
	if(OUTPUT<0)OUTPUT=0;
	printf("%ld\n",OUTPUT);
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:19: error: 'n' was not declared in this scope
   17 |         OUTPUT = (n-2)*(B-A);
      |                   ^
Language: C++

#include <bits/stdc++.h>

int main(){
        unsigned long long A, B, N;
	
	cin >> N >> A >> B;

	if(B<A){
                  cout << "0" << endl;
        }else{
                  unsigned long long min = (N-1)*A + B;
	          unsigned long long max = (N-1)*B + A;

	          cout << max-min+1 << endl;	
        }

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         cin >> N >> A >> B;
      |         ^~~
      |         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 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:9:19: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |                   cout << "0" << 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:9:34: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    9 |                   cout << "0" << endl;
      |                                  ^~~~
      |                                  std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:14:19: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |                   cout << max-min+1 << 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:14:40: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   14 |                   cout << max-min+1 << 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 "stdafx.h"
#include <iostream>
using namespace std;

void ap();

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

void ap()
{
	int N, A, B;
	cin >> N >> A >> B;
	int minv, maxv;
	minv = A*(N - 1) + B;
	maxv = A + B*(N - 1);
	int result = maxv - minv >= 0 ? maxv - minv + 1 : 0;
	cout << result << endl;
}

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

import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int N = scanner.nextInt();
    int A = scanner.nextInt();
    int B = scanner.nextInt();
    
    int count = (N - 2)*(B - A) + 1;
    
    if (N == 1 && A == B) {
      System.out.println(1);
    } 
    if (N == 1 && A !== B) {
      System.out.println(0);
    } 
    if (N >= 2 && A > B) {
      System.out.println(0);
    } 
    if (N >= 2 && A <= B) {
      System.out.println(count);
    }
  }
  
}


Compiler output:
Main.java:15: error: illegal start of expression
    if (N == 1 && A !== B) {
                      ^
1 error
Language: C++

#include <iostream>
using namespace std;
int main()
{
  long long n, a, b;
  int ans;
  cin >> n >> a >> b;

  if(n == 1 && a == b){
    ans = 1;
  } else if(n == 1 && a < b){
    ans = 0;
  } else if(n == 1 && a > b){
    ans = 0;
  
  if(n != 1 && a > b){
    ans = 0;
  } else if(n != 1 && a <= b){
  ans = (b-a)*(n-2)+1;
  }

    cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:2: error: expected '}' at end of input
   24 | }
      |  ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

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

int main()
{
    int num, min, max;
    cin >> num >> min >> max;
    int between = max-min;
    if (num <= 0 || num < between || between < 0) {
        cout << 0 << endl;
        return 0;
    }
    else if (between == 0){
        cout << 1 << endl;
        return 0 ;
    }
    else {
        cout << max(((max*(num-1)+min) - (min*(num-1)+max) +1), 0);
        return 0 ;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:20: error: 'max' cannot be used as a function
   19 |         cout << max(((max*(num-1)+min) - (min*(num-1)+max) +1), 0);
      |                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

# include <stdio.h>
# include <algorithm>


long long N, A, B;

int main(void){
    // Here your code !
    scanf("%lld%lld%lld",&N,&A,&B);

    long long D = B - A;

    if (D < 0) {printf("%d\n", 0);}
    else if (D == 0) {
        if (N == 1) {printf("%d\n", 1);}
        else {printf("%d\n", 0);}
    }
    else {
        else {printf("%lld\n", (1 + (N - 2) * D));}
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'else' without a previous 'if'
   19 |         else {printf("%lld\n", (1 + (N - 2) * D));}
      |         ^~~~
Language: C++

#include <stdio.h>

int main(){
	long int n,min,max;
	scanf("%d %d %d",&n,&min,&max);
	int i;
	int k=1;
	if(min>max || n==1){
	k=0;
	} else if(min==max || n==2){
	k=1;
	} else if(){
		k=((max)*(n-1)+min)-(min*(n-1)+max)+1;
	}
	printf("%d",k);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: expected primary-expression before ')' token
   12 |         } else if(){
      |                   ^
Language: C++

#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <random>
#include <string>
#include <vector>
#include <cmath>
#include <queue>
#include <set>
#include <map>
using namespace std;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long ll;

string s;
ll ans;

int main() {
	ios::sync_with_stdio(0); cin.tie(0);
	cin >> s;
	ll n = s.size();
	ll u = 0,d = 0;
	for(int i = 0; i < n; ++i) {
		ans += u;
		u += s[i] == 'U'
	}
	for(int i = n-1; i >= 0; --i) {
		ans += d;
		d += s[i] == 'D';
	}
	ans += 2*((n*(n-1)) - ans);
	cout << ans << "\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:33: error: expected ';' before '}' token
   28 |                 u += s[i] == 'U'
      |                                 ^
      |                                 ;
   29 |         }
      |         ~
Language: C++

#include <iostream>
int main() {
	long long n, a, b;
	std::cin >> n >> a >> b;
	std::cout << max(n*b-n*a+1,0ll);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:22: error: 'max' was not declared in this scope; did you mean 'std::max'?
    5 |         std::cout << max(n*b-n*a+1,0ll);
      |                      ^~~
      |                      std::max
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:303:5: note: 'std::max' declared here
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
Language: C++

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

int64_t main() {
	int64_t N, A, B;
	cin >> N >> A >> B;

	int64_t ans = 0;
	if (A > B) {
		ans = 0;
	}
	else if (N == 1) {
		ans = (A == B) ? 1 : 0;
	}
	else {
		ans = (B - A) * (N - 2) + 1;
	}

	cout << ans << endl;
}


Compiler output:
a.cc:5:1: error: '::main' must return 'int'
    5 | int64_t main() {
      | ^~~~~~~
Language: Java

package atcoder;

import java.util.*;

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

		long n = sc.nextLong();
		long a = sc.nextLong();
		long b = sc.nextLong();

		System.out.println(ans(n,a,b));
		sc.close();
	}
	
	public static long ans(long n, long a, long b) {
		if (a > b) {
			return 0;
		}
		if (n == 1) {
			if (a == b) {
				return 1;
			}
			return 0;
		}
		return (b-a) * (n-2) + 1;
	}
}

Compiler output:
Main.java:5: error: class A is public, should be declared in a file named A.java
public class A {
       ^
1 error
Language: C++

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


int main() {
	int N, A, B;
	cin >> N >> A >> B;

	int64_t ans = 0;
	if (A > B) {
		ans = 0;
	}
	else if (N == 1)
		ans = (A == B) ? 1 : 0;
	}
	else {
		int64_t min = A * (N - 2);
		int64_t max = B * (N - 2);
		ans = (max - min + 1);
	}

	cout << ans << endl;
}


Compiler output:
a.cc:17:9: error: expected unqualified-id before 'else'
   17 |         else {
      |         ^~~~
a.cc:23:9: error: 'cout' does not name a type
   23 |         cout << ans << endl;
      |         ^~~~
a.cc:24:1: error: expected declaration before '}' token
   24 | }
      | ^
Language: C++

#include <cstdio>
#include <queue>
#include <iostream>
#include <algorithm>
#define INT long long
#define oo 987654321
#define MOD 1000000007
using namespace std;

INT n, base, T[1<<19], ans, p[200020] = {1};
struct V{ INT x, v; } a[200020];
bool cmp(V a, V b)
{
    return a.x < b.x;
}
bool cmp2(V a, V b)
{
    return a.v < b.v;
}
INT getSum(int l, int r)
{
    INT sum = 0;
    while( l <= r )
    {
        if( l%2 == 1 ) sum+=T[l], l++;
        if( r%2 == 0 ) sum+=T[r], r--;
        l>>=1, r>>=1;
    }
    return sum;
}
int main()
{
    ios::sync_with_stdio(false);
    cin>>n;
    for(int i = 1 ; i <= n ; i++ ) p[i] = p[i-1]*2, p[i]%=MOD;
    for( base = 1 ; base < n ; base<<=1);
    for(int i = 0 ; i < n ; i++ ) cin>>a[i].x>>a[i].v;
    sort(a, a+n, cmp2);
    for(int i = 0 ; i < n ; i++ ) a[i].v = i;
    sort(a, a+n, cmp);
    for(int i = 0 ; i < n ; i++ )
    {
        ans += (INT)pow(getSum(base+a[i].v, base*2-1));
        ans %= MOD;
        T[base+a[i].v] = 1;
    }
    cout<<ans<<endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:43:21: error: 'pow' was not declared in this scope
   43 |         ans += (INT)pow(getSum(base+a[i].v, base*2-1));
      |                     ^~~
Language: C++

#include <iostream>

using namespace std;

int main()
{
    int num, min, max;
    cin >> num >> min >> max;
    int bet = max-min;
    if (num <= 0 || num < bet) {
        cout << 0 << endl;
        return 0;
    }
    else if (num=bet){
        cout << 1 << endl;
        return 0 ;
    }
    else {
        cout << (max(num-1)+min) - (min(num-1)+max);
        return 0 ;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:21: error: 'max' cannot be used as a function
   19 |         cout << (max(num-1)+min) - (min(num-1)+max);
      |                  ~~~^~~~~~~
a.cc:19:40: error: 'min' cannot be used as a function
   19 |         cout << (max(num-1)+min) - (min(num-1)+max);
      |                                     ~~~^~~~~~~
Language: C++

using namespace std;

int main()
{
    int A,B,N,K;
    cin>>N,A,B;
    
    if (A<B)
    if (N<=2)
    K=1;
    
    else
    K=(N-2)*(B-A+1);
    
    else if (A==B)
    K=1;
    
    else
    K=0;
    
    cout<<K<<endl;
    
    return 0;
}

    


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin>>N,A,B;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:21:5: error: 'cout' was not declared in this scope
   21 |     cout<<K<<endl;
      |     ^~~~
a.cc:21:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:21:14: error: 'endl' was not declared in this scope
   21 |     cout<<K<<endl;
      |              ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

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

typedef long long ll;

int main() {
	ll n, a, b;
	scanf("%lld %lld %lld", &n, &a, &b);
	printf("%lld", max(0, b * (n - 2) - a * (n - 2) + 1));
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:27: error: no matching function for call to 'max(int, ll)'
    9 |         printf("%lld", max(0, b * (n - 2) - a * (n - 2) + 1));
      |                        ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:9:27: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
    9 |         printf("%lld", max(0, b * (n - 2) - a * (n - 2) + 1));
      |                        ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:9:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
    9 |         printf("%lld", max(0, b * (n - 2) - a * (n - 2) + 1));
      |                        ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~