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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for (ll i = (a); i < (b); i++)
#define REP(i,n) rep(i,0,n)

int solve() 
{
    ll n,a,b;cin>>n>>a>>b;
    if(a>b)return 0;
    if(a!=b&&n==1)return 0;
    if(a==b&&n==1)return 1;
    return max(0,(n-2)*(b-a)+1);
}

int main()
{
    cin.tie(0);
	ios::sync_with_stdio(false);
    cout<<solve()<<endl;
    return 0;
}

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

#include<iostream>
using namespace std;

int n,a,b;
int rs;
bool v[1000000010];
void cdt(int ll,int t)
{
	if(t<n)
	for(int i=a;i<=b;i++)
		cdt(ll+i,t+1);
	else
	{
		if(v[ll]=!=1)
		{v[ll]=1;rs++;}
	}
}
int main()
{
	rs=0;
	cin>>n>>a>>b;
	if(n==1){if(a==b)rs=1;}
	else if(n==2){if(a<b)rs=1;}
	else if(n>=3&&a<=b)
	{
		cdt(a+b,2);

	}

	cout<<rs<<endl;
}


Compiler output:
a.cc: In function 'void cdt(int, int)':
a.cc:14:26: error: expected primary-expression before '!=' token
   14 |                 if(v[ll]=!=1)
      |                          ^~
Language: C++

// 015 AGC A - A+...+B Problem 2017/05/27
#include <bits/stdc++.h>
#define rep(i ,n) for(int i=0;i<(int)(n);++i)
using namespace std;
typedef long long int int64;
typedef unsigned long long uint64;

int main(){
    int n; cin >> n;
    int a , b; cin >> a >> b;
    cout << ( b - a)( n - 2 ) + 1 << endl;
}


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

//#include<bits/stdc++.h>
#include<cstdio>
#include<cmath>
#include<iostream>
using namespace std;
const int maxn = 1000;
int a[maxn];


int main(){
    int n, a, b;
    cin >> n >> a >> b;
    longlong  ans =0;
    if(a <= b && n > 1){

        ans = (long long )(b-a)*(n-2)+1;

    }if(n == 1 && a == b) ans =1;

    cout << ans;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'longlong' was not declared in this scope
   13 |     longlong  ans =0;
      |     ^~~~~~~~
a.cc:16:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |         ans = (long long )(b-a)*(n-2)+1;
      |         ^~~
      |         abs
a.cc:18:27: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |     }if(n == 1 && a == b) ans =1;
      |                           ^~~
      |                           abs
a.cc:20:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |     cout << ans;
      |             ^~~
      |             abs
Language: C++

//#include<bits/stdc++.h>
#include<cstdio>
#include<cmath>
#include<iostream>
using namespace std;
const int maxn = 1000;
int a[maxn];


int main(){
    int n, a, b;
    cin >> n >> a >> b;
    longlong  ans =0;
    if(a <= b && n > 1){

        ans = (long long )(b-a)*(n-2)+1

    }if(n == 1 && a == b) ans =1;

    cout << ans;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'longlong' was not declared in this scope
   13 |     longlong  ans =0;
      |     ^~~~~~~~
a.cc:16:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |         ans = (long long )(b-a)*(n-2)+1
      |         ^~~
      |         abs
a.cc:18:27: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |     }if(n == 1 && a == b) ans =1;
      |                           ^~~
      |                           abs
a.cc:20:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |     cout << ans;
      |             ^~~
      |             abs
Language: C++

#include<bits/stdc++.h>
#define sr register short
#define su unsigned short
#define r register int
#define u unsigned int
#define ll long long
#define llr register long long
#define llu unsigned long long
#define lf double
#define Lf long double
using namespace std;
int main()
{
/*#ifndef ONLINE_JUDGE 
    freopen("cpp.in","r",stdin); 
#endif*/
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    ll n,a,b;
    scanf("%lld%lld%lld",&n,&a,&b);
    printf("%lld",max(0,(n-2)*(b-a)+1));
    puts("");
    return 0;
}

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

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

