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

#include <iostream>
using namespace std;

//计算n的阶乘 
long long int jc(long long int n){
    long long int i,res=1;
    for(i=1;i<=n;i++){
        res=res*i;
    } 
    return res;
}

//计算组合数
long long int C(long long int m,long long int n){
    return (jc(n))/(jc(m)*jc(n-m));
} 

long long int main(void)
{

    long long int n,a,b;
    cin>>n>>a>>b;
    if(n == 1 && a == b) cout<<1<<endl;
    else if(n <= 1 || b < a || a<=0 || b <=0 ) cout<<0<<endl;
    else if( a == b) cout<<1<<endl;
    else if( n == 2) cout<<1<<endl;
    else cout<<2+C(n-2,b-a+1)<<endl;
    return 0;
}

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

#include <stdio.h>
#include<algorithm>
using namespace std;

int k=0;
int length=0;
int sums[1000000000]={0};
int numbers[1000000000]={0};
void ans(int a,int b,int n)
{
	if(n==0)
	{
	   sums[k]=0;
	   for(int i=0;i<length;i++)
	   		sums[k] +=numbers[i];
	   k++;		
	}
	
	for(int j=n-1;j>=0;j--)
	{
		for(int i=a;i<=b;i++)
		{
		   numbers[j]=i;
		   ans(a,b,n-1);
		}

	}
}

int main()
{
	int n,a,b,sum=0;
	scanf("%d%d%d",&n,&a,&b);
	
	length=n-2;
	ans(a,b,length);
	sort(sums,sums+100);
	int j=unique(sums,sums+100)-sums;
	if(j>0)
	   printf("%d\n",j-1);
	else
	   printf("0\n");
}

