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

#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define vi vector<int>
#define nl endl
#define tc    \
    ll t;     \
    cin >> t; \
    while (t--)
#define fastio                       \
    ios_base::sync_with_stdio(NULL); \
    cin.tie(NULL);                   \
    cout.tie(NULL);
using namespace std;
int main()
{
    fastio;
    ll n, a, b;
    cin >> n >> a >> b;
    if((n==1&&a==b)
        cout<<"1";
    else if(n!=1&&n!=2&&a<=b)
        cout<<(n-2)*(b-a)+1;
    else cout<<"0";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:20: error: expected ';' before 'cout'
   20 |     if((n==1&&a==b)
      |                    ^
      |                    ;
   21 |         cout<<"1";
      |         ~~~~        
a.cc:22:5: error: expected primary-expression before 'else'
   22 |     else if(n!=1&&n!=2&&a<=b)
      |     ^~~~
a.cc:21:19: error: expected ')' before 'else'
   21 |         cout<<"1";
      |                   ^
      |                   )
   22 |     else if(n!=1&&n!=2&&a<=b)
      |     ~~~~           
a.cc:20:7: note: to match this '('
   20 |     if((n==1&&a==b)
      |       ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:12:26: error: called object is not a function or function pointer
   12 |         printf("%lld", (b-a)(n-2)+1);
      |                        ~~^~~
Language: C++

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


int main() {
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
	ll n, a, b;
	cin >> n >> a >> b;
	if(n == 1 and a == b) cout << 1;
	else if(n == 1) cout << 0;
	else if(a > b) cotu << 0;
	else cout << (n-2)*(b-a)+1;



}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:24: error: 'cotu' was not declared in this scope
   15 |         else if(a > b) cotu << 0;
      |                        ^~~~
Language: C++

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


int main() {
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
	ll n, a, b;
	cin >> n >> a >> b;
	if(n == 1 and a == b) cout << 1;
	else if(n == 1) cout << 0;
	else if(a > b) cotu << 0;
	else cout << (b-2)*(b-a)+1;



}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:24: error: 'cotu' was not declared in this scope
   15 |         else if(a > b) cotu << 0;
      |                        ^~~~
Language: C++

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


int main() {
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif

	ll n, a, b;
	cin >> n >> a >> b;
	if(a > b) cout << 0;
	if(n == 1) {
		if(a == b) {
			cout << 1;
		} else cout << 0;

		return 0;
	}

	ll ans = (b-2)(b-a);
	cout << ++ans;



}

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

n,a,b = map(int,input().split())
if a > b:
    print(0)
    exit()

if n == 1:
    if a == b:
        print(1)
    else:
        print(0)
    exit()

print((b-a)*(n-2)+1)


Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n,a,b = map(int,input().split())
      | ^
Language: C++

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

using namespace std;

int main() {
  int N, A, B;
  cin >> N >> A >> B;
  if (A > B) {
    printf("0\n");
    return 0;
  }
  if (N == 1) {
    printf("%d\n", A == B);
  } else if (N == 2) {
    printf("1\n");
  } else {
    printf("%lld\n", (ll)(B - A) * (N - 2) + 1);
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:23: error: 'll' was not declared in this scope
   20 |     printf("%lld\n", (ll)(B - A) * (N - 2) + 1);
      |                       ^~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: 'else' without a previous 'if'
   18 |   } else {
      |     ^~~~
Language: C++

#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;


int main() {
    int N, A, B;
    cin >> N >> A >> B;
  int C = max(A, B);
  int D = min(A, B);

    if (N == 1 && A != B) {
        cout << 0 << endl;
    }
    else if (N == 2) {
        cout << 1 << endl;
    }
  else if(C-D+1 < N){
    cout << 0 << endl;
    else {
        cout << ((N - 1) * B + A) - ((N - 1) * A + B) + 1 << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:5: error: expected '}' before 'else'
   35 |     else {
      |     ^~~~
a.cc:33:21: note: to match this '{'
   33 |   else if(C-D+1 < N){
      |                     ^
Language: C++

#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;


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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:25:16: error: lvalue required as left operand of assignment
   25 |     if (N == 1 && A = B) {
      |         ~~~~~~~^~~~
Language: C++

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: 'C' was not declared in this scope
   11 |     cout<<C<<endl;
      |           ^
a.cc:12:2: error: expected '}' at end of input
   12 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

int main(){
    ll N,A,B,rs=0,Nans,min,max;
    cin >> N >> A >> B;

    if(N == 1){
        if(A == B)
            cout << 1 << endl;
        else
            cout << 0 << endl;
    }else if(A > B){
        cout << 0 << endl;
    }else{
        Nans = N - 2;
        max = B * (Nans+1) + A;
        min = A * (Nans+1) + B;
        rs = max - min + 1;
        cout << rs << endl;
    }

    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:5: error: 'll' was not declared in this scope
    2 |     ll N,A,B,rs=0,Nans,min,max;
      |     ^~
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> N >> A >> B;
      |     ^~~
a.cc:3:12: error: 'N' was not declared in this scope
    3 |     cin >> N >> A >> B;
      |            ^
a.cc:3:17: error: 'A' was not declared in this scope
    3 |     cin >> N >> A >> B;
      |                 ^
a.cc:3:22: error: 'B' was not declared in this scope
    3 |     cin >> N >> A >> B;
      |                      ^
a.cc:7:13: error: 'cout' was not declared in this scope
    7 |             cout << 1 << endl;
      |             ^~~~
a.cc:7:26: error: 'endl' was not declared in this scope
    7 |             cout << 1 << endl;
      |                          ^~~~
a.cc:9:13: error: 'cout' was not declared in this scope
    9 |             cout << 0 << endl;
      |             ^~~~
a.cc:9:26: error: 'endl' was not declared in this scope
    9 |             cout << 0 << endl;
      |                          ^~~~
a.cc:11:9: error: 'cout' was not declared in this scope
   11 |         cout << 0 << endl;
      |         ^~~~
a.cc:11:22: error: 'endl' was not declared in this scope
   11 |         cout << 0 << endl;
      |                      ^~~~
a.cc:13:9: error: 'Nans' was not declared in this scope
   13 |         Nans = N - 2;
      |         ^~~~
a.cc:14:9: error: 'max' was not declared in this scope
   14 |         max = B * (Nans+1) + A;
      |         ^~~
a.cc:15:9: error: 'min' was not declared in this scope; did you mean 'main'?
   15 |         min = A * (Nans+1) + B;
      |         ^~~
      |         main
a.cc:16:9: error: 'rs' was not declared in this scope
   16 |         rs = max - min + 1;
      |         ^~
a.cc:17:9: error: 'cout' was not declared in this scope
   17 |         cout << rs << endl;
      |         ^~~~
a.cc:17:23: error: 'endl' was not declared in this scope
   17 |         cout << rs << endl;
      |                       ^~~~
Language: Java

import java.io.*;
import java.math.*;
import java.util.*;
public class AGC015APlusB { 
 
	public static void main(String[] args) { 
		FastScanner I = new FastScanner(); //Input
		OutPut O = new OutPut(); //Output
		long ans = 0;
		long N = I.nextLong();
		long A = I.nextLong();
		long B = I.nextLong();
		if (A<=B&&N>=2) {
			N-=2;
			long lo = N*A;
			long hi = N*B;
			ans=hi-lo+1;
			ans = Math.max(ans, 0);
		}else if (N==1&&A==B) ans++;
		O.pln(ans);
	}
	public static long GCD(long a, long b) {
		if (a==0||b==0) return Math.max(a,b);
		return GCD(Math.min(a, b),Math.max(a, b)%Math.min(a, b));
	}
	public static long FastExp(long base, long exp, long mod) {
		long ans=1;
		while (exp>0) {
			if (exp%2==1) ans*=base;
			exp/=2;
			base*=base;
			base%=mod;
			ans%=mod;
		}
		return ans;
	}
	public static long ModInv(long num,long mod) {return FastExp(num,mod-2,mod);}
	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		int nextInt() {return Integer.parseInt(next());}
		long nextLong() {return Long.parseLong(next());};
	}
	static class OutPut{
		PrintWriter w = new PrintWriter(System.out);
		void pln(int x) {w.println(x);w.flush();}
		void pln(long x) {w.println(x);w.flush();}
		void pln(String x) {w.println(x);w.flush();}
		void pln(char x) {w.println(x);w.flush();}
		void p(int x) {w.print(x);w.flush();}
		void p(long x) {w.print(x);w.flush();}
		void p(String x) {w.print(x);w.flush();}
		void p(char x) {w.print(x);w.flush();}
	}
}

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:2: error: 'll' was not declared in this scope
    5 |  ll n,a,b;
      |  ^~
a.cc:6:10: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |   cin >> n >> a >> b;
      |          ^
      |          yn
a.cc:6:15: error: 'a' was not declared in this scope
    6 |   cin >> n >> a >> b;
      |               ^
a.cc:6:20: error: 'b' was not declared in this scope
    6 |   cin >> n >> a >> b;
      |                    ^
Language: C++

#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define vec_input(v) for(auto it=v.begin();it!=v.end();it++){cin>>*it;}
#define vec_output(v) for(auto it=v.begin();it!=v.end();it++){if(it!=v.begin())cout<<" ";cout<<*it;}cout<<endl;
#define vec_debug(v) for(auto it=v.begin();it!=v.end();it++){cerr<<*it<<" ";}cerr<<endl;
#define yn(ans) cout<<(ans?"Yes":"No")<<endl
#define YN(ans) cout<<(ans?"YES":"NO")<<endl
#define umap unordered_map
#define uset unordered_set
using namespace std;
using ll = long long;
template <typename T>T digitsum(T n);
template <typename T>bool isPrime(T n);
template <typename T>vector<pair<T, T>> prime_factor(T n);
long long int intpow(long long int,long long int);
template <typename T>T intlog(T);
long long int combination(long long int,long long int);
long long int arith_sum1(long long int,long long int,long long int);
long long int arith_sum2(long long int,long long int,long long int);
long long int series_sum(long long int);

int main(){
    ll n,a,b,ans;
    cin>>n>>a>>b;
    if(a==b){
        cout<<1<<endl;
        return 0;
    }
    if(a>b){
        cout<<0<<endl;
        return 0;
    }
    if(n>=3){
        cout<<arith_sum1(b-a+1,n-2,-1)<<endl;
    }
    if(n==2){
        cout<<1<<endl;
    }
    if(n==1){
        cout<<0<<endl;
    }
}

Compiler output:
/usr/bin/ld: /tmp/cc2MMzEO.o: in function `main':
a.cc:(.text+0xeb): undefined reference to `arith_sum1(long long, long long, long long)'
collect2: error: ld returned 1 exit status
Language: C++

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


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

n,a,b=map(int,input().split())
if a>b:
  print(0)
elif n==1 and a!=b:
  print(0)
else:
  print(b*(n-1)+a-(b+a*(n-1))+1)

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n,a,b=map(int,input().split())
      | ^
Language: C++

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

typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
#define int ll

const ll MOD = 1000000007;
const ll INF_LL = (ll)1000000007 * 1000000007;
const int INF_INT = (int)1000000007;
const double PI = 3.14159265358979323846;

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

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define irep(itr, st) for (auto itr = (st).begin(); itr != (st).end(); ++itr)
#define irrep(itr, st) for (auto itr = (st).rbegin(); itr != (st).rend(); ++itr)

#define m0(x) memset((x), 0, sizeof((x)))
#define m1(x) memset((x), -1, sizeof((x)))

// xにはvectorなどのコンテナ
#define ALL(x) (x).begin(), (x).end()  // sortなどの引数を省略したい
#define RALL(x) (x).rbegin(), (x).rend()  // sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size())     // sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))  //最大値を求める
#define MIN(x) *min_element(ALL(x))  //最小値を求める
#define all(x) (x).begin(), (x).end()

//略記
#define pb emplace_back  // vectorヘの挿入
#define mp make_pair     // pairのコンストラクタ
#define F first          // pairの一つ目の要素
#define S second         // pairの二つ目の要素

#define BITCOUNT __builtin_popcount
#define BITCOUNT_LL(x) __builtin_popcountll(x)

#define perm(c)             \
  sort(all(c));             \
  for (bool c##p = 1; c##p; \
       c##p = next_permutation(all(c)))  //順列 123 132 213 231 312 321

#define BIT(n) (1LL << (n))

#ifdef DEBUG
#define PRINT(A) std::cout << (#A) << ": " << (A) << std::endl;
#else
#define PRINT(A)
#endif

//入力高速化
struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} iosetup;

template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}

template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:86:6: error: 'N' was not declared in this scope
   86 |   if(N <= 2 || A >= B){
      |      ^
Language: C++

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


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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: no matching function for call to 'max(int64_t, int)'
   10 |     cout<<max((B-A)*(N-2)+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 int' and 'int')
   10 |     cout<<max((B-A)*(N-2)+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 int'
   10 |     cout<<max((B-A)*(N-2)+1,0)<<endl;
      |           ~~~^~~~~~~~~~~~~~~~~
Language: C++

#include<algorithm>//sort(all(変数),greater<型名>())で降順に、*max_element(all(変数))で最大値を獲得
#include<bits/stdc++.h>
#include<cmath>//切り上げceil(値)
#include<deque>
#include<iomanip>//setprecision(数字)
#include<iostream>
#include<list>
#include<map>
#include<numeric>
// xとyのgcdは__gcd(x,y),xとyのlcmは(x*y)/__gcd、accumulate(all(変数),0)で要素の全加算
#include<queue>//priority_queue<型名> 変数
#include<set>
#include<stack>
#include<string>//変数.substr(どこから,いくつ)
#include<vector>
#define rep(i,n)  for(ll i=0; i<n; i++)
#define rrep(i,n) for(ll i=n-1; 0<=i; i--)
#define vll vector<ll>
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define INF 1e9
using ll = long long;
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

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


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

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

using ll = long long;
using vi = vector<int>;
using vi2 = vector<vector<int>>;
#define MP(a,b) make_pair((a),(b))
#define MT(...) make_tuple(__VA_ARGS__)

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)

#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl;
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl;

#define DCOUT(x,n) cout << fixed << setprecision(n) << (x) << endl;

#define sz(x) (int)(x).size()
#define HOGE cout << "hoge" << endl;

template<typename T>inline istream& operator>>(istream&i,vector<T>&v)
{REP(j,sz(v))i>>v[j];return i;}

const int INF = 1e9;


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


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

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
typedef pair<int, int> P;
ll Mod = 1000000007;
int main() {
  ll N,A,B;
  cin >> N >> A >> B;
  cout << max(0,(B * (N - 1) + A) - (A * (N - 1) + B) + 1) << endl;
  return 0;
}


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

#include <bits/stdc++.h>

using namespace std;

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

	long long int n,a,b;

	cin >> n >> a >> b;
	long long int hi = (n-1)*b + a;
	long long int lo = (n-1)*a + b;
	
	cout << max(0,hi-lo+1) << '\n';

	return 0;
}

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

#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;

set<ll> st;

void func(int n, int a, int b, ll acc) {
  if (n <= 0) {
    st.insert(acc);
    return;
  }
  for (int i = a; i <= b; i++) {
    func(n - 1, a, b, acc + i);
  }
}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:24:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
   24 |     return;
      |     ^~~~~~
a.cc:27:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
   27 |     return;
      |     ^~~~~~
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main(void)
{
    long long n,a,b;
    cin >> n >> a >> b;
    cout << max(0,b*(n-1)+a-(a*(n-1)+b)+1);
    return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> PLL;
typedef vector<int> VI;
typedef vector<double> VL;
typedef vector<string> VS;
typedef vector<PLL> VP;
typedef vector<ll> VLL;
#define rep(i,n) for (ll i=0; i<(ll)(n); i++)
#define repd(i,n) for (ll i=n-1; i>=0; i--)
#define rept(i,m,n) for(ll i=m; i<n; i++)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define PF push_front
#define PB push_back
#define SORT(V) sort((V).begin(), (V).end())
#define RVERSE(V) reverse((V).begin(), (V).end())
#define paired make_pair
#define PRINT(V) for(auto v : (V)) cout << v << " "
int ctoi(char c) { if (c >= '0' && c <= '9') { return c - '0'; } return 0; } //charを整数に

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

Compiler output:
a.cc: In function 'int main()':
a.cc:28:5: error: 'else' without a previous 'if'
   28 |     else if(N==1){
      |     ^~~~
Language: C++


#include<iostream>

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


Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: expected '(' before '{' token
   16 |         {
      |         ^
      |         (
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:2: error: 'ele' was not declared in this scope
   10 |  ele if(A<=B){ int64_t ans=(N-2)*(B-A)+1;
      |  ^~~
a.cc:12:3: error: 'else' without a previous 'if'
   12 |   else
      |   ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <queue>
#include <cmath>
#include <map>
#include <iomanip>

using namespace std;
using ll = long long;

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


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

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

using namespace std;

typedef long long int ll;
typedef pair<ll, ll> pll;

#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll) 1e15;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N, A, B;
    cin >> N >> A >> B;
    if (A > B || (A != B && N == 1)) {
        cout << 0 << endl;
        return 0;
    }

    ll min = A * (N - 1) + B;
    ll max = A + B * (N - 1);
    cout << max - min + 1LL << endl;
    return 0;
}

Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | v#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'v' does not name a type
    1 | v#include <bits/stdc++.h>
      | ^
a.cc:6:9: error: 'pair' does not name a type
    6 | typedef pair<ll, ll> pll;
      |         ^~~~
a.cc: In function 'int main()':
a.cc:16:5: error: 'cin' was not declared in this scope
   16 |     cin.tie(0);
      |     ^~~
a.cc:17:5: error: 'ios' has not been declared
   17 |     ios::sync_with_stdio(false);
      |     ^~~
a.cc:21:9: error: 'cout' was not declared in this scope
   21 |         cout << 0 << endl;
      |         ^~~~
a.cc:21:22: error: 'endl' was not declared in this scope
   21 |         cout << 0 << endl;
      |                      ^~~~
a.cc:27:5: error: 'cout' was not declared in this scope
   27 |     cout << max - min + 1LL << endl;
      |     ^~~~
a.cc:27:32: error: 'endl' was not declared in this scope
   27 |     cout << max - min + 1LL << endl;
      |                                ^~~~
Language: C++

N,A,B=map(int,input().split())

m=A*(N-1)+B
M=A+B*(N-1)
ans=M-m+1
ans=max(ans,0)
print(ans)

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N,A,B=map(int,input().split())
      | ^
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<cmath>
#include<map>
#include<iomanip>
#define rip(i,n) for(int i=0;i<n;i++)
#define ll long long
#define lb long double
#define vec vector<int>
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 if (n == 2)cout << "2" << endl;
	else {
		cout << (n - 2)(b - a) + 1 << endl;
	}
}

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

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=1000000007;
const double PI=3.14159265358979;
const ll INF= pow(10,18);
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";

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

Compiler output:
a.cc: In function 'int main()':
a.cc:21:2: error: expected '}' at end of input
   21 | }
      |  ^
a.cc:15:12: note: to match this '{'
   15 | int main() {
      |            ^
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){
  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{
  print((B - A) * (N - 2) + 1);
  return 0;
}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'print' was not declared in this scope; did you mean 'rint'?
    9 |   print(0);
      |   ^~~~~
      |   rint
a.cc:12:3: error: 'print' was not declared in this scope; did you mean 'rint'?
   12 |   print(1);
      |   ^~~~~
      |   rint
a.cc:15:3: error: 'print' was not declared in this scope; did you mean 'rint'?
   15 |   print(0);
      |   ^~~~~
      |   rint
a.cc:18:3: error: 'print' was not declared in this scope; did you mean 'rint'?
   18 |   print((B - A) * (N - 2) + 1);
      |   ^~~~~
      |   rint
Language: C++

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

int main() {
ll 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{
  print((B - A) * (N - 2) + 1);
  return 0;
}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:1: error: 'll' was not declared in this scope
    5 | ll N, A, B;
      | ^~
a.cc:6:8: error: 'N' was not declared in this scope
    6 | cin >> N >> A >> B;
      |        ^
a.cc:6:13: error: 'A' was not declared in this scope
    6 | cin >> N >> A >> B;
      |             ^
a.cc:6:18: error: 'B' was not declared in this scope
    6 | cin >> N >> A >> B;
      |                  ^
a.cc:9:3: error: 'print' was not declared in this scope; did you mean 'rint'?
    9 |   print(0);
      |   ^~~~~
      |   rint
a.cc:12:3: error: 'print' was not declared in this scope; did you mean 'rint'?
   12 |   print(1);
      |   ^~~~~
      |   rint
a.cc:15:3: error: 'print' was not declared in this scope; did you mean 'rint'?
   15 |   print(0);
      |   ^~~~~
      |   rint
a.cc:18:3: error: 'print' was not declared in this scope; did you mean 'rint'?
   18 |   print((B - A) * (N - 2) + 1);
      |   ^~~~~
      |   rint
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <vector>
using namespace std;
int main(){
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    long long int a,b,n;
    cin>>n>>a>>b;
    if(a>b || (n==1 a<b)){
        printf("0\n");
    }else if(a==b || n==1 || n==2){
        printf("1\n");
    }else{
        printf("%lld\n",(b-a)*(n-2)+1);
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: error: expected ')' before 'a'
   10 |     if(a>b || (n==1 a<b)){
      |               ~    ^~
      |                    )
a.cc:12:6: error: expected ')' before 'else'
   12 |     }else if(a==b || n==1 || n==2){
      |      ^~~~
      |      )
a.cc:10:7: note: to match this '('
   10 |     if(a>b || (n==1 a<b)){
      |       ^
Language: C++

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

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

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

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