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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const long long INF = 1LL << 60;
const ll MOD = 1000000007;
using pint = pair<ll, ll>;

int main() {
  ll N, M;
  ll a, b;
  cin >> a >> b;
  N = min(a, b);
  M = max(a, b);
  if (N == 1 && M == 1) {
    cout << 1 << endl;
  }
  else if(N-2==0){
    cout << 2 * (M - 2) << endl;
  }
  else if(N-2>=0 && M-2>=0){
    cout << (N-2) * (M - 2) << endl;
  }
  else if(N-2>=0 || M-2>=0{
    cout << max(N-2, M-2) << endl;
  }
  else{
    cout << 0 << endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:27: error: expected ';' before '{' token
   24 |   else if(N-2>=0 || M-2>=0{
      |                           ^
      |                           ;
a.cc:27:3: error: expected primary-expression before 'else'
   27 |   else{
      |   ^~~~
a.cc:26:4: error: expected ')' before 'else'
   26 |   }
      |    ^
      |    )
   27 |   else{
      |   ~~~~
a.cc:24:10: note: to match this '('
   24 |   else if(N-2>=0 || M-2>=0{
      |          ^
Language: C++

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

ll mod = 1e9+7;

int main(){
    ll n,m;
    cin>>n>>m;

    if(n>1 && m>1){
        cout<<n*m-2*n-2*m+4<<endl;
    else if(n==1 && m==1){
        cout<<0<<endl;
    }else if(n==1){
        cout<<m-2<<endl;
    }else{
        cout<<n-2<<endl;
    }
    return 0;
}

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

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

int main(){
  long long N,M;
  cin>>N>>M;
  if(N==1&&M==1){
    cout<<1<<endl;
  }
  #include<bits/stdc++.h>
using namespace std;

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

  }
  else{
    cout<<(N-2)*(M-2)<<endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   13 | int main(){
      |         ^~
a.cc:13:9: note: remove parentheses to default-initialize a variable
   13 | int main(){
      |         ^~
      |         --
a.cc:13:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:13:11: error: a function-definition is not allowed here before '{' token
   13 | int main(){
      |           ^
a.cc: At global scope:
a.cc:32:3: error: expected unqualified-id before 'else'
   32 |   else{
      |   ^~~~
a.cc:35:3: error: expected unqualified-id before 'return'
   35 |   return 0;
      |   ^~~~~~
a.cc:36:1: error: expected declaration before '}' token
   36 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
#define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
 
#define MAXX 200010
 
#define PI   3.14159265358979323846264338327950
 
#define PB push_back 
#define F first
#define S second
 
#define ll 	long long 
 
#define mod  1000000007
 
 
 
int main()
{
	FAST;
	int n, m;
	cin >> n >> m;
	ll ans = 0;
	ans = (n-2)*(m-2);
	cout << max(0, ans);
	return 0;
}

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

#include<bits/stdc++.h>

using namespace std;

#define debug(n) cerr << #n << ':' << n << endl;
#define dline    cerr << __LINE__ << endl;

using ll = long long;
using ull = unsigned long long;
template<class T, class U> using P = pair<T,U>;
template<class T> using Heap = priority_queue<T>;
template<class T> using heaP = priority_queue<T,vector<T>,greater<T>>;
template<class T,class U> using umap = unordered_map<T,U>;
template<class T> using uset = unordered_set<T>;

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

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

template<class T, size_t N, class U>
void Fill(T (&a)[N], const U&v){
    fill((U*)a,(U*)(a+N),v);
}

template<class T>
istream& operator >> (istream&is, vector<T>&v){
  for(auto&e:v)is >> e;
  return is;
}

int main(){
  ll n,m;cin >> n >> m;
  cout << max(0, n*m-(2*n+2*m-4)) << endl;
}


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

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

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

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

#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0;i < (n);i++)
#define all(v) v.begin(),v.end()
#define dec(n) cout << fixed << setprecision(n);
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using vl = vector<ll>;
using vvl = vector<vl>;

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

ll mod(ll a){
  return (a % 1000000007);
}

ll lcm(ll a,ll b){
  return (a*b)/gcd(a,b);
}


int main(){
  ll n,m; cin >> n >> m;
  

  else if(n == 1 && m >= 2){
    cout << m-2 << endl;
  }
  else if(n >= 2 && m == 1){
    cout << n-2 << endl;
  }
  else{
    cout << (n-2)*(m-2) << endl;
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:3: error: 'else' without a previous 'if'
   30 |   else if(n == 1 && m >= 2){
      |   ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
  int64_t n,m;
  cin >> n >> m;
  int64_t ans= abs(n*m-(2*n+2*m-4))
  cout <<ans;
}


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

#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
  int64_t n,m;
  cin >> n >> m;
  int64_t ams= abs(n*m-(2*n+2*m-4))
  cout <<ans;
}


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

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






int main(){
  



  long long n,m;
  cin>>n>>m;
  
  cout<<max(0,(n-2)*(m-2))<<endl;
  


    
  
  
  
}

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

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

int main(){
  ll n,m;cin>>n>>m;
  vector<vector<ll>> v(n,vector<ll>(m));
  if (n==1 ||m == 1){
    cout << max(n,m) - 2 << endl;
    return 0;
  }
  ll sum = (n-2) * (m-2);
  else {
    cout << sum << endl;
  }
}

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

#include<iostream>
using namespace std;
typedef long long ll
ll a,b;
int main(){
    cin>>a>>b;
    cout<<abs((a-2)*(b-2));
}

Compiler output:
a.cc:4:1: error: expected initializer before 'll'
    4 | ll a,b;
      | ^~
a.cc: In function 'int main()':
a.cc:6:10: error: 'a' was not declared in this scope
    6 |     cin>>a>>b;
      |          ^
a.cc:6:13: error: 'b' was not declared in this scope
    6 |     cin>>a>>b;
      |             ^
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <cmath>
#include <cctype>
#include <cstdlib>
#include <stack>
#include <queue>
#include <vector>
#include <algorithm>
#include <list>
#include<map>
#include<set>
using namespace std;

int main() {
    int n, m;
    cin >> n >> m;
  　long long ans;
    if (n >= 4 && m >= 4) ans= n*m-2 * (m + n) - 4 ;
    else if (n == 3 && m >= 4 || n >= 4 && m == 4) ans= n*m-6 ;
    else if (n <= 2 || m <= 2) ans= 0 ;
    else ans=9;
    cout<<ans<<endl;
}


            

   

Compiler output:
a.cc:19:3: error: extended character 　 is not valid in an identifier
   19 |   　long long ans;
      |   ^
a.cc: In function 'int main()':
a.cc:19:3: error: '\U00003000long' was not declared in this scope; did you mean 'ulong'?
   19 |   　long long ans;
      |   ^~~~~~
      |   ulong
a.cc:20:27: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |     if (n >= 4 && m >= 4) ans= n*m-2 * (m + n) - 4 ;
      |                           ^~~
      |                           abs
a.cc:21:52: error: 'ans' was not declared in this scope; did you mean 'abs'?
   21 |     else if (n == 3 && m >= 4 || n >= 4 && m == 4) ans= n*m-6 ;
      |                                                    ^~~
      |                                                    abs
a.cc:22:32: error: 'ans' was not declared in this scope; did you mean 'abs'?
   22 |     else if (n <= 2 || m <= 2) ans= 0 ;
      |                                ^~~
      |                                abs
a.cc:23:10: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |     else ans=9;
      |          ^~~
      |          abs
a.cc:24:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   24 |     cout<<ans<<endl;
      |           ^~~
      |           abs
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#define int long long;
using namespace std;
signed main(){
    int n,m;
    cin>>n>>m;
    int ans;
    if(n==1&m==1){
        ans=1;
    }else{
        ans=abs((n-2)*(m-2));
    }
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:18: error: declaration does not declare anything [-fpermissive]
    4 | #define int long long;
      |                  ^~~~
a.cc:7:5: note: in expansion of macro 'int'
    7 |     int n,m;
      |     ^~~
a.cc:7:9: error: 'n' was not declared in this scope
    7 |     int n,m;
      |         ^
a.cc:7:11: error: 'm' was not declared in this scope; did you mean 'tm'?
    7 |     int n,m;
      |           ^
      |           tm
a.cc:4:18: error: declaration does not declare anything [-fpermissive]
    4 | #define int long long;
      |                  ^~~~
a.cc:9:5: note: in expansion of macro 'int'
    9 |     int ans;
      |     ^~~
a.cc:9:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |     int ans;
      |         ^~~
      |         abs
Language: C++

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

int main() {
  int n,m,;
  long long ans;
  cin>>n>>m;
  if(n==1) cout<<min(m-2,0)<<endl;
  else if(m==1) cout<<min(n-2,0)<<endl;
  else {
    ans=(n-2)*(m-2);
    cout<<ans<<endl;
  }
}


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

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

int main() {
  int n,m,;
  long long ans;
  cin>>n>>m;
  if(n==1) cout<<min(m-2,0)<<endl;
  else if(m==1) cout<<min(n-2,0)<<endl;
  else {
    ans=(n-2)*(m-2);
    cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: error: expected unqualified-id before ';' token
    5 |   int n,m,;
      |           ^
a.cc:13:2: error: expected '}' at end of input
   13 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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


Compiler output:
a.cc:20:5: error: redefinition of 'int main()'
   20 | int main()
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main()
      |     ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'll' was not declared in this scope
    5 |   ll h, w;
      |   ^~
a.cc:6:10: error: 'h' was not declared in this scope
    6 |   cin >> h >> w;
      |          ^
a.cc:6:15: error: 'w' was not declared in this scope
    6 |   cin >> h >> w;
      |               ^
a.cc:7:5: error: expected ';' before 'ans'
    7 |   ll ans = 0;
      |     ^~~~
      |     ;
a.cc:9:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |     ans = h*w-2;
      |     ^~~
      |     abs
a.cc:13:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |   ans = (h-2)*(w-2);
      |   ^~~
      |   abs
Language: C++

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

int main()
{
	long long n, m; cin >> n >> m;
	
	if (m < n) swap(n, m);

	long long ans;

	if (n == 1 && m == 1) {
		ans = 1;
	}
	else if (n == 1) {
		ans = m - 2;
	}
	else {
		ans = (n - 2) * (m - 2);
	}

	cout << ans << endl;

	return 0;


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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// Welcome to my source code!

int main() {
    ll n, m;
    cin >> n >> m;
    if (n == 1 || m == 1) {
        if (n == 1 && m == 1) {
            cout << 1 << endl;
            return 0;
        }
        cout << max(0, max(n, m) - 2) << endl;
        return 0;
    } else if (n == 2 || m == 2) {
        cout << 0 << endl;
        return 0;
    }
    ll ans = (n - 2) * (m - 2);
    cout << ans << endl;
}

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

#include <bits/stdc++.h>

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int, int> PII;

const int N = 100010;
const double eps = 1e-6;

LL n, m, res;

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


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

#include <bits/stdc++.h>
#define ll long long
#define rep(i,a,b) for(long long i=a; i<b; i+=1)
#define repr(i,a,b) for(long long i=a; i<=b; i+=1)
#define vec vector<ll>
#define pb push_back
#define sort(a) sort(a.begin(),a.end())
#define reverse(a) reverse(a.begin(),a.end())

using namespace std;
int main() {
  ll N,M;
  cin>>N>>M;
  if(N>=2 && M>=2) {
  ll A=(N-2)*(M-2);
  cout<<A<<endl;
  }
  if(N==1 || M==1) {
    cout<<"2"<<endl;
  }


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

#include <bits/stdc++.h>
#define ll long long
#define rep(i,a,b) for(long long i=a; i<b; i+=1)
#define repr(i,a,b) for(long long i=a; i<=b; i+=1)
#define vec vector<ll>
#define pb push_back
#define sort(a) sort(a.begin(),a.end())
#define reverse(a) reverse(a.begin(),a.end())

using namespace std;
int main() {
  ll N,M;
  cin>>N>>M;
  if(N>=2 && M>=2) {
  ll A=(N-2)*(M-2);
  cout<<A<<endl;
  }
  if(N=1 || M=1) {
    cout<<"2"<<endl;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:18:10: error: lvalue required as left operand of assignment
   18 |   if(N=1 || M=1) {
      |        ~~^~~~
a.cc:20:4: error: expected '}' at end of input
   20 |   }
      |    ^
a.cc:11:12: note: to match this '{'
   11 | int main() {
      |            ^
Language: C++

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

void flip(int a,int b,vector<vector<int>> vec(vector<int>) {
  for (int i = -1;i<=1;i++) {
    for (int j = -1;j<=1;j++) {
      if (vec.at(i).at(j) == 0) vec.at(i).at(j) = 1;
      else vec.at(i).at(j) = 0;
    }
  }
}
  


int main() {
 long long N,M;
  cin >> N >> M;
  vector<vector<int>> vec(N, vector<int>(M));
  for (int i = 0;i<N;i++) {
    for (int j = 0;j<M;j++) {
      flip(i,j,vec);
    }
  }
  int cnt = 0;
  for (int i = 0;i<N;i++) {
    for (int j=0;j<M;j++) {
      cnt += vec.at(i).at(j);
    }
  }
  cout << N*M-cnt << endl;
  
  
  
}


Compiler output:
a.cc:4:59: error: expected ')' before '{' token
    4 | void flip(int a,int b,vector<vector<int>> vec(vector<int>) {
      |          ~                                                ^~
      |                                                           )
a.cc: In function 'void flip(int, int, std::vector<std::vector<int> > (*)(std::vector<int>))':
a.cc:7:15: error: request for member 'at' in 'vec', which is of non-class type 'std::vector<std::vector<int> > (*)(std::vector<int>)'
    7 |       if (vec.at(i).at(j) == 0) vec.at(i).at(j) = 1;
      |               ^~
a.cc:7:37: error: request for member 'at' in 'vec', which is of non-class type 'std::vector<std::vector<int> > (*)(std::vector<int>)'
    7 |       if (vec.at(i).at(j) == 0) vec.at(i).at(j) = 1;
      |                                     ^~
a.cc:8:16: error: request for member 'at' in 'vec', which is of non-class type 'std::vector<std::vector<int> > (*)(std::vector<int>)'
    8 |       else vec.at(i).at(j) = 0;
      |                ^~
a.cc: In function 'int main()':
a.cc:21:16: error: cannot convert 'std::vector<std::vector<int> >' to 'std::vector<std::vector<int> > (*)(std::vector<int>)'
   21 |       flip(i,j,vec);
      |                ^~~
      |                |
      |                std::vector<std::vector<int> >
a.cc:4:43: note:   initializing argument 3 of 'void flip(int, int, std::vector<std::vector<int> > (*)(std::vector<int>))'
    4 | void flip(int a,int b,vector<vector<int>> vec(vector<int>) {
      |                       ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
int rev(int a){
  int p=0;
  while(a!=0){
    p+=a%10;
    p*=10;
    a/=10;
  }
  return p/10;
}
bool pallin(int a){
  if(a==rev(a))
    return true;
  else
    return false;
}
int32_t main()
{
   int a,b;
  cin>>a>>b;
  if(a==1 || b==1){
    cout<<a+b-3;
  }else{
    ans=a*b;
    ans-=2*a;
    ans-=2*(b-1);
    cout<<ans;
  }
    return 0;
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:26:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   26 |     ans=a*b;
      |     ^~~
      |     abs
Language: C++

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

int main(){
  int n,m;cin>>n>>m;
  ans=(n>2?n-2:(n==2?0:1));
  cout<<ans*(m>2?m-2:(m==2?0:1));
}

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

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,n) for(long long i=0;i<n;++i)
#define REPP(i,m,n) for(long long i=m;i<n;++i)
#define rep(i,n) for(long long i = n-1;i>=0;--i)
#define repp(i,n,m) for(long long i = n-1; i >= m; --i)
#define ALL(N) (N.begin(),N.end())
#define de cout << "line : " << __LINE__ << " debug" << endl;
#define pb push_back
#define pq priority_queue
#define Dcout(N) cout << setprecision(20) << N << endl
constexpr int MOD = 1000000007;
constexpr int INF = 2147483647;
constexpr long long INFF = 9223372036854775807;

bool dp[90][90][14000];

signed main() {
    cin.tie(0);
	ios::sync_with_stdio(false);
    long long N,M;cin >> N >> M;
    if(N == 1 && M == 1){
        cout << 1 << endl;
    }
    else if(N == 1 || M == 1){
        cout << max(0,max(N,M)-2) << endl;
    }
    else if(N == 2 || M == 2){
        cout << N*M - max(N,M)*2 << endl;
    }
    else{
        cout << N*M - 2*(N-2)+2*M << endl;
    }
}

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

#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
typedef long double lb;
typedef pair<int,int> P;
const int MOD = 1000000007;
const ll INF = 1e16;
const double EPS = 1e-10;
const double PI = 3.141592653589793;
template<class T> inline bool chmin(T& a, T b){if(a>b){a = b;return 1;}return 0;}
template<class T> inline bool chmax(T& a, T b){if(a<b){a = b;return 1;}return 0;}
const pair<int,int> fd[] = {make_pair(1,0),make_pair(-1,0),make_pair(0,1),make_pair(0,-1)}; 
#define int long long
#define double long double

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

////////////////////////////////////////////////////////////////////
signed main(){
 int n,m;cin>>n>>m;
  if(n == 1 && m == 1)cout << 1;
  else if(n == 1)cout << m-2 << endl;
  else if(m == 1)cout << n-2 << endl;
  else cout << (n-2)*(m-2) << endl:
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:35: error: expected ';' before ':' token
   26 |   else cout << (n-2)*(m-2) << endl:
      |                                   ^
      |                                   ;
Language: C++

#include <bits/stdc++.h>
#pragma once
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
typedef long double lb;
typedef pair<int,int> P;
const int MOD = 1000000007;
const ll INF = 1e16;
const double EPS = 1e-10;
const double PI = 3.141592653589793;
template<class T> inline bool chmin(T& a, T b){if(a>b){a = b;return 1;}return 0;}
template<class T> inline bool chmax(T& a, T b){if(a<b){a = b;return 1;}return 0;}
const pair<int,int> fd[] = {make_pair(1,0),make_pair(-1,0),make_pair(0,1),make_pair(0,-1)}; 
#define int long long
#define double long double

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

////////////////////////////////////////////////////////////////////
signed main(){
 int n,m;cin>>n>>m;
 cout << (n-2)*(m-2) << endl:
}

Compiler output:
a.cc:2:9: warning: #pragma once in main file
    2 | #pragma once
      |         ^~~~
a.cc: In function 'int main()':
a.cc:24:29: error: expected ';' before ':' token
   24 |  cout << (n-2)*(m-2) << endl:
      |                             ^
      |                             ;
Language: C++

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

int main() {
  ll n, m;
  cin >> n >> m;
  if (n == 1 && m == 1) cout << 1 << endl;
  else if (n == 1 || m == 1) cout << max(n, m)-2 << endl;
  else cout << n*m - (n+m)*2 + 4 << endl;
  return 0;
}

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

#include <iostream>
#include <math.h>
#include <numeric>
#include <vector>
#include <map>
#include <algorithm>
#include <queue>
#include <tuple>
#include <functional>

#define PI 3.14159265359
#define INF 1e9
#define LINF 1e18
#define rep(i,n) for(long long  i = 0; i < n; i++)
#define rep2(i,a,n) for(long long  i = a; i < n; i++)
#define in(a) cin >> a
#define out(a) cout << a << endl
typedef long long ll;

using namespace std;

int main() 
{
    ll n,w; cin >> n >> w;

    if((w >= 2) && (n >= 2)) {
        cout << (w-2)*(n-2) << endl;
    } else if (w == 1 && n == 1) {
        cout << 1 
    } else if (w == 1) { 
        cout << n-2;
    } else if (n == 1) {
        cout << w-2;
    } else {
        cout << 0;
    }

    return 0;
}
    



Compiler output:
a.cc: In function 'int main()':
a.cc:29:18: error: expected ';' before '}' token
   29 |         cout << 1
      |                  ^
      |                  ;
   30 |     } else if (w == 1) {
      |     ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef pair<int, int> Pint;
typedef pair<int64_t, int64_t> Pll;

int main() {
    int64_t N, M;
    cin >> N >> M;
    if (N == 1 || M == 1) {
        if (N == M) {
            cout << 1 << endl;
            return 0;
        }
        cout << N * M - 2 << endl;
        return 0;
    }
    cout << max((M - 2) * (N - 2), 0) << endl;
}


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

#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vb = vector<bool>;
using vc = vector<char>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using pii = pair<int, int>;
#define fix10 cout << fixed << setprecision(10);
#define rep(i,n) for(int i=0; i<(int)(n);i++)
#define MOD 1000000007

int main(){
  long n,m;
  cin >> n >> m;
  long a = n*m;
  if(n == 1) a -=2;
  if(m == 1) a -=2;
  cout << max(0,a) << endl;
}


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

#include<iostream>
using namespace std;
int main(){
	long long a,b;
	cin>>a>>b;
	cout<<abs((a-2)*(b-2)<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:30: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
    6 |         cout<<abs((a-2)*(b-2)<<endl;
      |                   ~~~~~~~~~~~^~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <math.h>
#include <queue>
#include <vector>
#include <set>


using namespace std;
struct UnionFind {
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
        for(int i = 0; i < N; i++) par[i] = i;
    }

    int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) { // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    }

    bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};

template<class T> inline bool chmin(T& a, T b) {
  //aの方が大きければ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;
}
bool compare_a_big(pair<int,int> l,pair<int,int> r){
  //firstが大きい方からソート、firstが同じならbが小さい方から
  if(l.first != r.first){
    return l.first>r.first;
  }
  else{
    return l.second < r.second;
  }
}
bool compare_a_b_big(pair<int,int> l,pair<int,int> r){
  //firstが大きい方からソート、firstが同じならbが大きい方から
  if(l.first != r.first){
    return l.first>r.first;
  }
  else{
    return l.second > r.second;
  }
}
bool compare_b_small(pair<int,int> l,pair<int,int> r){
  //secondが小さい方からソート、firstが同じならfirstが小さい方から
  if(l.second != r.second){
    return l.second<r.second;
  }
  else{
    return l.first < r.first;
  }
}
const int INF = 1e9;




int main(){
  long long int n,m;
  cin >> n >> m;
  long long int ans;
  if(n>2 && m > 2){
    ans = (n-2)*(m-2);
  }
  else if(n==2 || m == 2){
    ans = 0;
  }
  else{
    if(n*m >= 3){
      ans = n*m-2;
    }
    else if(n*m=2){
      ans = 0;
    }
    else{
      ans = 1;
    }
  }

  cout << ans << endl;


}


Compiler output:
a.cc: In function 'int main()':
a.cc:99:14: error: lvalue required as left operand of assignment
   99 |     else if(n*m=2){
      |             ~^~
Language: C++

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


Compiler output:
a.cc:18:1: error: expected unqualified-id before numeric constant
   18 | 1 1 1 1
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define MAX 5000001
int dx[] = {1,0,-1,0};
int dy[] = {0,-1,0,1};
const ll INF = 10010010010001;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:20:26: error: expected ';' before '}' token
   20 |         ans = (N-2)*(M-2)
      |                          ^
      |                          ;
   21 |     }
      |     ~
Language: C++

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

int main() {
	
	int n, m;
	cin >> n >> m;
	int ans;
	if(n == 1){
		ans = abs(m - 2);
	}else if(m == 1){
		ans = n - 2;
	}else{
		ans = (n - 2) * (m - 2)
	}
	cout << ans << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:40: error: expected ';' before '}' token
   17 |                 ans = (n - 2) * (m - 2)
      |                                        ^
      |                                        ;
   18 |         }
      |         ~
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define double long double
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define mod (ll)(1e9+7)
#define inf (ll)(3e18+7)
#define P pair<int,int>
#define PiP pair<int,pair<int,int>>
#define all(x) x.begin(),x.end()
using namespace std;

int main() {
    ll n, m, ans=0;
    cin >> n >> m;
    cout << ll(abs(n-2)*abs(m-2));
}


Compiler output:
a.cc: In function 'int main()':
a.cc:2:12: error: expected primary-expression before 'long'
    2 | #define ll long long
      |            ^~~~
a.cc:16:13: note: in expansion of macro 'll'
   16 |     cout << ll(abs(n-2)*abs(m-2));
      |             ^~