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

#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <set>
#include <queue>
#include <map>
#include <numeric>
#include <functional>
#include <math.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;

#define INF ((int)1e9)
#define INFLL ((ll)1e18)
#define MOD (1000000007LL)


int main(int argc, const char * argv[]) {
    ios_base::sync_with_stdio(false);
    int N, K;
    cin >> N >> K;
    vector<ll> H(N+1, 0);
    for (int n = 1; n <= N; ++n) cin >> H[n];
    
    vector<vector<ll>> DP(N+1, vector<ll>(N+1, INFLL));
    DP[0][0] = 0LL;
    for (int n = 1; n <= N; ++n) {
        for (int s = 1; s <= n; ++s) {
            ll Min = LLONG_MAX;
            for (int m = 0; m < n; ++m) {
                ll Tmp = DP[m][s-1] + max(H[n]-H[m], 0LL);
                if (Tmp < Min) Min = Tmp;
            }
            DP[n][s] = Min;
        }
    }
    ll Res = LLONG_MAX;
    for (int n = 1; n <= N; ++n) {
        ll Tmp = DP[n][N-K];
        if (Tmp < Res) Res = Tmp;
    }
    cout << Res << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:36:22: error: 'LLONG_MAX' was not declared in this scope
   36 |             ll Min = LLONG_MAX;
      |                      ^~~~~~~~~
a.cc:13:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   12 | #include <math.h>
  +++ |+#include <climits>
   13 | 
a.cc:44:14: error: 'LLONG_MAX' was not declared in this scope
   44 |     ll Res = LLONG_MAX;
      |              ^~~~~~~~~
a.cc:44:14: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include <bits/stdc++.h>

using namespace std;
using int64 = long long;

constexpr int DEBUG = 0;

template<typename T>
vector<vector<T>> Make2DVector(int d1, int d2, T default_value) {
  return vector<vector<T>>(d1, vector<T>(d2, default_value));
}

template<class T> inline bool UpdateMin(T& a, T b) {
  if (a > b) { a = b; return 1; } return 0;
}

template<class T> inline bool UpdateMax(T& a, T b) {
  if (a < b) { a = b; return 1; } return 0;
}

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

  int n, m;
  cin >> n >> m;
  vector<int64> hs(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> hs[i];
  }

  auto dp = Make2DVector(n + 1, n + 1, INT64_MAX);
  dp[0][0] = 0;
  for (int i = 1; i <= n; i++) {
    for (int l = 0; l < i; l++) {
      for (int k = 0; k < i; k++) {
        if (dp[l][k] < INT64_MAX) {
          UpdateMin(dp[i][k + 1], dp[l][k] + max(hs[i] - hs[l], 0LL));
        }
      }
    }
  }

  int64 ans = INT64_MAX;
  for (int l = 0; l <= n; l++) {
    UpdateMin(ans, dp[l][n - m]);
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:20: error: no matching function for call to 'UpdateMin(__gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type&, long long int)'
   38 |           UpdateMin(dp[i][k + 1], dp[l][k] + max(hs[i] - hs[l], 0LL));
      |           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:13:31: note: candidate: 'template<class T> bool UpdateMin(T&, T)'
   13 | template<class T> inline bool UpdateMin(T& a, T b) {
      |                               ^~~~~~~~~
a.cc:13:31: note:   template argument deduction/substitution failed:
a.cc:38:20: note:   deduced conflicting types for parameter 'T' ('long int' and 'long long int')
   38 |           UpdateMin(dp[i][k + 1], dp[l][k] + max(hs[i] - hs[l], 0LL));
      |           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:46:14: error: no matching function for call to 'UpdateMin(int64&, __gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type&)'
   46 |     UpdateMin(ans, dp[l][n - m]);
      |     ~~~~~~~~~^~~~~~~~~~~~~~~~~~~
a.cc:13:31: note: candidate: 'template<class T> bool UpdateMin(T&, T)'
   13 | template<class T> inline bool UpdateMin(T& a, T b) {
      |                               ^~~~~~~~~
a.cc:13:31: note:   template argument deduction/substitution failed:
a.cc:46:14: note:   deduced conflicting types for parameter 'T' ('long long int' and 'long int')
   46 |     UpdateMin(ans, dp[l][n - m]);
      |     ~~~~~~~~~^~~~~~~~~~~~~~~~~~~
Language: C++

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

int main(void)
{
    int N, K;
    cin >> N >> K;
    vector<ll> H(N);
    vector<vector<ll>> dp(N, vector<ll>(K+1));
    for(int i=0;i<N;i++){
        cin >> H.at(i);
    }
    dp.at(0).at(0) = H.at(0);
    ll yoko, naname;
    if(k==N){
        cout << 0;
        return 0;
    }
    for(int i=1;i<N;i++){
        for(int j=0;j<=K;j++){
            if(j>i){
                break;
            }
            yoko = max(H.at(i), max(H.at(i) - H.at(i-1) + dp.at(i-1).at(j),dp.at(i-1).at(j) ));
            if(j==0){
                dp.at(i).at(j) = yoko;
            }else{
                naname = dp.at(i-1).at(j-1);
                dp.at(i).at(j) = min(yoko, naname);
            }
        }
    }
    ll min_v = dp.at(N-1).at(0);
    for(int i=0;i<=K;i++){
        min_v = min(min_v, dp.at(N-1).at(i));
    }
    
    // for(int i=0;i<=K;i++){
    //     for(int j=0;j<N;j++){
    //         cout << dp.at(j).at(i) << ", ";
    //     }
    //     cout << endl;
    // }
    
    cout << min_v;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:8: error: 'k' was not declared in this scope
   16 |     if(k==N){
      |        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)


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

  int n,k;
  cin >> n >> k;
  ll h[n];
  rep(i,n) cin >> h[i];
  ll dp[k+1][n+1],ndp[k+1][n+1];
  rep(i,k+1)rep(j,n+1) dp[i][j]=ndp[i][j]=INT_MAX;
  rep(i,n){
    rep(j,k+1){
      rep(l,n+1){
	if(i==0){
	  if(j==k-1){
	    if(l!=n) ndp[j][l]=h[l];
	    else ndp[j][l]=0;
	  }
	  else if(j==k && l==0) ndp[j][l]=h[0];
	}
	else{
	  if(l==n){
	    if(j+1<k+1){
	      ndp[j][n]=dp[j+1][n];
	    }
	    else ndp[j][n]=INT_MAX;
	  }
	  else if(l==i){
	    ndp[j][l]=min(min(dp[j][l],dp[j][n]+h[i]),);	    	    
	  }
	  else{
	    if(j+1<k+1){
	      ndp[j][l]=min(dp[j+1][n]+h[i],dp[j+1][l]+abs(h[l]-h[i]));
	    }
	    else ndp[j][n]=INT_MAX;
	  }
	}
      }
    }
    rep(i,k+1)rep(j,n+1) dp[i][j]=ndp[i][j];
  }
  ll ans = INT_MAX;
  rep(i,n+1)rep(j,k+1) ans=min(dp[i][j],ans);
  cout << ans << endl;
  return 0;
    

}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:55: error: expected primary-expression before ')' token
   38 |             ndp[j][l]=min(min(dp[j][l],dp[j][n]+h[i]),);
      |                                                       ^
Language: C++

// In the name of God

#include <bits/stdc++.h>

using namespace std;

#define int long long

const int N = 305;

int n, k, dp[N][N][N], a[N];

signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cin >> n >> k;
	for(int i=0;i<n;i++) cin >> a[i];
	for(int i=0;i<N;i++) for(int j=0;j<N;j++) for(int t=0;t<N;t++) dp[i][j][t] = 1e15;
	dp[0][0][0] = a[0];
	for(int i=1;i<n;i++) {
		dp[i][0][i] = dp[i-1][0][i-1];
		if(a[i-1] < a[i]) dp[i][0][i] += a[i]-a[i-1];
	}
	for(int j=1;j<=k;j++) {
		for(int t=0;t<n;t++) {
			dp[0][j][t] = a[t];
		}
	}
	for(int i=1;i<n;i++) {
		for(int j=1;j<=k;j++) {
			for(int t=0;t<n;t++) 	
			for(int h=max(0LL, i-25);h<min(n, i+25);h++) {
				int go = dp[i-1][j][h];
				if(a[h] < a[i]) go += a[i]-a[h];
				dp[i][j][i] = min(dp[i][j][i], go);
			}
			for(int h=max(0LL, i-25);h<min(n, i+25);h++) {
				int go = dp[i-1][j-1][h];
				if(a[h] < a[t]) go += a[t]-a[h];
				dp[i][j][t] = min(dp[i][j][t], go);	
			}
			}
		}
	}
	int ret = 1e15;
	for(int i=0;i<=k;i++) for(int j=0;j<n;j++) ret=min(ret, dp[n-1][i][j]);
	cout << ret;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:45: error: 't' was not declared in this scope
   39 |                                 if(a[h] < a[t]) go += a[t]-a[h];
      |                                             ^
a.cc:40:42: error: 't' was not declared in this scope
   40 |                                 dp[i][j][t] = min(dp[i][j][t], go);
      |                                          ^
a.cc: At global scope:
a.cc:46:9: error: expected unqualified-id before 'for'
   46 |         for(int i=0;i<=k;i++) for(int j=0;j<n;j++) ret=min(ret, dp[n-1][i][j]);
      |         ^~~
a.cc:46:21: error: 'i' does not name a type
   46 |         for(int i=0;i<=k;i++) for(int j=0;j<n;j++) ret=min(ret, dp[n-1][i][j]);
      |                     ^
a.cc:46:26: error: 'i' does not name a type
   46 |         for(int i=0;i<=k;i++) for(int j=0;j<n;j++) ret=min(ret, dp[n-1][i][j]);
      |                          ^
a.cc:46:43: error: 'j' does not name a type
   46 |         for(int i=0;i<=k;i++) for(int j=0;j<n;j++) ret=min(ret, dp[n-1][i][j]);
      |                                           ^
a.cc:46:47: error: 'j' does not name a type
   46 |         for(int i=0;i<=k;i++) for(int j=0;j<n;j++) ret=min(ret, dp[n-1][i][j]);
      |                                               ^
a.cc:47:9: error: 'cout' does not name a type
   47 |         cout << ret;
      |         ^~~~
a.cc:48:9: error: expected unqualified-id before 'return'
   48 |         return 0;
      |         ^~~~~~
a.cc:49:1: error: expected declaration before '}' token
   49 | }
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <limits>

using lint = long long;

constexpr lint INF = std::numeric_limits<lint>::max() / 3;

lint cost(lint a, lint b) {
    return std::max(0LL, b - a);
}

int main() {
    int n, k;
    std::cin >> n >> k;

    std::vector<lint> hs(n);
    for (auto& h : hs) std::cin >> h;
    hs.insert(hs.begin(), 0);

    std::vector<std::vector<lint>>
        dp(n + 1, std::vector<lint>(k + 1, INF));
    dp[0][0] = 0;

    for (int i = 1; i <= n; ++i) {
        for (int j = 0; j < i; ++j) {
            int p = i - j - 1;
            for (int l = 0; l + p <= k; ++l) {
                dp[i][l + p] = std::min(dp[i][l + p],
                                        dp[j][l] + cost(hs[j], hs[i]));
            }
        }
    }

    std::cout << *min_element(dp[n].begin(), dp[n].end()) << std::endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:19: error: 'min_element' was not declared in this scope
   35 |     std::cout << *min_element(dp[n].begin(), dp[n].end()) << std::endl;
      |                   ^~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
const int M = 1e7;
int si[] = {-1, 0, 1, 0};
int sj[] = {0, -1, 0, 1};

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

  if (n%2 == 0) cout << n / 2 - 1 << endl;
  else cout << (n+1) / 2 - 1<< endl;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:16:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ll n;
  if(n%2!=0)
  {
  (cout<<(n/2)*2+2<<endl;
  }
   else{
   cout<<((n-1)/2)*2+2<<endl;
   }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:25: error: expected ')' before ';' token
    9 |   (cout<<(n/2)*2+2<<endl;
      |   ~                     ^
      |                         )
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: lvalue required as left operand of assignment
    7 |   if(N%2 = 0){
      |      ~^~
Language: C++

#include<iostream>
#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
#include <iomanip>//setprecision
#include<math.h>
#include <functional>
#include<climits>
using namespace std;
#define ll  long long 
#define rep(i, n)        for(ll i=0; i<(ll)(n); ++i)
#define mod 1000000007
  vector<ll>to[1000005];
int main(){
    ll a,b,c;cin>>a;
  b=a/2;
  if(a%2!==0)b--;
  cout<<b;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:11: error: expected primary-expression before '=' token
   30 |   if(a%2!==0)b--;
      |           ^
Language: C++

num = int(input())

# if num % 2 == 0:
#     half = num / 2
# else:
#     half = int(num  + 1) / 2

half = int(num / 2)

count = 0

for i in range(1, half + 1):
    a = i
    b = num - i
#     print(a,b)
    if a != b:
        count += 1
    
print(count)

Compiler output:
a.cc:3:18: error:  ':' without preceding '?'
    3 | # if num % 2 == 0:
      |                  ^
a.cc:5:7: warning: extra tokens at end of #else directive [-Wendif-labels]
    5 | # else:
      |       ^
a.cc:6:7: error: invalid preprocessing directive #half
    6 | #     half = int(num  + 1) / 2
      |       ^~~~
a.cc:15:7: error: invalid preprocessing directive #print
   15 | #     print(a,b)
      |       ^~~~~
a.cc:3: error: unterminated #else
    3 | # if num % 2 == 0:
a.cc:1:1: error: 'num' does not name a type; did you mean 'enum'?
    1 | num = int(input())
      | ^~~
      | enum
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  ll n;
  cin>>n;
  cout<<(n-1)/2<<endl;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'll' was not declared in this scope
    4 |   ll n;
      |   ^~
a.cc:5:8: error: 'n' was not declared in this scope; did you mean 'yn'?
    5 |   cin>>n;
      |        ^
      |        yn
Language: C++

//
//  main.cpp
//  Study
//
//  Created by 佐々木勇星 on 2020/03/12.
//  Copyright © 2020 佐々木勇星. All rights reserved.
//

#include <iostream>
#include <vector>
#include <cmath>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <map>

using namespace std;


int main(int argc, const char * argv[]) {

    int n;
    cin >> n;
    
    cout << ((n + 2 - 1) / 2) - 1 << endl;
    
    return 0;
}
//
//  main.cpp
//  Study
//
//  Created by 佐々木勇星 on 2020/03/12.
//  Copyright © 2020 佐々木勇星. All rights reserved.
//

#include <iostream>
#include <vector>
#include <cmath>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <map>

using namespace std;


int main(int argc, const char * argv[]) {

    int n;
    cin >> n;
    
    cout << ((n + 2 - 1) / 2) - 1 << endl;
    
    return 0;
}


Compiler output:
a.cc:48:5: error: redefinition of 'int main(int, const char**)'
   48 | int main(int argc, const char * argv[]) {
      |     ^~~~
a.cc:20:5: note: 'int main(int, const char**)' previously defined here
   20 | int main(int argc, const char * argv[]) {
      |     ^~~~
Language: C

#include <stdio.h>
int main (void)
{
int N;

scanf("%d",&N);

prinf("%d",(N +1)/2-1);

return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:1: error: implicit declaration of function 'prinf'; did you mean 'printf'? [-Wimplicit-function-declaration]
    8 | prinf("%d",(N +1)/2-1);
      | ^~~~~
      | printf
Language: C

#include<stdio.h>

int main (void)

{
int N,i;
int count = 0;
 
scanf("%d",&N);
 
for(i=1;i<N/2;i++)
{
if(i!=N - i)
count ++;
}
 
prnitf("%d",count);
 
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:1: error: implicit declaration of function 'prnitf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   17 | prnitf("%d",count);
      | ^~~~~~
      | printf
Language: C

int count = 0;
 
scanf("%d",&N);
 
for(i=1;i<N/2;i++)
{
if(i!=N - i)
count ++;
}
 
prnitf("%d",count);
 
return 0;
}

Compiler output:
main.c:3:7: error: expected declaration specifiers or '...' before string constant
    3 | scanf("%d",&N);
      |       ^~~~
main.c:3:12: error: expected declaration specifiers or '...' before '&' token
    3 | scanf("%d",&N);
      |            ^
main.c:5:1: error: expected identifier or '(' before 'for'
    5 | for(i=1;i<N/2;i++)
      | ^~~
main.c:5:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    5 | for(i=1;i<N/2;i++)
      |          ^
main.c:5:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    5 | for(i=1;i<N/2;i++)
      |                ^~
main.c:11:8: error: expected declaration specifiers or '...' before string constant
   11 | prnitf("%d",count);
      |        ^~~~
main.c:11:13: error: expected declaration specifiers or '...' before 'count'
   11 | prnitf("%d",count);
      |             ^~~~~
main.c:13:1: error: expected identifier or '(' before 'return'
   13 | return 0;
      | ^~~~~~
main.c:14:1: error: expected identifier or '(' before '}' token
   14 | }
      | ^
Language: C++

#include<stdio.h>

int main (void)
{
int N,i;
int count = 0;

scanf("%d",&N);

for(i=1;i<N/2;i++)
{
if(i!=N - i)
count ++;
}

prnitf("%d",count);

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:1: error: 'prnitf' was not declared in this scope; did you mean 'printf'?
   16 | prnitf("%d",count);
      | ^~~~~~
      | printf
Language: C++

#include<iostream>
using namespace std;
int sum(int a);
int main()
{
    int n;
    cin>>n;
    cout<<sum(n)<<endl;
}
int sum(int a)
{
    return (n-1)/2;
}

Compiler output:
a.cc: In function 'int sum(int)':
a.cc:12:13: error: 'n' was not declared in this scope
   12 |     return (n-1)/2;
      |             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin>>n;
	for(int i=1;i<n/2;i++)
	{
		cnt++;
	} 
	return 0;
}


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

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

int main(){
  cin>>N;
  if(N<3){
    cout<<0<<endl;
    return 0;
  }
  
  cout<<(N-1)/2<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:8: error: 'N' was not declared in this scope
    5 |   cin>>N;
      |        ^
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner stdIn = new Scanner(System.in);
    int n = stdIn.nextInt();
    int cnt = 0;
    for(int i = 1; i<n/2; i++){
     cnt++;
     }
      
    }
    System.out.println(cnt);
    
  }
}


Compiler output:
Main.java:12: error: <identifier> expected
    System.out.println(cnt);
                      ^
Main.java:12: error: <identifier> expected
    System.out.println(cnt);
                          ^
Main.java:15: error: class, interface, enum, or record expected
}
^
3 errors
Language: C

#include<stdio.h>
int main(void)
{
  int judge;
  scanf("%d",&judge);
  if(judge % 2 == 0){
    printf("%d",(judge/2)-1));
  }
  else{
    printf("%d",judge/2);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:29: error: expected ';' before ')' token
    7 |     printf("%d",(judge/2)-1));
      |                             ^
      |                             ;
main.c:7:29: error: expected statement before ')' token
Language: C

#include<stdio.h>
int main(void)
{
  int judge;
  if(judge % 2 == 0){
    printf("%d",(judge/2)-1));
  }
  else{
    printf("%d",judge/2);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:29: error: expected ';' before ')' token
    6 |     printf("%d",(judge/2)-1));
      |                             ^
      |                             ;
main.c:6:29: error: expected statement before ')' token
Language: C++

#include <bits/stdc++.h

using namespace std;

int main()
{
    int n;
    cin >> n;
    cout << ((n - 1) >> 1);
    return 0;
}


Compiler output:
a.cc:1:24: error: missing terminating > character
    1 | #include <bits/stdc++.h
      |                        ^
Language: Java

import java.io.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    System.out.print((n-1)/2);
  }
}

Compiler output:
Main.java:1: error: cannot find symbol
import java.io.Scanner;
              ^
  symbol:   class Scanner
  location: package java.io
Main.java:5: error: cannot find symbol
    Scanner sc = new Scanner(System.in);
    ^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
    Scanner sc = new Scanner(System.in);
                     ^
  symbol:   class Scanner
  location: class Main
3 errors
Language: Java

Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
System.out.print((n-1)/2);


Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
Scanner sc = new Scanner(System.in);
^
  (use --enable-preview to enable unnamed classes)
Main.java:3: error: class, interface, enum, or record expected
System.out.print((n-1)/2);
^
2 errors
Language: C++

#include <bit/stdc++.h>

using namespace std;

int main() {
  int n;
  cin >> n;
  cout << (n - 1) / 2 << '\n';
  return 0;
}


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

package training;
import java.util.Scanner;

public class Training01 {
	@SuppressWarnings("resource")
	public static void main(String[]orgs){
	Scanner sc = new Scanner(System.in);
	int n = sc.nextInt();
	if(n>2){
		int a = 1;
		int b = n-1;
		int count = 0;
		while(a<b){
			System.out.println(a+","+b);
			a++;
			b= n-a;
			count++;
		}
		System.out.println(count);
	}
	}
}


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

import java.util.Scanner;

public static void main(String[]orgs){
	Scanner sc = new Scanner(System.in);
	int n = sc.nextInt();

		int a = 1;
		int b = 2;
		int count = 0;
		while(a<b){
			//System.out.println(a+","+b);
			a++;
			b= n-a;
			count++;
		}
		System.out.println(count);
	}

Compiler output:
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[]orgs){
              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: Java

package training;
import java.util.Scanner;

public class Training01 {
	public static void main(String[]orgs){
	Scanner sc = new Scanner(System.in);
	int n = sc.nextInt();

		int a = 1;
		int b = 1;
		int count = 0;
		while(a<=b){
			//System.out.println(a+","+b);
			a++;
			b= n-a;
			count++;
		}
		System.out.println(count);
	}
}


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

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

int main() {
  int n;
  cin >> n;
  cout << (n-1)/2;
  reuturn 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'reuturn' was not declared in this scope
    8 |   reuturn 0;
      |   ^~~~~~~
Language: C++

#include <iostream>
#include<string>#include <math.h>
using namespace std;

int main(void) {
	ios::sync_with_stdio(false);
	
	int n, ans;

	cin >> n;

	cout << ((n%2==0) ? (n/2)-1:floor(n/2)) << endl;
	return 0;
}

Compiler output:
a.cc:2:17: warning: extra tokens at end of #include directive
    2 | #include<string>#include <math.h>
      |                 ^
a.cc: In function 'int main()':
a.cc:12:37: error: 'floor' was not declared in this scope
   12 |         cout << ((n%2==0) ? (n/2)-1:floor(n/2)) << endl;
      |                                     ^~~~~
Language: C++

#include <iostream>

using namespace std;

int main(){
  int N;
  cin >> N;
  if(N%2==0){
    cout << (N/2)-1 << endl;
  }else{
    cout << (N/2) << endl;
  return 0;
}

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

#include<iostream>

using namespace std;

int main()
{

long long int n
  cin>>n;
  
  if(n%2==0){
    cout<<n/2-1<<endl;
    
  }
  else{
  cout<<n/2<<endl;
  }

  
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected initializer before 'cin'
    9 |   cin>>n;
      |   ^~~
a.cc:11:6: error: 'n' was not declared in this scope
   11 |   if(n%2==0){
      |      ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  int N;
  cin>>N;
  if(N==1||N==2||N==0){ 
    cout<<0<<endl;
  }
  if(N==3){
    cout <<1<<endl;
  }
  if(N%2==1){
    cout<<N/2+1<<endl;
  }
  if(N%2==0){
  cout<<N/2-1<<endl;
  }
    return 0;
}
#include<iostream>
using namespace std;
int main(){
  int N;
  cin>>N;
  if(N==1||N==2||N==0){ 
    cout<<0<<endl;
  }
  if(N==3){
    cout <<1<<endl;
  }
  if(N%2==1){
    cout<<N/2+1<<endl;
  }
  if(N%2==0){
  cout<<N/2<<endl;
  }
  else{
    cout<<0<<endl;
  }
    return 0;
}


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

#include<iostream>
using namespace std;
int main(){
  int N;
  cin>>N;
  if(N==1||N==2||N==0){ 
    cout<<0<<endl;
  }
  if(N==3){
    cout <<1<<endl;
  if(N%%2==1){
    cout<<N/2+1<<endl;
  }
  if(N%%2==0){
  cout<<N/2-1<<endl;
  }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: expected primary-expression before '%' token
   11 |   if(N%%2==1){
      |        ^
a.cc:14:8: error: expected primary-expression before '%' token
   14 |   if(N%%2==0){
      |        ^
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C

private class WeightedRandomSelection{

    private int size;
    private float[] weights;
    private Function<int, float> f;
    private int[] turn;

    public WeightedRandomSelection(int size, Function<int, float> weight_func){
    this.size = size;
    weights = new float[size];
    turn = new int[size];
    for (int i = 0; i < size; i++){
        weights[i] = 1.0;
        turn = -1;    
    }

    f = weight_func;
    }

    public int select(){
        float sum = 0;
        float p = new float[size];
        for (int i = 0; i < size; i++){
            sum += weights[i];
            p[i] = sum;
        }
        for (int i = 0; i < size; i++)
            p[i] /= sum[i];

        float thresh = Math.random();
        for (int i = 0; i < size; i++){
            if (thresh <= P[i])
                return i;
        }
    }

    public void update(int n){
       for (int i = 0; i < size; i++)
            turn[i]++;
       turn[n] = -1; 
       for (int i = 0; i < size; i++)
        weights[i] = f(turn[i]);
    }
}

public class MusicPlayer {

    // フィールド
    private Song[] song;
    private int current;
    private WeightedRandomSelection selection;
	
    // コンストラクタ
    public MusicPlayer() {
	song = new Song[10];
	song[0] = new Song("Song A");
	song[1] = new Song("Song B");
	song[2] = new Song("Song C");
	song[3] = new Song("Song D");
	song[4] = new Song("Song E");
	song[5] = new Song("Song F");
	song[6] = new Song("Song G");
	song[7] = new Song("Song H");
	song[8] = new Song("Song I");
	song[9] = new Song("Song J");
	current=0;
    Function<int, float> f = t -> t < 0 ? 1 : Math.exp(-(10 - t) / 10.0);
    selection = new WeightedRandomSelectioN(10, f);
    }

    private void play() {
	System.out.println(song[current].getName() + "を再生中♪");
    }

    // publicメソッド：早送り
    public void ff() {
	current %= song.length;
	play(); // privateメソッドの呼び出し
	current++;
    }
    
    // publicメソッド: シャッフル再生
    public void shuffle() {
	// ff()を参考にして，ココを実装すること
        current = selection.select();
        play();
        selection.update(current);
    }
}

Compiler output:
main.c:1:1: error: unknown type name 'private'
    1 | private class WeightedRandomSelection{
      | ^~~~~~~
main.c:1:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'WeightedRandomSelection'
    1 | private class WeightedRandomSelection{
      |               ^~~~~~~~~~~~~~~~~~~~~~~
main.c:46:1: error: unknown type name 'public'
   46 | public class MusicPlayer {
      | ^~~~~~
main.c:46:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'MusicPlayer'
   46 | public class MusicPlayer {
      |              ^~~~~~~~~~~
Language: C

#include<stdio.h>
 
int main(void){
    int A,B,k;
    if(A>9||B>9){
        k=-1;
    }
    else if(A<=9&&B<==9){
        k=A*B;
    }
    printf("%d",k);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:22: error: expected expression before '=' token
    8 |     else if(A<=9&&B<==9){
      |                      ^
Language: C

#include<stdio.h>

int main(void){
  scanf("%d",&N);
  printf("%d",(N-1)/2);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:15: error: 'N' undeclared (first use in this function)
    4 |   scanf("%d",&N);
      |               ^
main.c:4:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
using namecspace std;

int main(){
  int n;
  cin >> n;
  cout << (n - 1) / 2;
  return 0;
}


Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namecspace'
    2 | using namecspace std;
      |       ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> n;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |   cout << (n - 1) / 2;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <iostream>;
using namecpace std;

int main(){
  int n;
  cin >> n;
  cout << (n - 1) / 2;
  return 0;
}


Compiler output:
a.cc:1:20: warning: extra tokens at end of #include directive
    1 | #include <iostream>;
      |                    ^
a.cc:2:7: error: expected nested-name-specifier before 'namecpace'
    2 | using namecpace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> n;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |   cout << (n - 1) / 2;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
double dp1[605];
double dp2[605];
double dp3[605];
double dp4[605];
vector<int> G1[605];
vector<int> G2[605];
int main() {
	int n, m;
	cin >> n >> m;
	for(int i = 0; i < m; i++) {
		int s, t;
		cin >> s >> t;
		G1[s].push_back(t);
		G2[t].push_back(s);
	}
	for(int i = 1; i < n; i++) {
		int size = G1[i].size();
		for(int nxt : G1[i]) {
			dp1[nxt] += (dp1[i] + 1.0) / size;
		}
	}
	dp2[1] = 1.0;
	for(int i = 1; i < n; i++) {
		int size = G1[i].size();
		for(int nxt : G1[i]) {
			dp2[nxt] += dp1[i] / size;
		}
	}
	for(int i = n; i > 1; i--) {
		int size = G2[i].size();
		for(int nxt : G2[i]) {
			dp3[nxt] += (dp3[i] + 1.0) / size;
		}
	}
	dp4[n] = 1.0;
	for(int i = n; i > 1; i--) {
		int size = G2[i].size();
		for(int nxt : G2[i]) {
			dp4[nxt] += dp4[i] / size;
		}
	}
	double ma = 0;
	for(int i = 1; i < n; i++) {
		int size = G1[i].size();
		if(size == 1) continue;
		for(int nxt : G1[i]) {
			if(G2[nxt].size() == 1) continue;
			if((dp1[i] + 1.0) / size * dp2[nxt] > ma) cout << i << " " << nxt << endl;
			ma = max(, ma);
		}
	}
	double ans = dp1[n] - ma;
	printf("%.10f\n", ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:34: error: expected primary-expression before ',' token
   51 |                         ma = max(, ma);
      |                                  ^
Language: Java

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

Compiler output:
Main.java:3: error: cannot find symbol
        Scanner in = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        Scanner in = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

public class Solution {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        System.out.println((N - 1) >> 1);
    }
}

Compiler output:
Main.java:1: error: class Solution is public, should be declared in a file named Solution.java
public class Solution {
       ^
Main.java:3: error: cannot find symbol
        Scanner in = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Solution
Main.java:3: error: cannot find symbol
        Scanner in = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Solution
3 errors
Language: C++

#include<stdio.h>
int main()
{
  int a,b,c,d,i;
  scanf("%d",&a);
  if(a==1 || a==2)printf("0\n"):
  else if(a%2==1)printf("%d\n",a/2);
  else printf("%d\n",a/2-1);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:32: error: expected ';' before ':' token
    6 |   if(a==1 || a==2)printf("0\n"):
      |                                ^
      |                                ;
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
  int n;
  cin >> n;
  cin.ignore();
  
  int ans = n / 2 - 1 + (n % 2);
  cout << ans << emdl;
  return 0;
}
  

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

include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  n++;
  int ans = n/2 - 1;
  cout << ans << endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> n;
      |   ^~~
a.cc:8:3: error: 'cout' was not declared in this scope
    8 |   cout << ans << endl;
      |   ^~~~
a.cc:8:18: error: 'endl' was not declared in this scope
    8 |   cout << ans << endl;
      |                  ^~~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  
  for(int i=0;i<N;i++){
    cin>>A.at(i);
  }
  
  if(N==1){
    if(A.at(0)==0){
      cout<<1<<endl;
    }
    else{
      cout<<0<<endl;
    }
  }
  
  sort(A.begin(),A.end());
  int tmp=0;
  for(int i=0;i<N;i++){
    if(tmp!=A.at(i) && (tmp++)==A.at(i)){
      tmp==A.at(i);
    }
    else if((vec.at(i)-tmp)>=2){
      cout<<0<<endl;
      return 0;
    }
  }
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:28:14: error: 'vec' was not declared in this scope
   28 |     else if((vec.at(i)-tmp)>=2){
      |              ^~~
Language: C++

#include <stdio.h>
#include <algorithm>
#include <string>
#include <vector>
#include <numeric>
#include<queue>

//const int mod = 1000000007;
//const int mod = 998244353;


int main() {
	int N;
	scanf("%d",&N);
	prntf("%d", (N + 1) / 2);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'prntf' was not declared in this scope; did you mean 'printf'?
   15 |         prntf("%d", (N + 1) / 2);
      |         ^~~~~
      |         printf
Language: Java

import java.util.Scanner;

public class Maine {
	public static void main (String args[]) {
		
		Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        
        int i = Integer.parseInt(str);
        
        if (1 <= i && i <= 1000000) {
        	if (i % 2 == 0) {
        		i = i / 2 - 1;
        	} else {
        		i = (i - 1) / 2;
        	}
        	System.out.println(i);
        }
        return;
	}
}


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

#include<cstdio>
using namespace std;
int main() {
  int n;cin>>n;cout<<(n-1)/2;
  return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i)=0; (i)<(n); (i)++)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define ll long long
#define pii pair<int,int> 
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
const int INF = 1001001001;
//int 2×10の9乗
//vector<vector<int>> a(n, vector<int>(m));
//rep(i,n) rep(j,m) cin >> a[i][j]; 
//cout << fixed << setprecision(10);
//int gcd(int x, int y){
//if(y==0) return x;
//return gcd(y, x%y);
//}
//sort小さい順(昇順)
//g++ code.cpp   ./a.out 
int main(){
  int n;
  cin >> n;
  rrep(i,n-1){
    for(int j=i+1; j<=n; j++){
      if(n==i+j) ans++;
    }
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:18: error: 'ans' was not declared in this scope; did you mean 'abs'?
   25 |       if(n==i+j) ans++;
      |                  ^~~
      |                  abs
a.cc:28:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   28 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
  int n; cin >> n;
  cout << (n / 2 + (n % 2 ? 1 : -1) << "\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:37: error: invalid operands of types 'int' and 'const char [2]' to binary 'operator<<'
    7 |   cout << (n / 2 + (n % 2 ? 1 : -1) << "\n";
      |            ~~~~~~~~~~~~~~~~~~~~~~~~ ^~ ~~~~
      |                  |                     |
      |                  int                   const char [2]
a.cc:7:44: error: expected ')' before ';' token
    7 |   cout << (n / 2 + (n % 2 ? 1 : -1) << "\n";
      |           ~                                ^
      |                                            )
Language: C++

#include <stdio.h>

int main(void){
  int N;
  scanf("%d", &N);
  int NNN = N/2;
  if(N % 2 == 1){
    int NN = N/2 + 1;
  }else{
    int NN = N/2;
  }
  int A = 0;
  for(int i=1; i<=NN; i++){
	int n = N - i;
    if(n != NNN){
      A = A + 1;
    }
  }
  printf("%d", A);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: 'NN' was not declared in this scope; did you mean 'NNN'?
   13 |   for(int i=1; i<=NN; i++){
      |                   ^~
      |                   NNN
Language: C

int main(void){

	int N = 0;
  	N = scanf(&d);
  	if(N <= 1){
    	printf("0")
    } else {
    	printf("%d", (N-1)/2)
    }

	return 0;
  
}

Compiler output:
main.c: In function 'main':
main.c:4:13: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |         N = scanf(&d);
      |             ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(void){
main.c:4:13: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |         N = scanf(&d);
      |             ^~~~~
main.c:4:13: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:4:20: error: 'd' undeclared (first use in this function)
    4 |         N = scanf(&d);
      |                    ^
main.c:4:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    6 |         printf("0")
      |         ^~~~~~
main.c:6:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:6:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:6:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:6:20: error: expected ';' before '}' token
    6 |         printf("0")
      |                    ^
      |                    ;
    7 |     } else {
      |     ~               
main.c:8:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
    8 |         printf("%d", (N-1)/2)
      |         ^~~~~~
main.c:8:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:8:30: error: expected ';' before '}' token
    8 |         printf("%d", (N-1)/2)
      |                              ^
      |                              ;
    9 |     }
      |     ~
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class a {
    public static void main(String[] args){
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int m;
        int n = 0;
        try {
            String str = reader.readLine();
            n = Integer.parseInt(str);
        } catch (Exception e) {
            e.printStackTrace();
        }
        if(n % 2 == 0){
            m = n / 2 - 1;
        } else{
            m = n / 2;
        }
        if(n <= 2){
            m = 0;
        }
        if(n == 3){
            m = 1;
        }
        System.out.println("" + m);
    }   
}

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

#include<bits/stdc++.h>
using namespace styd;
int main()
{
int n;
  cin>>n;
  cout<<(n-1)/2<<endl;


}

Compiler output:
a.cc:2:17: error: 'styd' is not a namespace-name
    2 | using namespace styd;
      |                 ^~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin>>n;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |   cout<<(n-1)/2<<endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:7:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    7 |   cout<<(n-1)/2<<endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<queue>
#define ll long long
using namespace std;
inline ll read()
{
	ll r,s=0,c;
	for(;!isdigit(c=getchar());s=c);
	for(r=c^48;isdigit(c=getchar());(r*=10)+=c^48);
	return s^45?r:-r;
}
const int N=1000010,M=1000010<<4;
const ll inf=1e18;
int n,m;
struct edge
{
	int to,next;
	ll val;
}mem[M];
int head[N],cnt=1;
inline void add(int u,int v,ll val)
{
	mem[++cnt].next=head[u];
	mem[cnt].to=v;
	mem[cnt].val=val;
	head[u]=cnt;
}
struct tree
{
	int l,r,id;
}t1[N<<2],t2[N<<2];
int tot;
void build1(int rt,int l,int r)
{
	t1[rt].l=l,t1[rt].r=r;
	if(l==r)
	{
		t1[rt].id=l;
		return;
	}
	t1[rt].id=++tot;
	int mid=(l+r)>>1;
	build1(rt<<1,l,mid);
	build1(rt<<1|1,mid+1,r);	
	add(t1[rt<<1].id,t1[rt].id,0),add(t1[rt<<1|1].id,t1[rt].id,0);
}
void build2(int rt,int l,int r)
{
	t2[rt].l=l,t2[rt].r=r;
	if(l==r)
	{
		t2[rt].id=l+n;
		add(l+n,l,0);
		return;
	}
	add(t2[rt].id,t1[rt].id,0);
	t2[rt].id=++tot;
	int mid=(l+r)>>1;
	build2(rt<<1,l,mid);
	build2(rt<<1|1,mid+1,r);
	add(t2[rt].id,t2[rt<<1].id,0),add(t2[rt].id,t2[rt<<1|1].id,0);
}
struct node
{
	int num;
	ll val;
	friend bool operator < (node a,node b)
	{
		return a.val>b.val;
	}
}f,ff;
ll d[N];
bool vis[N];
inline void dijkstra()
{
	for(int i=1;i<=tot;++i)d[i]=inf;
	d[1]=0;
	f.num=1,f.val=0;
	priority_queue<node>q;
	while(!q.empty())q.pop();
	q.push(f);
	while(!q.empty())
	{
		f=q.top();
		q.pop();
		if(vis[f.num])continue;
		vis[f.num]=1;
		for(int i=head[f.num];i>0;i=mem[i].next)
		{
			int to=mem[i].to;
			if(d[to]>d[f.num]+mem[i].val)
			{
				d[to]=mem[i].val+d[f.num];
				ff.num=to,ff.val=d[to];
				q.push(ff);
			}
		}
	}
}
void query1(int rt,int l,int r,int pos,ll val)
{
	if(l<=t1[rt].l&&t1[rt].r<=r)
	{
		add(t1[rt].id,pos,val);
		return;
	}
	int mid=(t1[rt].l+t1[rt].r)>>1;
	if(l<=mid)
		query1(rt<<1,l,r,pos,val);
	if(r>mid)
		query1(rt<<1|1,l,r,pos,val);
}
void query2(int rt,int l,int r,int pos)
{
	if(l<=t2[rt].l&&t2[rt].r<=r)
	{
		add(pos,t2[rt].id,0);
		return;
	}
	int mid=(t2[rt].l+t2[rt].r)>>1;
	if(l<=mid)
		query2(rt<<1,l,r,pos);
	if(r>mid)
		query2(rt<<1|1,l,r,pos);
}
int main()
{
	n=read(),m=read();
	int l,r;
	ll val;
	tot=n<<1;
	build1(1,1,n),build2(1,1,n);
//	for(int i=1;i<=tot;++i){cout<<i;for(int j=head[i];j;j=mem[j].next)cout<<"->"<<mem[j].to;cout<<endl;}//	system("pause");
	while(m--)
	{
		l=read(),r=read(),val=read();
		query1(1,l,r,++tot,val);
		query2(1,l,r,tot);
	}
//	for(int i=1;i<=tot;++i){cout<<i;for(int j=head[i];j;j=mem[j].next)cout<<"->"<<mem[j].to;cout<<endl;}
	dijkstra();
//	for(int i=1;i<=tot;++i){if(d[i]==inf)d[i]=-1;cout<<d[i]<<' ';}cout<<endl<<endl;
if(d[n<<1]==inf]d[n<<1]=-1;	
  cout<<d[n<<1]<<'\n';
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:144:16: error: expected ')' before ']' token
  144 | if(d[n<<1]==inf]d[n<<1]=-1;
      |   ~            ^
      |                )
a.cc:144:16: error: expected primary-expression before ']' token
Language: Java

public main(String[] args){
  int n = Integer.parseInt(args[0]);
  System.out.print((n + n%2) / 2 - 1);
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
public main(String[] args){
       ^
Main.java:3: error: class, interface, enum, or record expected
  System.out.print((n + n%2) / 2 - 1);
  ^
Main.java:4: error: class, interface, enum, or record expected
}
^
3 errors