Compiler output:
/tmp/ccHdxeBT.o: in function `ans(int, int, int)':
a.cc:(.text+0x6c): relocation truncated to fit: R_X86_64_PC32 against symbol `numbers' defined in .bss section in /tmp/ccHdxeBT.o
a.cc:(.text+0xd0): relocation truncated to fit: R_X86_64_PC32 against symbol `numbers' defined in .bss section in /tmp/ccHdxeBT.o
collect2: error: ld returned 1 exit status
Language: C++

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

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

#include<iostream>
    using namespace std;
int main()
{
    int n,a,b;
cin>>n>>a>>b;
if(n==1&&a==b)
print(1)
else if (n<2||a>b)
    print(0)
else
    print((n-2)*(b-a)+1)
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:1: error: 'print' was not declared in this scope; did you mean 'printf'?
    8 | print(1)
      | ^~~~~
      | printf
Language: C++

#include<iostream>
using namespace std;

int main() {
	int amount, min=0, max=0;
	cin >> amount;
	cin >> min;
	cin >> max;

	if (max < min) { cout << 0; return ; }
	if (amount == 1 && (max != min)) { cout << 0; return ; }
	else if (amount == 1 && max == min) { cout << 1; return ; }
	if (amount < 1) { cout << 0; return ; }

	int count = amount - 2;
	cout << count * max - count * min+1;

	return ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:37: error: return-statement with no value, in function returning 'int' [-fpermissive]
   10 |         if (max < min) { cout << 0; return ; }
      |                                     ^~~~~~
a.cc:11:55: error: return-statement with no value, in function returning 'int' [-fpermissive]
   11 |         if (amount == 1 && (max != min)) { cout << 0; return ; }
      |                                                       ^~~~~~
a.cc:12:58: error: return-statement with no value, in function returning 'int' [-fpermissive]
   12 |         else if (amount == 1 && max == min) { cout << 1; return ; }
      |                                                          ^~~~~~
a.cc:13:38: error: return-statement with no value, in function returning 'int' [-fpermissive]
   13 |         if (amount < 1) { cout << 0; return ; }
      |                                      ^~~~~~
a.cc:18:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   18 |         return ;
      |         ^~~~~~
Language: C++

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

int main(){
	long long int n,A,B;
	cin>>n>>A>>B;
	if(A>B||){
		printf("0\n");
		return 0;
	} 
	if(n==1){
		if(A!=B){
			printf("0\n");
			return 0;
		}
		printf("%lld\n",A);
	}
	long long int sum = (B-A)*(n-2)+1;
	printf("%lld\n",sum);
	return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: expected primary-expression before ')' token
    7 |         if(A>B||){
      |                 ^
Language: C++

#include <iostream>
using namespace std;

//计算n的阶乘 
int jc(int n){
    int i,res=1;
    for(i=1;i<=n;i++){
        res=res*i;
    } 
    return res;
}

//计算组合数
int C(int m,int n){
    return (jc(n))/(jc(m)*jc(n-m));
} 

int main(void)
{
    if(n == 1) return 1;
    if(n <= 0 || b < a) return 0;
    int n,a,b;
    cin>>n>>a>>b;
    
    cout<<2+C(n-2,b-a+1)<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:8: error: 'n' was not declared in this scope
   20 |     if(n == 1) return 1;
      |        ^
a.cc:21:8: error: 'n' was not declared in this scope
   21 |     if(n <= 0 || b < a) return 0;
      |        ^
a.cc:21:18: error: 'b' was not declared in this scope
   21 |     if(n <= 0 || b < a) return 0;
      |                  ^
a.cc:21:22: error: 'a' was not declared in this scope
   21 |     if(n <= 0 || b < a) return 0;
      |                      ^
Language: C++

#include<bits/stdc++.h>
#define lli long long int
#define MOD 1000000007
#define FOR(i,n) for(int i=0;i<(int)N;i++)
#define ALL(x) (x).begin(),(x).end()
using namespace std;

inline int getint(){
    int n;
    scanf("%d",&n);
    return n;
}

inline vector<int> getints(int n){
    vector<int> a(n);
    for(int i=0;i<n;i++)scanf("%d",&a[i]);
    return a;
}

void dumpints(vector<int> a){
  cout<<"[";
  for(int i=0;i<a.size()-1;i++){
    cout<<a[i]<<",";
  }
  cout<<a[a.size()-1]<<"]"<<endl;
}

template<class T> bool ifinclude(vector<T> a,T x){
    auto itr=find(a.begin(),a.end(),x);
    return distance(a.begin(),itr)!=a.size();
}

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


Compiler output:
a.cc: In function 'int main()':
a.cc:39:4: error: 'elif' was not declared in this scope
   39 |   }elif(A<B){
      |    ^~~~
a.cc:45:4: error: 'else' without a previous 'if'
   45 |   }else{
      |    ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
    ll N,A,B;
    cin>>N>>A>>B;
    ll ans=1+(N-2)*(B-A);
    if(ans<0){
        cout<<0<<endl;
    }else{
        cout<<ans<<endl;
    }
    return 0;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'll' was not declared in this scope
    4 |     ll N,A,B;
      |     ^~
a.cc:5:10: error: 'N' was not declared in this scope
    5 |     cin>>N>>A>>B;
      |          ^
a.cc:5:13: error: 'A' was not declared in this scope
    5 |     cin>>N>>A>>B;
      |             ^
a.cc:5:16: error: 'B' was not declared in this scope
    5 |     cin>>N>>A>>B;
      |                ^
a.cc:6:7: error: expected ';' before 'ans'
    6 |     ll ans=1+(N-2)*(B-A);
      |       ^~~~
      |       ;
a.cc:7:8: error: 'ans' was not declared in this scope; did you mean 'abs'?
    7 |     if(ans<0){
      |        ^~~
      |        abs
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<map>
#include<vector>
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define MM = 1000000000;
#define mod = MM + 7;
#define INF (ll)1e18
#define pi acos(-1.0)
#define MAX 10000000005
#define NIL -1
int f(ll m){
    ll multi = 1;
    for(ll i = m; i > 0; i--){
        multi *= i;
    }
    return multi;
}

int main(){
    ll n, a, b, c; cin >> n >> a >> b;
    ll ans = 0;
    if(a > b || (a == b && n != 1)) ans = 0;
    else if(a == b) ans = 1;
    else if(n == 2) ans = 1;
    else {
        ans = f(b-a+1)/(f(n-2)*f(b-a-n+4);
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:42: error: expected ')' before ';' token
   30 |         ans = f(b-a+1)/(f(n-2)*f(b-a-n+4);
      |                        ~                 ^
      |                                          )
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<map>
#include<vector>
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define MM = 1000000000;
#define mod = MM + 7;
#define INF (ll)1e18
#define pi acos(-1.0)
#define MAX 10000000005
#define NIL -1
int f(ll m){
    ll multi = 1;
    for(ll i = m; i > 0; i--){
        multi *= i;
    }
}

int main(){
    ll n, a, b, c; cin >> n >> a >> b;
    ll ans = 0;
    if(a > b || (a == b && n != 1)) ans = 0;
    else if(a == b) ans = 1;
    else if(n == 2) ans = 1;
    else {
        ans = f(b-a+1)/(f(n-2)*f(b-a-n+4);
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int f(ll)':
a.cc:20:1: warning: no return statement in function returning non-void [-Wreturn-type]
   20 | }
      | ^
a.cc: In function 'int main()':
a.cc:29:42: error: expected ')' before ';' token
   29 |         ans = f(b-a+1)/(f(n-2)*f(b-a-n+4);
      |                        ~                 ^
      |                                          )
Language: C++

#include <iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:16:15: error: 'x' was not declared in this scope
   16 |   cout << y - x + 1 << endl;
      |               ^
Language: C++

#include <iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:16:15: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator-'
   16 |   cout << max - min + 1 << endl;
      |           ~~~~^~~~~
Language: C++

#include <iostream>

using namespace std;

long long fact(int x, int k){
  if (x <= k) return x;
  return x*fact(x - 1, k);
}

int main(){
  long long a, b, n;
  cin >> n >> a >> b;
  long long res;
  if (a > b) res = 0;
  else{
    res = fact(n + 3, n) / fact(b - a); 
  }
  cout << res << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:32: error: too few arguments to function 'long long int fact(int, int)'
   16 |     res = fact(n + 3, n) / fact(b - a);
      |                            ~~~~^~~~~~~
a.cc:5:11: note: declared here
    5 | long long fact(int x, int k){
      |           ^~~~
Language: C++

#include <iostream>

using namespace std;

long long fact(x, n){
  if (x <= n) return x;
  return x*fact(x - 1, n);
}

int main(){
  long long a, b, n;
  cin >> n >> a >> b;
  long long res;
  if (a > b) res = 0;
  else{
    res = fact(n + 3, n) / fact(b - a); 
  }
  cout << res << endl;
  return 0;
}

Compiler output:
a.cc:5:16: error: 'x' was not declared in this scope
    5 | long long fact(x, n){
      |                ^
a.cc:5:19: error: 'n' was not declared in this scope
    5 | long long fact(x, n){
      |                   ^
a.cc:5:20: error: expression list treated as compound expression in initializer [-fpermissive]
    5 | long long fact(x, n){
      |                    ^
a.cc: In function 'int main()':
a.cc:16:15: error: 'fact' cannot be used as a function
   16 |     res = fact(n + 3, n) / fact(b - a);
      |           ~~~~^~~~~~~~~~
a.cc:16:32: error: 'fact' cannot be used as a function
   16 |     res = fact(n + 3, n) / fact(b - a);
      |                            ~~~~^~~~~~~
Language: C++

#include<cstdio>

using namespace std;

int main()
{
	long long n,a,b;
	cin>>n>>a>>b;
	cout<<(n*b)-(n*a)+1<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'cin' was not declared in this scope
    8 |         cin>>n>>a>>b;
      |         ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<cstdio>
  +++ |+#include <iostream>
    2 | 
a.cc:9:9: error: 'cout' was not declared in this scope
    9 |         cout<<(n*b)-(n*a)+1<<endl;
      |         ^~~~
a.cc:9:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:9:30: error: 'endl' was not declared in this scope
    9 |         cout<<(n*b)-(n*a)+1<<endl;
      |                              ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include<cstdio>
  +++ |+#include <ostream>
    2 |
Language: C++

#include<bits/stdc++.h>
int a,b;
int main(){
    scanf("%d%d",&a,&b);
    printf("%d\n",n==1&&a<=b?(b-a)*(n-2)+1:0);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:19: error: 'n' was not declared in this scope; did you mean 'yn'?
    5 |     printf("%d\n",n==1&&a<=b?(b-a)*(n-2)+1:0);
      |                   ^
      |                   yn
Language: C++

#include<iostream>
using namespace std;
int mian()
{
	int a,b;
	cin>>a>>b;
	int sum=0;
	for(int i=a;i<=b;i++)
	{sum=sum+i;}
	cout<<sum;
	return 0;	
} 

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long c,a,b;
    cin>>c>>a>>b;
    if(c>1&&b>=a||c==1&&a==b) cout<<(n-2)*(b-a)+1<<endl;
    else cout<<0<<endl; 
 } 

Compiler output:
a.cc: In function 'int main()':
a.cc:7:38: error: 'n' was not declared in this scope
    7 |     if(c>1&&b>=a||c==1&&a==b) cout<<(n-2)*(b-a)+1<<endl;
      |                                      ^
Language: C++

#include<iostream>
using namespace std;
int main(){
	long long a;
	long longn,b;
	cin>>n>>a>>b;
	if(n>1&&b>=a||n==1&&a==b){
		cout<<(n-2)*(b-a)+1;
		return 0;	
	}else{
		cout<<"0";
	}
	return 0;
}

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

#include<iostream>
using namespace std;
int main(){
	long long a;
	long longn,b;
	cin>>n>>a>>b;
	if(n>1&&b>=a||n==1&&a==b){
		cout<<(n-2)*(b-a)+1;
		return 0;	
	}
	return 0;
}

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

#include <iostream>
using namespace std;

#define int long long

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

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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long long N,A,B;
  cin >> N >> A >> B;
  long long M,m;
  M=(N-2)*B;
  m=(N-2)*A;
  cout << max(M-m+1,0) << endl;
}

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

#include <bits/stdc++.h>
using namespace std;
int main(){
long long int N, A, B; 
cin >> N >> A >> B; 
if(N == 1 && A == B){
cout << 1 << endl; 
}
else if(N == 1 && A != B){
cout << 0 << endl; 
}
else if(A > B){
cout << 0 << endl; 
}
else{
cout << (N-2) * (B - A) + 1 << endl; 
}

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

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

#define clr(i, j)     memset(i, j, sizeof(i))
#define pb            push_back
#define mp            make_pair
typedef long long     ll;

int a,b,c;
int arr[101][101][101];
int main()
{
 /*cin>>a>>b>c;
for(int i=0;i<a;i++){
    int x,y,z;cin>>x>>y>>z;
    arr[x][y][z]++;
}
  for(int i = 1 ; i<=100 ; ++i)
        for(int j = 1 ; j<=100 ; ++j)
            for(int a = 0 ; a<=m ; ++a)
            {
               arr[i][j][a] += arr[i-1][j][a] + arr[i][j-1][a];
                arr[i][j][a] -= arr[i-1][j-1][a];
            }*/
int a,b,c;cin>>a>>b>>c;
if(b>c||a==0||a==1&&b!=c){cout<<0;}else{
    
    if(a==1){cout<<1;}else{
        
        cout<<(c-b)*(b-2):
    }
}

}
/*
2
2
2 3
2
2 4
*/


Compiler output:
a.cc: In function 'int main()':
a.cc:30:26: error: expected ';' before ':' token
   30 |         cout<<(c-b)*(b-2):
      |                          ^
      |                          ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,x,y;
    cin>>n>>x>>y;
    if(n>=1&&b>=a){
        cout<<(n-2)*(a+b)<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: 'b' was not declared in this scope
    6 |     if(n>=1&&b>=a){
      |              ^
a.cc:6:17: error: 'a' was not declared in this scope
    6 |     if(n>=1&&b>=a){
      |                 ^
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#define INF 1000000000
#define MOD 1000000007

using namespace std;

int main()
{
    long long n;
    long long a, b;

    cin >> n;
    cin >> a >> b;

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

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:24: error: expression cannot be used as a function
   26 |         cout << (b - a)(n - 2) + 1 << endl;
      |                 ~~~~~~~^~~~~~~
Language: C++

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

int main() {
    ll n, a, b;
    cin >> n >> a >> b;
    
    ll ans = (a+b*(n-1)) - (a*(n-1)+b) + 1;
    cout << max(ans, 0) << endl;
}


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

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

Compiler output:
a.cc:3:6: error: expected constructor, destructor, or type conversion before '(' token
    3 | scanf("%ld%ld%ld",&n,&a,&b);
      |      ^
a.cc:4:1: error: expected unqualified-id before 'if'
    4 | if(n==1){
      | ^~
a.cc:10:1: error: expected unqualified-id before 'else'
   10 | else{
      | ^~~~
a.cc:16:7: error: expected constructor, destructor, or type conversion before '(' token
   16 | printf("%ld\n",ans);
      |       ^
a.cc:17:1: error: expected unqualified-id before 'return'
   17 | return 0;
      | ^~~~~~
a.cc:18:1: error: expected declaration before '}' token
   18 | }
      | ^
Language: C++

#include<bits/stdc++.h>
typedef long long ll;

using namespace std;
ll n, a, b, cnt;

int main(){
	cin >> n >> a >> b;
	if(a > b)cout << 0, return 0;

	if(n == 1){
		if(a == b) cout << 1;
		else cout << 0;
		return 0;
	}
		cout << (b - a) * (b - 2) + 1;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:29: error: expected primary-expression before 'return'
    9 |         if(a > b)cout << 0, return 0;
      |                             ^~~~~~
Language: C++

#include<bits/stdc++.h>
typedef long long ll;

using namespace std;
ll n, a, b, cnt;

int main(){
	cin >> n >> a >> b;

	if(n == 1){
		if(a === b)cout << 1;
		else cout << 0;
		return 0;
	}
	if(a <= b)cout << (b - a) * (b - 2) + 1;
	else{
		cout << 0;
	}
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:24: error: expected primary-expression before '=' token
   11 |                 if(a === b)cout << 1;
      |                        ^
Language: C++

#include <iostream>
using namespace std;
int a, n, m;
int main() {
	cin >> a >> n >> m;
	if (n == m) cout << 1;
	else if (n > m) cout << 0;
	else if (a == 1) cout << 0;
	else if cout << (m - n) * (a - 2) + 1;
  
	cout << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: expected '(' before 'cout'
    9 |         else if cout << (m - n) * (a - 2) + 1;
      |                 ^~~~
      |                 (
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: no matching function for call to 'max(long long int, int)'
    6 |     cout<<max((a-2)*(c-b)+1,0)<<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:6:14: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
    6 |     cout<<max((a-2)*(c-b)+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:
/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:6:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
    6 |     cout<<max((a-2)*(c-b)+1,0)<<endl;
      |           ~~~^~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: 'C' was not declared in this scope
    8 |   if (B > C) ans = 0;
      |           ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
#include<list>
#include<cfloat>
using namespace std;
int mod = 1e9+7;

int main() {
  long long int n, a, b;
  cin >> n >> a >> b;

  long long int ans = ((n-1) * b + a) - ((n-1) * a + b) + 1;
  cout << max(ans, 0) << endl;

  return 0;
}

//


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

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

using namespace std;

#define ll long long

ll MIN(ll num1,ll num2){
    return num1<num2?num1:num2;
}

int main(){

    ll N,A,B;
    cin>>N>>A>>B;
    if((A+B*(N-1))-(A*(N-1)+B)+1)>0)cout<<(A+B*(N-1))-(A*(N-1)+B)+1<<endl;
    else cout<<0<<endl;
    //cout<<(((A+B*(N-1))-(A*(N-1)+B)+1)>0)?(A+B*(N-1))-(A*(N-1)+B)+1:0<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:34: error: expected primary-expression before '>' token
   18 |     if((A+B*(N-1))-(A*(N-1)+B)+1)>0)cout<<(A+B*(N-1))-(A*(N-1)+B)+1<<endl;
      |                                  ^
Language: C++

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

using namespace std;

#define ll long long

ll MIN(ll num1,ll num2){
    return num1<num2?num1:num2;
}

int main(){

    ll N,A,B;
    cin>>N>>A>>B;
    cout<<(((A+B*(N-1))-(A*(N-1)+B)+1)>0)?(A+B*(N-1))-(A*(N-1)+B)+1:0<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:70: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   18 |     cout<<(((A+B*(N-1))-(A*(N-1)+B)+1)>0)?(A+B*(N-1))-(A*(N-1)+B)+1:0<<endl;
      |                                                                     ~^~~~~~
Language: C++

#include <bits/stdc++.h>
#include<iostream>
using namespace std;
int main ()
{
 long long N,A,B;
 cin>>N>>A>>B;





 long long ans;
 if (A>B  ||(N=1 && A!=B)) ans=0; 
 else ans = (B-A) * (B-2)+1
 	cout<<ans;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:28: error: expected ';' before 'cout'
   15 |  else ans = (B-A) * (B-2)+1
      |                            ^
      |                            ;
   16 |         cout<<ans;
      |         ~~~~
Language: C++

#include <bits/stdc++.h>
#include<iostream>
using namespace std;
int main ()
{
 long long N,A,B;
 cin>>N>>A>>B;





 long long ans;
 if (A>B  ||(N=1 && A!=B)) ans=0; 
 else ans = (B-A) * (B-2)+1
 	cout<<ans<<"\n"
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:28: error: expected ';' before 'cout'
   15 |  else ans = (B-A) * (B-2)+1
      |                            ^
      |                            ;
   16 |         cout<<ans<<"\n"
      |         ~~~~
Language: C++

#include "stdafx.h"
#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
#include<stack>
#include<map>
#include<queue>
using namespace std;
int main(){
	int n, a, b;
	cin >> n >> a >> b;
	if (b >= a&&n >= 2) {
		cout << (n - 2)*(b - a) + 1 << endl;
	}
	else if (b <= a)cout << 1 << endl;
	else cout << 0 << endl;
	getchar();
	getchar();
    return 0;
}

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

#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
int main(){
    long long n,a,b;
    cin>>n>>a>>b;
    if(n==1){
        if(a!=b)cout<<0<<endl;
        else cout<<1<<endl;
    }
    else cout<<max(((n-2)*(b-a))+1,0)<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: no matching function for call to 'max(long long int, int)'
   13 |     else cout<<max(((n-2)*(b-a))+1,0)<<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:13:19: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   13 |     else cout<<max(((n-2)*(b-a))+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: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:13:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   13 |     else cout<<max(((n-2)*(b-a))+1,0)<<endl;
      |                ~~~^~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
int main(){
    long long n,a,b;
    cin>>n>>a>>b;
    if(n==1){
        if(a!=b)cout<<0<<endl;
        else cout<<1<<endl;
    }
    else cout<<max(((n-2)*(b-a))+1,0)<<endl;
    return 0;
}
	

Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: no matching function for call to 'max(long long int, int)'
   13 |     else cout<<max(((n-2)*(b-a))+1,0)<<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:13:19: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   13 |     else cout<<max(((n-2)*(b-a))+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: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:13:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   13 |     else cout<<max(((n-2)*(b-a))+1,0)<<endl;
      |                ~~~^~~~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<math.h>
#include<set>
#include<vector>
#include<map>
#include <numeric>
using namespace std;
int main(){
long long int N,A,B;
cin>>N>>A>>B;
if(A>B)
cout<<0<<endl;
if(N==1&&A=B)
cout<<1<<endl;
else if(N==1&&A!=B)
cout<<0<<endl;
if(N>=2&&A<=B)
(B-A)*(N-2)+1
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:8: error: lvalue required as left operand of assignment
   14 | if(N==1&&A=B)
      |    ~~~~^~~
a.cc:19:14: error: expected ';' before '}' token
   19 | (B-A)*(N-2)+1
      |              ^
      |              ;
   20 | }
      | ~
Language: C++

#include<iostream>
#include<algorithm>
#include<math.h>
#include<set>
#include<vector>
#include<map>
#include <numeric>
using namespace std;
int main(){
long long int N,A,B;
cin>>N>>A>>B;
  if(A>B)
  cout<<0<<endl;
  else if(N=1&&A!=B)
  cout<<0<<endl;
  else if(N=1%%A<B)
  cout<<1<<endl;
  else if(N>=2)
  cout<<(B-A)*(N-2)+1<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:15: error: expected primary-expression before '%' token
   16 |   else if(N=1%%A<B)
      |               ^
Language: C++

#include<iostream>
#include<algorithm>
#include<stdio.h>
using namespace std;
#define int long long
 
int main(){
    int n,a,b;
    cin>>n>>a>>b;
    if(a>b||(n==1&&a!=b))cout<<0<<endl;
    else{
    int min=a*(n-1)+b;
    int max=b*(n-1)+a;
    cout<<max-min+1<<endl;
    }
   return 0;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <functional>
using namespace std;

#define Rep(b, e, i) for(int i = b; i <= e; i++)
#define Repr(e, b, i) for(int i = e; i >= b; i--)
#define rep(n, i) Rep(0, n-1, i)
#define repr(n, i) Repr(n-1, 0, i)
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define uniq(x) (x).erase(unique(all(x)),(x).end())

typedef long long ll;

void solve(void){
    ll N, A, B;
    cin >> N >> A >> B;
    cout << max((A+B*(N-1)) - (A*(N-1)+B) + 1, 0) << endl;
}

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


Compiler output:
a.cc: In function 'void solve()':
a.cc:30:16: error: no matching function for call to 'max(ll, int)'
   30 |     cout << max((A+B*(N-1)) - (A*(N-1)+B) + 1, 0) << 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:16: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   30 |     cout << max((A+B*(N-1)) - (A*(N-1)+B) + 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:12:
/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:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   30 |     cout << max((A+B*(N-1)) - (A*(N-1)+B) + 1, 0) << endl;
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <functional>
using namespace std;

#define Rep(b, e, i) for(int i = b; i <= e; i++)
#define Repr(e, b, i) for(int i = e; i >= b; i--)
#define rep(n, i) Rep(0, n-1, i)
#define repr(n, i) Repr(n-1, 0, i)
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define uniq(x) (x).erase(unique(all(x)),(x).end())


void solve(void){
    ll N, A, B;
    cin >> N >> A >> B;
    cout << max((A+B*(N-1)) - (A*(N-1)+B) + 1, 0) << endl;
}

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


Compiler output:
a.cc: In function 'void solve()':
a.cc:27:5: error: 'll' was not declared in this scope; did you mean 'all'?
   27 |     ll N, A, B;
      |     ^~
      |     all
a.cc:28:12: error: 'N' was not declared in this scope
   28 |     cin >> N >> A >> B;
      |            ^
a.cc:28:17: error: 'A' was not declared in this scope
   28 |     cin >> N >> A >> B;
      |                 ^
a.cc:28:22: error: 'B' was not declared in this scope
   28 |     cin >> N >> A >> B;
      |                      ^
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <numeric>
#include <map>
#include <utility>
using namespace std;
#define ll long long
#define int long long
#define rep(i,l,r) for(ll i=(l);i<(r);i++)
int main(void){
    int n,a,b;
    cin>>n>>a>>b;
    if(a>b){
        cout<<0;
        return 0;
    }
    if(n==1&&a-b){
        cout<<0;
        return 0;
    }
    cout<<((n-1)*b+a-(n-1)*a-b+1)<<endl;
    return 0;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <numeric>
#include <map>
#include <utility>
using namespace std;
#define ll long long
#define rep(i,l,r) for(ll i=(l);i<(r);i++)
int main(void){
    int n,a,b;
    cin>>n>>a>>b;
    if(a>b){
        cout<<0;
        return 0;
    }
    if(n==1&&a-b){
        cout<<0;
        return 0;
    }
    }
    cout<<((n-1)*b+a-(n-1)*a-b+1)<<endl;
    return 0;
}

Compiler output:
a.cc:25:5: error: 'cout' does not name a type
   25 |     cout<<((n-1)*b+a-(n-1)*a-b+1)<<endl;
      |     ^~~~
a.cc:26:5: error: expected unqualified-id before 'return'
   26 |     return 0;
      |     ^~~~~~
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: C++

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String N=sc.next();
        char S[]=new char[N.length()];
        int ans=(N.length()-1)*2;
        for(int i=0;N.length()>i;i++){
            S[i]=N.charAt(i);
        }
        for(int j=1;N.length()-1>j;j++){
            if(S[j]=='U'){
                ans+=j*2+N.length()-j-1;
            }else{
                ans+=j+(N.length()-j-1)*2;
            }
        }
        System.out.println(ans);
    }
}

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

#include <bits/stdc++.h>

using namespace std;

const int NMAX = 1000;
const int SIGMA = 26;

string s;
int N, pre[NMAX+2][SIGMA], mx[NMAX+2][SIGMA];
int Ans = NMAX;
int main()
{
    long long A,B;
    cin >> N >> A >> B;
    if( A > B ) {
        cout << "0\n";
        return 0;
    }
    if( A != B && N == 1 ) {
        cout << "0\n";
        return 0;1
    }
    cout << B*N - A*N + 1 - 2*(B - A) << '\n';
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:19: error: expected ';' before '}' token
   21 |         return 0;1
      |                   ^
      |                   ;
   22 |     }
      |     ~