Compiler output:
a.cc:2:20: error: expected ';' before 'int'
    2 | using namespace std
      |                    ^
      |                    ;
    3 | int main(){
      | ~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <math.h>
#include <cstring>
#include <map>
#include <set>
#include <iomanip>
#include <queue>
#include <stack>
#include<bits/stdc++.h>
using namespace std;
int main(){
	int N,A,B;
	scanf("%d%d%d",&N,&A,&B);
	if(B-A<0){
		printf("0\n");
		return 0;
	}
	if(N==1&&(B-A!=0)){
		printf("0\n");
		return 0;
	}
	B=B-A;a
	A=0;
	long long max=(long long)(N-1)*B,min=(long long)B;
	printf("%lld\n",max-min+1);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:15: error: 'a' was not declared in this scope
   24 |         B=B-A;a
      |               ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <numeric>
#include <complex>
#define rep(i,n) for(int (i) = 0; (i) < (n); ++(i))
using namespace std;
typedef long long ll;

int main(){
    ll n, a, b;
    cin >> n >> a >> b;
    if(a>b){
        cout << 0 << endl;
        return 0;
    }
    else{
        cout << max(0,(n-2)*(b-a)+1) << endl;
        return 0;
    }
}


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


/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>
#include <functional>
#include <complex>
#include <list>
#include <cassert>
#include <iomanip>
#include <set>

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printim(a) printf(a ? "possible\n" : "imposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0
#define addf(T) [](T a, T b){return (a + b);}
#define minf(T) [](T a, T b){return min(a, b);}
#define maxf(T) [](T a, T b){return max(a, b);}


using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const long double PI = acos(-1.0L);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}

ll lcm(ll number1, ll number2) {
	return number1 / gcd(number1, number2) * number2;
}

ll LSB(ll n) { return (n & (-n)); }

/*-----------------------------------------ここからコード-----------------------------------------*/


int main() {

	int n, a, b;
	scanf("%d%d%d", &n, &a, &b);
	ll ans = 0;
	if(n == 2 || a == b)ans = 1;
	else if(a > b)ans = 0;
	else ans = (b - a)(n - 2) + 1;
	printf("%lld\n", ans);
	
	Please AC;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:115:27: error: expression cannot be used as a function
  115 |         else ans = (b - a)(n - 2) + 1;
      |                    ~~~~~~~^~~~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: expected ';' before 'cout'
   10 |   N -= 2
      |         ^
      |         ;
   11 |   cout << (B - A) * N + 1 << endl;
      |   ~~~~
Language: C++

import sys
 
stdin = sys.stdin

mod = 1000000007
inf = 1 << 60
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()
nas = lambda: stdin.readline().split()

n, a, b = na()

ans = (n - 2) * b - (n - 2) * a + 1
if ans <= 0:
    print(0)
else:
    print(ans)

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:39: error: expected ')' before ';' token
   16 |     ans = (b*(n-1)+a) - (b+a*(n-1) + 1;
      |                         ~             ^
      |                                       )
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:30: error: 'endl\U0000ff1b' was not declared in this scope
    8 |         cout<<(n-2)*(b-a)+1<<endl；
      |                              ^~~~~~
Language: C++

#include<iostream>
#include<cstdlib>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
 
int main(){
	int n,a,b;
    cin >> n >> a>>b;
    if(n==1 && a != b){
      cout << 0<< endl;
    }else if(a > b){
    	cout << 0 << endl;
    }else{
    	cout << pow(n+1,b-a-1) << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: 'pow' was not declared in this scope
   16 |         cout << pow(n+1,b-a-1) << endl;
      |                 ^~~
Language: C++

#include<iostream>
#include<cstdlib>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
 
int main(){
	int n,a,b;
    cin >> n >> a>>b;
    if(n==1 && a != b){
      cout << 0<< endl;
    }else if(a < b){
    	cout << 0 << endl;
    }else{
    	cout << pow(n+1,b-a-1) << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: 'pow' was not declared in this scope
   16 |         cout << pow(n+1,b-a-1) << endl;
      |                 ^~~
Language: C++

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

int main() {
    int n, a, b;
    cin >> n >> a >> b;
    int min = (n-2)*a;
    int max = (n-2)*b;
    if(n == 1){
        cout << 0 << endl;
    } else if(a > b){
        cout << 0 << endl;
    } else if{
        cout << max - min + 1 << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: expected '(' before '{' token
   13 |     } else if{
      |              ^
      |              (
Language: C

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#define PI 3.141592653589793
#define MOD 1000000007


int main(){
	int n, a, b;
	scanf("%d%d%d", &n, &a, &b);
	if(a>b){
		printf("%d\n", 0);
		//exit(1);
	}
	else if(n == 1){
		if(a == b){
			printf("%d\n", 0);
			//exit(0);
		}
		else{
			printf("%d\n", 0);
			//exit(1);
		}
	}
	/*
	int t1, t2;
	t1 = b, t2 = a;
	t1 += a*(n-1);
	t2 += b*(n-1);
	*/
	else if{
	long int ans = (b-a)*(n-2)+1;
	printf("%ld\n", ans);
	}

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:32:16: error: expected '(' before '{' token
   32 |         else if{
      |                ^
      |                (
main.c:34:25: error: 'ans' undeclared (first use in this function); did you mean 'abs'?
   34 |         printf("%ld\n", ans);
      |                         ^~~
      |                         abs
main.c:34:25: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long a,b,c=0;
	cin>>a>>b;
	for(int i=a;i<b+1;i++)
	{
	    c+=i;
	}
	cout<<i;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: 'i' was not declared in this scope
   11 |         cout<<i;
      |               ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:27: error: lvalue required as left operand of assignment
    7 |     if(a>1 && c>=b || a=1 && c=b)
      |                         ~~^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:30: error: lvalue required as left operand of assignment
    7 |     if((a>1 && c>=b) || (a=1 && c=b))
      |                            ~~^~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: expected '}' before 'else'
   13 |   else{
      |   ^~~~
a.cc:11:19: note: to match this '{'
   11 |   else if (n == 1){
      |                   ^
Language: Java

import java.util.*;

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

Compiler output:
Main.java:9: error: illegal start of expression
    if (A > B || (N == 1 && A != B))) {
                                    ^
Main.java:11: error: 'else' without 'if'
    } else {
      ^
2 errors
Language: Java

import java.util*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int A = sc.nextInt();
    int B = sc.nextInt();
    
    System.out.println(A+(long)B*(N-1)-(long)A*(N-1)-B-1);
  }
}

Compiler output:
Main.java:1: error: ';' expected
import java.util*;
                ^
1 error
Language: C++

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

int main(){
    //input
    long long N,A,B;
    cin >> N >> A >> B;
    //calculate
    long long answer;
    if(A>B)
        answer = 0;
    else if(N==1)
        answer = (a==b ? 1 : 0);
    else
        answer = (B-A)*(N-2)+1;
    //output
    cout << answer << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: 'a' was not declared in this scope
   13 |         answer = (a==b ? 1 : 0);
      |                   ^
a.cc:13:22: error: 'b' was not declared in this scope
   13 |         answer = (a==b ? 1 : 0);
      |                      ^
Language: C++

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

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

#include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) 
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 1000000007
#define FI first
#define SE second
#define MP make_pair
#define PB push_back
#define SZ(x)  (int)x.size()
#define SP(x)  setprecision((int)x)


using namespace std ;
typedef long long ll;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<string> vstr;
typedef pair<int, int> pii;
const int INF = 1e9;
const ll LINF = 1e18;
const double EPS = 1e-9;
ll gcd(ll a, ll b) {return b ? gcd(b, a % b) : a;} //最大公約数
ll lcm(ll a, ll b) {return a / gcd(a, b) * b;} //最小公倍数


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


  return 0 ;
}



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

#include<cstdio>
#include<algorithm>
using namespace std;
long long n,a,b;
int main()
{
  scanf("%lld%lld%lld",&n,&a,&b);
  if(b<a)  swap(a,b);
  if(n==1)  printf("%lld",b-a+1)
  printf("%lld",(n-2)*b-(n-2)*a+1);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:33: error: expected ';' before 'printf'
    9 |   if(n==1)  printf("%lld",b-a+1)
      |                                 ^
      |                                 ;
   10 |   printf("%lld",(n-2)*b-(n-2)*a+1);
      |   ~~~~~~
Language: C++

#include <bits/stdc++.h>

typedef long long ll;

int main()
{
  ll n,a,b;
  cin >> n >> a >> b;
  if (b<a) cout << 0; else
  if (n==1)
  {
    if (a!=b) cout << 0; else cout << 1;
  } else
  if (n==2) cout << 1; else
  {
    cout << (n-2)*(b-a) +1;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |   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:12: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |   if (b<a) cout << 0; else
      |            ^~~~
      |            std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:12:15: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |     if (a!=b) cout << 0; else cout << 1;
      |               ^~~~
      |               std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:12:31: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |     if (a!=b) cout << 0; else cout << 1;
      |                               ^~~~
      |                               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:13: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |   if (n==2) cout << 1; else
      |             ^~~~
      |             std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:16:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |     cout << (n-2)*(b-a) +1;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <iostream>

typedef long long ll;

int main()
{
  ll n,a,b;
  cin >> n >> a >> b;
  if (b<a) cout << 0; else
  if (n==1)
  {
    if (a!=b) cout << 0; else cout << 1;
  } else
  if (n==2) cout << 1; else
  {
    cout << (n-2)*(b-a) +1;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |   cin >> n >> a >> b;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:12: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |   if (b<a) cout << 0; else
      |            ^~~~
      |            std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:12:15: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |     if (a!=b) cout << 0; else cout << 1;
      |               ^~~~
      |               std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:12:31: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |     if (a!=b) cout << 0; else cout << 1;
      |                               ^~~~
      |                               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:13: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |   if (n==2) cout << 1; else
      |             ^~~~
      |             std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:16:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |     cout << (n-2)*(b-a) +1;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

/* @ by batr (T) */
#include <bits/stdc++.h>
 
#define ll long long
#define pb push_back
#define mp make_pair
#define all(X) (X).begin(), (X).end()
 
#define cmp_all(X) (X).begin(), (X).end(), cmp
 
#define B begin()
#define E end()
#define sz size()
#define skip continue
 
#define ppi pair<pair<int, int>, int>
#define pii pair<int, int> 
#define pli pair<ll, int>
#define pcc pair<char, char>
 
#define F first
#define S second

using namespace std;
 
const int maxn = 1e7 + 17;
const int MAXN = maxn * 4;
const int darr = 1e3 + 17;
const ll INF = 1e17 + 5;
const int mod = 1e9 + 7;
 
void Need_For_Speed () {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
}

int n, l, r, ans;
map <int, bool> used;

bool l1, r1;

void rec (int sum, int k, int st) {
	if (k == n - 1) {
		if (!used[sum]) {
			ans++;
			used[sum] = 1;
		}
		return;
	}
	for (int i = st; i <= r; i++) {
		rec(sum + i, k + 1, i);
	}
}

int main () 
	Need_For_Speed();
	cin >> n >> l >> r;
	if (l > r || (n == 1 && l != r)) {
		cout << 0;
		return 0;
	}
	if (n == 1) {
		cout << 1;
		return 0;
	}
	rec(l, 1, l);
	cout << ans;
	return 0;
}	

Compiler output:
a.cc:57:9: error: expected initializer before 'Need_For_Speed'
   57 |         Need_For_Speed();
      |         ^~~~~~~~~~~~~~
a.cc:58:9: error: 'cin' does not name a type
   58 |         cin >> n >> l >> r;
      |         ^~~
a.cc:59:9: error: expected unqualified-id before 'if'
   59 |         if (l > r || (n == 1 && l != r)) {
      |         ^~
a.cc:63:9: error: expected unqualified-id before 'if'
   63 |         if (n == 1) {
      |         ^~
a.cc:67:12: error: expected constructor, destructor, or type conversion before '(' token
   67 |         rec(l, 1, l);
      |            ^
a.cc:68:9: error: 'cout' does not name a type
   68 |         cout << ans;
      |         ^~~~
a.cc:69:9: error: expected unqualified-id before 'return'
   69 |         return 0;
      |         ^~~~~~
a.cc:70:1: error: expected declaration before '}' token
   70 | }
      | ^
Language: C++

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

const int MAXN = 2e3 + 10;

vector<string> grid;
int pref1[MAXN][MAXN], pref2[MAXN][MAXN], pref3[MAXN][MAXN];

int main(){

	//freopen("sample_input.txt", "r", stdin);
	//freopen("sample_output.txt", "w", stdout);

	int t = 1;
	//cin>> t;
	while(t--){
		//memset(grid, 0, sizeof grid);
		memset(pref1, 0, sizeof pref1);
		memset(pref2, 0, sizeof pref2);
		memset(pref3, 0, sizeof pref3);
		int n, m, q, ran;
		cin>> n >> m >> q;
		grid.clear();
		/*for(int i = 0; i < n; i++){
			for(int j = 0; j < m; j++){
				string s;
				cin>> s;
				grid.push_back(s);
			}
			//cout<<endl;
		}*/
      	for(int i = 0; i < n; i++){
          string s;
          cin>> s;
          grid.push_back(s);
        }
		for(int i = 0; i < n; i++){
			for(int j = 0; j < m; j++){
				pref1[i+1][j+1] = pref1[i][j+1] + pref1[i+1][j] - pref1[i][j] + (grid[i][j]=='1');
				if(j != m - 1)
					pref2[i+1][j+1] = pref2[i][j+1] + pref2[i+1][j] - pref2[i][j] + (grid[i][j]=='1' and grid[i][j+1]=='1');
				if(i != n - 1)
					pref3[i+1][j+1] = pref3[i][j+1] + pref3[i+1][j] - pref3[i][j] + (grid[i][j]=='1' and grid[i+1][j]=='1');
			}
		}
		//cin>> q >> ran;
		while(q--){
			int x1, y1, x2, y2;
			cin>> x1 >> y1 >> x2 >> y2;
			x1--; y1--;
			int ans = pref1[x2][y2] - pref1[x1][y2] - pref1[x2][y1] + pref1[x1][y1];
			ans -= pref2[x2][y2-1] - pref2[x1][y2 - 1] - pref2[x2][y1] + pref2[x1][y1];
			ans -= pref3[x2-1][y2] - pref3[x1][y2] - pref3[x2 - 1][y1] + pref3[x1][y1];
			//cout<< x1 << ' ' << y1 << ' ' << x2 << ' ' << y2 << ' ' << ans << endl;
			cout<< ans << endl;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: 'memset' was not declared in this scope
   19 |                 memset(pref1, 0, sizeof pref1);
      |                 ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <iostream>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

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

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

//libs

#include <bits/stdc++.h>

//other stuff

using namespace std;

//function call

//main

int main(){
	int n;
	unsigned int a,b,mx=0,mn=0;
	cin >> n >> a >> b;
	mx=(b*(n-1))+a;
	mn=(a*(n-1))+b;
	if(a=<b){
		cout<<mx-mn+1<<endl;
	}
	else{
		cout<<0<<endl;
	}
return 0;
}

//functions



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

#include <bits/stdc++.h>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: expected ')' before '{' token
   10 |     }else if(A==B{
      |             ~    ^
      |                  )
a.cc:15:1: error: expected primary-expression before '}' token
   15 | }
      | ^
Language: C++

/*最小値、最大値の値はわかっている
N = 1の時は例外的(A==B ならば 1, A != B ならば 0)
N > 1の時、　A > B　ならば　0,　A <= B の時がメイン
A, Bを一つずつ、残りの和の個数を考えると[(N-2)A, (N-2)B]の区間の((A-B)(N-2)個)
取りうる値が区間になることを見越した考察は、より高難易度な問題であっても、すごくたくさん出てくるらしい

A,Bがどのくらい出てくるかなど考えようとしていたが、A,B,Nは非常に大きくなりうるので考察する対象は和くらいしかないことに早く気付くべきだった。
*/
#include <bits/stdc++.h>
using namespace std;
typedef longlong ll;
int main() {
  ll N, A, B; cin >> N >> A >> B;
  if (A > B) cout << 0 << endl;
  else if (N == 1) cout << (A == B ? 1 : 0) << endl;
  else cout << (N - 2) * (B - A) + 1 << endl;
} 
//補足: (条件式 ?　A:B )は　条件式が成り立つならA,成り立たないならB



Compiler output:
a.cc:11:9: error: 'longlong' does not name a type
   11 | typedef longlong ll;
      |         ^~~~~~~~
a.cc: In function 'int main()':
a.cc:13:3: error: 'll' was not declared in this scope
   13 |   ll N, A, B; cin >> N >> A >> B;
      |   ^~
a.cc:13:22: error: 'N' was not declared in this scope
   13 |   ll N, A, B; cin >> N >> A >> B;
      |                      ^
a.cc:13:27: error: 'A' was not declared in this scope
   13 |   ll N, A, B; cin >> N >> A >> B;
      |                           ^
a.cc:13:32: error: 'B' was not declared in this scope
   13 |   ll N, A, B; cin >> N >> A >> B;
      |                                ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, j, n) for (ll i = j; i < n; i++)
#define all(x) (x).begin(),(x).end()
#define INF (1000000000)
#define MOD (1000000007)
#define MAX (100000)
#define pii pair<int, int>

/////////////////////////////////////////////////////////

class XY{
public:
  ll x, y;
  XY() {x = y = 0;}
  XY(ll u, ll v) {x = u; y = v;}
};

template<typename T1, typename T2>
void chmin(T1 &a, T2 b) {if(a > b) a = b;}
template<typename T1, typename T2>
void chmax(T1 &a, T2 b) {if(a < b) a = b;}

template<typename T1, typename T2>
ll mypow(T1 a, T2 n){
  if(n == 0) return 1;
  if(n == 1) return a;
  if(n % 2) return a * mypow(a, n - 1);
  ll tmp = mypow(a, n / 2);
  return tmp * tmp;
}

template<typename T>
int BS(vector<T> V, int left, int right, T key){
  int mid = (left + right) / 2;
  if(V[mid] <= key) left = mid;
  else right = mid;
  if(right - mid == 1) return left;
  else return BS(V, left, right, key);
}

ll comb(ll n, ll r){
	ll res = 1;
  rep(i, 0, r){
    res *= n - i;
    res /= i + 1;
  }
  return res;
}

/////////////////////////////////////////////////////////

void Main() {
  int N, A, B; cin >> N >> A >> B;
  if(A > B){
    cout << 0 << endl;
    return
  }
  if(A != B && N == 1){
    cout << 0 << endl;
    return
  }
  cout << (B * (N - 1) + A) -  (A * (N - 1) + B) + 1 << endl;
}

/////////////////////////////////////////////////////////

int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << std::fixed << std::setprecision(15);

  Main();
}


Compiler output:
a.cc: In function 'void Main()':
a.cc:59:3: error: expected primary-expression before '}' token
   59 |   }
      |   ^
a.cc:58:11: error: expected ';' before '}' token
   58 |     return
      |           ^
      |           ;
   59 |   }
      |   ~        
a.cc:63:3: error: expected primary-expression before '}' token
   63 |   }
      |   ^
a.cc:62:11: error: expected ';' before '}' token
   62 |     return
      |           ^
      |           ;
   63 |   }
      |   ~
Language: C++

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

  const int MOD = 1000000007;
  const int INF = 1e9;

  //long long
  using ll = long long;

  //出力系
  #define print(x) cout << x << endl
  #define yes cout << "Yes" << endl
  #define YES cout << "YES" << endl
  #define no cout << "No" << endl
  #define NO cout << "NO" << endl
  
  // begin() end()
  #define all(x) (x).begin(),(x).end()

  //for
  #define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
  #define REPR(i,n) for(int i=n, i##_len=(n); i>=0; i--)
  #define FOR(i,a,b) for(int i=(a), i##_len=(b); i<i##_len; ++i)

  //最大公約数 
  ll gcd(ll a,ll b){
  if(b == 0) return a;
  return gcd(b,a%b);
  }

  //最小公倍数
  ll lcm(ll a,ll b){
  ll g = gcd(a,b);
  return a / g * b; // Be careful not to overflow  if(a < b) return gcd(b, a);
    unsigned r;
    while ((r=a%b)) {
      a = b;
      b = r;
    }
    return b;
  } 


  //  int X[8]={-1, 0, 1, -1, 1, -1, 0, 1};
  //  int Y[8]={1, 1, 1, 0, 0, -1, -1, -1};




int main() {
int N, A, B;
cin >> N >> A >> B;
int ans;
  
if(N == 1 && B != A){
  print(0);
  return 0;
}else if(N == 1 && A == B){
  print(1);
  return 0;
}else if(N > 1 && A > B){
  print(0);
  return 0;
}else{
  ans = (B − A) * (N − 2) + 1;
}
}


Compiler output:
a.cc:65:12: error: extended character − is not valid in an identifier
   65 |   ans = (B − A) * (N − 2) + 1;
      |            ^
a.cc:65:22: error: extended character − is not valid in an identifier
   65 |   ans = (B − A) * (N − 2) + 1;
      |                      ^
a.cc: In function 'int main()':
a.cc:65:11: error: expected ')' before '\U00002212'
   65 |   ans = (B − A) * (N − 2) + 1;
      |         ~ ^~
      |           )
Language: C++

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

  const int MOD = 1000000007;
  const int INF = 1e9;

  //long long
  using ll = long long;

  //出力系
  #define print(x) cout << x << endl
  #define yes cout << "Yes" << endl
  #define YES cout << "YES" << endl
  #define no cout << "No" << endl
  #define NO cout << "NO" << endl
  
  // begin() end()
  #define all(x) (x).begin(),(x).end()

  //for
  #define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
  #define REPR(i,n) for(int i=n, i##_len=(n); i>=0; i--)
  #define FOR(i,a,b) for(int i=(a), i##_len=(b); i<i##_len; ++i)

  //最大公約数 
  ll gcd(ll a,ll b){
  if(b == 0) return a;
  return gcd(b,a%b);
  }

  //最小公倍数
  ll lcm(ll a,ll b){
  ll g = gcd(a,b);
  return a / g * b; // Be careful not to overflow  if(a < b) return gcd(b, a);
    unsigned r;
    while ((r=a%b)) {
      a = b;
      b = r;
    }
    return b;
  } 


  //  int X[8]={-1, 0, 1, -1, 1, -1, 0, 1};
  //  int Y[8]={1, 1, 1, 0, 0, -1, -1, -1};




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

if(N == 1 && B != A){
  print(0);
  return 0;
}else if(N == 1 && A == B){
  print(1);
  return 0;
}else if(N > 1 && A > B){
  print(0);
  return 0;
}else{
  int ans = (B − A)(N − 2) + 1;
}
}


Compiler output:
a.cc:64:16: error: extended character − is not valid in an identifier
   64 |   int ans = (B − A)(N − 2) + 1;
      |                ^
a.cc:64:23: error: extended character − is not valid in an identifier
   64 |   int ans = (B − A)(N − 2) + 1;
      |                       ^
a.cc: In function 'int main()':
a.cc:64:15: error: expected ')' before '\U00002212'
   64 |   int ans = (B − A)(N − 2) + 1;
      |             ~ ^~
      |               )
Language: Java

import java.util.*;

public class Main{
    
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        sc.close();

        if(A>B || (N == 1 && A!=B)
            System.out.println(0);
        else
            System.out.println(B*(N-1)+A - A*(N-1)-B+1);
    }
}

Compiler output:
Main.java:13: error: ')' expected
        if(A>B || (N == 1 && A!=B)
                                  ^
1 error
Language: C++

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


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