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

#incluse<iostream>
using namespace std;
int main(){
  int n,i;
  cin>>n;
  char s[n];
  for(i=0;i<n;i++){
    cin>>s[i];
  }
  cout<<s[0];
  for(i=0;i<n-1;i++){
    if(s[i+1]!=s[i])
      cout<<s[i+1];
  }
  cout<<"\n";
  return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #incluse; did you mean #include?
    1 | #incluse<iostream>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>n;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #incluse<iostream>
a.cc:10:3: error: 'cout' was not declared in this scope
   10 |   cout<<s[0];
      |   ^~~~
a.cc:10:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include<iostream>
using namespace std;
int main(){
  int n,i;
  cin>>n;
  char s[n];
  for(i=0;i<n;i++){
    cin>>s[i]
  }
  cout<<s[0];
  for(i=0;i<n-1;i++){
    if(s[i+1]!=s[i])
      cout<<s[i+1];
  }
  cout<<"\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: expected ';' before '}' token
    8 |     cin>>s[i]
      |              ^
      |              ;
    9 |   }
      |   ~
Language: Java

import java.util.*;
public class Slimes{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int number = sc.nextInt();
    String slimes = sc.next();

    int total = 1;
    String first = slimes.substring(0,1);
    for(int i = 1; i < slimes.length(); i++){
      if(!(first.equals(slimes.substring(i,i+1)))){
        first = slimes.substring(i,i+1);
        total++;
      }
    }
		System.out.println(total);
	}
}

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

int main(){
  int n;
  cin>>n,i;
  char s[n];
  for(i=0;i<n;i++){
    cin>>s[i]
  }
  cout<<s[0];
  for(i=0;i<n-1;i++){
    if(s[i+1]!=s[i])
      cout<<s[i+1];
  }
  cout<<"\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin>>n,i;
      |   ^~~
a.cc:3:10: error: 'i' was not declared in this scope
    3 |   cin>>n,i;
      |          ^
a.cc:8:3: error: 'cout' was not declared in this scope
    8 |   cout<<s[0];
      |   ^~~~
Language: C

#include<stdio.h>
typedef long long ll;
#define PB	push_back
#define FOR(n)			for(int i = 0; i < n; ++i)
#define RFOR(n)			for(int i = n; i >= 0; --i)
#define FORR(start,end) for(int i = start; i < end; ++i)
#define COUT(n)			cout << n << " " << flush
#define vi(v)			vector<int> v
#define vii(v)			vector<pair<int,int>> v
#define mkp(a,b)		make_pair(a,b)
#define ALL(obj)		obj.begin(), obj.end()

int main() {
	int n, cou = 0;
	char color[100001];

	scanf_s("%d", &n);
	scanf_s("%s", color, 100000);

	FORR(0,n-1){
		if (color[i] != color[i + 1]) {
			cou++;
		}
	}
	printf("%d\n", cou+1);
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   17 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C++

#include<iostream>
using namespace std;
int main(){
  int n;
  cin>>n;
  char s[n];
  for(i=0;i<n;i++){
    cin>>s[i]
  }
  cout<<s[0];
  for(i=0;i<n-1;i++){
    if(s[i+1]!=s[i])
      cout<<s[i+1];
  }
  cout<<"\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: 'i' was not declared in this scope
    7 |   for(i=0;i<n;i++){
      |       ^
a.cc:11:7: error: 'i' was not declared in this scope
   11 |   for(i=0;i<n-1;i++){
      |       ^
Language: C++

					#include<bits/stdc++.h>

					#define mp make_pair
					#define pb push_back
					#define sqr(x) (x) * (x)
					#define sors(s) sort(s.begin(), s.end())
					#define sz(s) s.size()
					#define B begin()
					#define E end()
					#define F first
					#define S second
					#define I insert
					#define N 222222
					#define M 1000000007
					
					using namespace std;
					typedef long long ll;
					typedef vector<int> vi;
					typedef pair<int,int> pii;
					typedef set<int> si;
					typedef set<string> ss;
					typedef multiset<int> mi;
					typedef map<string, int> msi;
     				typedef vector<pair<int, int>> vii;
     				
					int n, x; string s;
					int main()
					{	
                      cin >> n >> s;
                      for (int i = 0; i < sz(s); i ++)
                      {
                        if (s[i] != s[i + 1])
                          x += s[i];
                      }				
                      cout << x.size();
					}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:33: error: request for member 'size' in 'x', which is of non-class type 'int'
   35 |                       cout << x.size();
      |                                 ^~~~
Language: C++

n = int(input())
# alist = list(map(int, input().split()))
# res = 0
# for i in range(n-1):
#     for j in range(i+1,n):
#         res += alist[i] * alist[j]
# print(res)

s = input()
prev = s[0]
res = 1
for i in range(1,n):
    if prev != s[i]:
        res += 1
    prev = s[i]
print(res)

Compiler output:
a.cc:2:3: error: invalid preprocessing directive #alist
    2 | # alist = list(map(int, input().split()))
      |   ^~~~~
a.cc:3:3: error: invalid preprocessing directive #res
    3 | # res = 0
      |   ^~~
a.cc:4:3: error: invalid preprocessing directive #for
    4 | # for i in range(n-1):
      |   ^~~
a.cc:5:7: error: invalid preprocessing directive #for
    5 | #     for j in range(i+1,n):
      |       ^~~
a.cc:6:11: error: invalid preprocessing directive #res
    6 | #         res += alist[i] * alist[j]
      |           ^~~
a.cc:7:3: error: invalid preprocessing directive #print
    7 | # print(res)
      |   ^~~~~
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < n; i++)
#define reps(i, n , m) for(ll i = n; i <= m; i++)
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using vi = vector<int>;
using vl = vector<ll>;
const int mod = 1000000007; 
long long inv[200000],fact[200000],ifact[200000];
long long comb(ll n, ll k){
	if(n<k)return 0;
	else if (n<0||k<0) return 0;
	else return fact[n] * ifact[k] % mod * ifact[n-k] % mod;
}
typedef long long ll;template<typename Typell>Typell G_C_D(Typell a, Typell b){if (a < 0) a = -a;if (b < 0) b = -b;while (b != 0) {a %= b;if (a == 0) return b;b %= a;}return a;}template<typename Typell>
Typell G_C_D(const std::vector<Typell> &list){Typell a = list[0];for (size_t i = 1; i < list.size(); ++i) {a = G_C_D(a, list[i]);}return a;}template<typename Typell>Typell L_C_M(Typell a, Typell b) {if( a == 0 && b == 0)return 0;return a / G_C_D(a, b) * b;}
template<typename Typell>Typell L_C_M(const std::vector<Typell> &list){Typell a = list[0];for (size_t i = 1; i < list.size(); ++i) {a = L_C_M(a, list[i]);}return a;}
 
int main(){
	ios::sync_with_stdio(false);cin.tie(0);
	/*inv[1] = fact[0] = fact[1] = ifact[0] = ifact[1] = 1; for (int i=2;i<200000;i++){ inv[i] = (mod - mod / i) * inv[mod % i] % mod; fact[i] = fact[i-1] * i % mod;ifact[i] = ifact[i-1] * inv[i] % mod;
	}*/ //nCr
	int N;
	cin>>N;
	string S;
	cin>>S;
	int ans=1;
	int k=S.length();
	
	rep(i,k-1) {
		if(S.at(i)!=S.at(i+1)) ans++;
	}
	cout<<ans<<endl;
	return

Compiler output:
a.cc: In function 'int main()':
a.cc:36:15: error: expected primary-expression at end of input
   36 |         return
      |               ^
a.cc:36:15: error: expected ';' at end of input
   36 |         return
      |               ^
      |               ;
a.cc:36:15: error: expected '}' at end of input
a.cc:21:11: note: to match this '{'
   21 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define reg register
#define ll long long
inline ll read()
{
	ll x=0,w=0;char ch=getchar();
	while(!isdigit(ch))w|=ch=='-',ch=getchar();
	while(isdigit(ch))x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
	return w?-x:x;
}
int n,ans;
char s[100005];
int main()
{
    n=read();reg int i;
    scanf("%s",s+1);ans=1;
    for(i=2;i<=n;++i)
        if(s[i]!=s[i-1)ans++;
    cout<<ans<<"\n";
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   16 |     n=read();reg int i;
      |                      ^
a.cc:19:23: error: expected ']' before ')' token
   19 |         if(s[i]!=s[i-1)ans++;
      |                       ^
      |                       ]
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<utility>
#define rep(i,x) for(int i=0;i<x;i++)
#include<string>

using namespace std;

int main(){
 long long N;
  cin>>N;
  string S;
  rep(i,N){
  	cin>>S[i];
  }
  
  long long count=N;
  for(long long i=0,i<(N-1);i++){
  	if(S[i]==S[i+1]){
    	count--;
    }
  }
  cout<<count;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:22: error: expected ';' before '<' token
   19 |   for(long long i=0,i<(N-1);i++){
      |                      ^
      |                      ;
a.cc:19:22: error: expected primary-expression before '<' token
Language: C++

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

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

    string S;
    cin >> S;

    int cnt=1;
    for(int i=0; i<N-1; i++){
        if(S.at(i) != S.at(i+1)){
            cnt++;
        }

    cout << cnt << endl;
}


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

#include <iostream>
using namespace std;

int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  
  string a = '1';
  int total = 0;
  
    for (int b = 0; b < N; ++b) {
      
        if(S[b] != a[0]){
        total += 1; // 合計値
        
      }
      a[0] = S[b];
    }
  
  cout << total << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   10 |   string a = '1';
      |              ^~~
Language: C++

#include <iostream>
using namespace std;

int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  
  string a = '1';
  total = 0;
  
    for (int b = 0; b < N; ++b) {
      
        if(S[b] != a[0]){
        total += 1; // 合計値
        
      }
      a[0] = S[b];
    }
  
  cout << total << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   10 |   string a = '1';
      |              ^~~
a.cc:11:3: error: 'total' was not declared in this scope
   11 |   total = 0;
      |   ^~~~~
Language: C++

using namespace std;
int main()
{
  long long n,cnt=0,i;
  cin>>n;
  string s;
  cin>>s;
  for(i=0;i<n-1;i++)
  {
    if(s[i]!=s[i+1])
      cnt++;
  }
  cout<<cnt<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>n;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string s;
      |   ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | using namespace std;
a.cc:7:8: error: 's' was not declared in this scope
    7 |   cin>>s;
      |        ^
a.cc:13:3: error: 'cout' was not declared in this scope
   13 |   cout<<cnt<<endl;
      |   ^~~~
a.cc:13:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:14: error: 'endl' was not declared in this scope
   13 |   cout<<cnt<<endl;
      |              ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

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

using ll=long long;
using int64=int64_t;
const int inf=100000000;

int in(){
  int a;
  cin >> a;
  return a;
}//int型関数の受け取り

void forin(int* x,int y){
  for (int i=0;i<y;i++){
    cin >> x[i];
  }
}//(x,y) int型配列x[y]の受け取り

int intpow(int x,int y){
  double a=x,b=y;
  return pow(a,b);
}//(x,y) xをy乗

int intfabs(int x){
  double a=x;
  return fabs(a);
}//(x) xの絶対値

int fact(int x){
  if (x == 1) return 1;
  return x*fact(x-1);
}//(x) x!

int fib(int x){
  if (x <= 2) return x;
  int a[x];
  a[0]=1;
  a[1]=2;
  for (int i=2;i<x;i++){
    a[i]=a[i-1]+a[i-2];
  }
  return a[x-1];
}//(x) フィボナッチ数列のx番目

int div1(ll x){
  return x%1000000007;
}

main(){
    int n=in(),ans=1;
    string s;
    cin >> s;
    char cl=s[0];
    for (int i=1;i<n;i++) {
        if (cl!=s[i]) {
            ams++;
            cl=s[i];
        }
    }
    cout << ans << endl;
}


Compiler output:
a.cc:50:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   50 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:57:13: error: 'ams' was not declared in this scope; did you mean 'ans'?
   57 |             ams++;
      |             ^~~
      |             ans
Language: C++

#include<stdio.h>
int main()
{
  int N;
  char S[100005]={};
  int i;
  int count=0;
  
  sacnf("%d",&N);
  scanf("%s",S);
  
  for(i=1;i<N;i++)
  {
    if(S[i]!=S[i-1])
      count++;
  }
  printf("%d",count);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'sacnf' was not declared in this scope; did you mean 'scanf'?
    9 |   sacnf("%d",&N);
      |   ^~~~~
      |   scanf
Language: C++

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

using ll=long long;
using int64=int64_t;
const int inf=100000000;

int in(){
  int a;
  cin >> a;
  return a;
}//int型関数の受け取り

void forin(int* x,int y){
  for (int i=0;i<y;i++){
    cin >> x[i];
  }
}//(x,y) int型配列x[y]の受け取り

int intpow(int x,int y){
  double a=x,b=y;
  return pow(a,b);
}//(x,y) xをy乗

int intfabs(int x){
  double a=x;
  return fabs(a);
}//(x) xの絶対値

int fact(int x){
  if (x == 1) return 1;
  return x*fact(x-1);
}//(x) x!

int fib(int x){
  if (x <= 2) return x;
  int a[x];
  a[0]=1;
  a[1]=2;
  for (int i=2;i<x;i++){
    a[i]=a[i-1]+a[i-2];
  }
  return a[x-1];
}//(x) フィボナッチ数列のx番目

int div1(ll x){
  return x%1000000007;
}

main(){
    int n=in(),ans=1;
    string s;
    cin >> s;
    char cl=s[0]
    for (int i=1;i<n;i++) {
        if (cl!=s[i]) {
            ams++;
            cl=s[i];
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc:50:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   50 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:55:5: error: expected ',' or ';' before 'for'
   55 |     for (int i=1;i<n;i++) {
      |     ^~~
a.cc:55:18: error: 'i' was not declared in this scope
   55 |     for (int i=1;i<n;i++) {
      |                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  long long n,cnt=0;
  cin>>n;
  string s;
  cin>>s;
  for(i=0;i<n-1;i++)
  {
    if(s[i]!=s[i+1])
      cnt++;
  }
  cout<<cnt<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'i' was not declared in this scope
    9 |   for(i=0;i<n-1;i++)
      |       ^
Language: C++

#include <iostream>
using namespace std;

int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  
  string before = '1';
  total = 0;
  
    for (int b = 0; b < N; ++b) {
      
        if(S[b] != before[0]){
        total += 1; // 合計値
        
      }
      before = S[b];
    }
  
  cout << total << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   10 |   string before = '1';
      |                   ^~~
a.cc:11:3: error: 'total' was not declared in this scope
   11 |   total = 0;
      |   ^~~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

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

  int num = 0, last = INT_MAX;
  for (auto &x : s)
  {
    if (x - 'a' != last)
    {
      ++num;
      last = x - 'a';
    }
  }
  cout << num << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:23: error: 'INT_MAX' was not declared in this scope
   13 |   int num = 0, last = INT_MAX;
      |                       ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <vector>
  +++ |+#include <climits>
    3 |
Language: C++

#include <bits/stdc++.h>
using namespace std;
inline int rf()
{
	int r;int 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;
}
//#define int long long
#define N
int n;
//int head[N<<1],nxt[N<<1],ver[N<<1],top=0;
//int val[N<<1];
/*
void add(int x,int y)
{
	 nxt[++top]=head[x];
	 head[x]=top;
	 ver[top]=y;
	 //val[top]=v;
}
*/
char c[100010];
signed main()
{
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	n=rf();
  	int ans=0;
  	scanf("s",%c+1);
  	for(int i=2;i<=n;i++)
		if(c[i]!=c[i-1])
          	ans++;
 	cout<<ans;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:19: error: expected primary-expression before '%' token
   32 |         scanf("s",%c+1);
      |                   ^
Language: C++

#include <iostream>
using namespace std;

int main() {
  int N;
  string S;
  cin >> N >> S;
  
  string before;
  total = 0;
  
    for (int b = 0; b < N; ++b) {
      
        if(S[b] != before[0]){
        total += 1; // 合計値
        
      }
      before = S[b];
    }
  
  cout << total << endl;
}


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

#include <stdio.h>
int main(){
    int n;
    scanf("%d",&n);
    char s[n];
    int i,j;
    scanf("%s",s);
    long ans=0;
    char last ="\0";
    for(i=0;i<n;i++){
        if(last != s[i]){
            
            ans++;
        }
        last = s[i];
    }

    printf("%ld\n",ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
    9 |     char last ="\0";
      |                ^~~~
      |                |
      |                const char*
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,d=1;
  cin >> a;
  char s[a+1];
  cin >> s;
  for(i=0;i<a-1;i++){
    if(s[i]!=s[i+1]){
      d++;
    }
  }
  cout << d << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   for(i=0;i<a-1;i++){
      |       ^
Language: Java

fun main(args: Array<String>) {
    abc143c()
}

fun abc143c() {
    val n = readLine()!!.toInt()
    val s = readLine()!!

    val slimes = mutableListOf<Char>()
    s.forEachIndexed { index, c ->
        if (index > 0) {
            if (slimes.last() != c) slimes.add(c)
        } else {
            slimes.add(c)
        }
    }

    println(slimes.size)
}


Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
fun main(args: Array<String>) {
^
  (use --enable-preview to enable unnamed classes)
Main.java:1: error: <identifier> expected
fun main(args: Array<String>) {
             ^
Main.java:1: error: class, interface, enum, or record expected
fun main(args: Array<String>) {
                    ^
3 errors
Language: C++

#include<bits/stdc++.h>
#define re register 
#define ll long long
#define in inline
using namespace std;
inline ll read(){
	int t=0;
	char v=getchar();
	while(v<'0'||v>'9')v=getchar();
	while(v>='0'&&v<='9'){
		t=(t<<3)+(t<<1)+v-'0';
		v=getchar();
	}
	return t;
}
string s,t;
ll n,m;
int main(){
	cin>>n;
	cin>>s;
	for(re ll i=1;i<strlen(s);++i){
		if(s[i]!=s[i-1])m++;
	}
	printf("%lld",m-1);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   21 |         for(re ll i=1;i<strlen(s);++i){
      |                   ^
a.cc:21:32: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   21 |         for(re ll i=1;i<strlen(s);++i){
      |                                ^
      |                                |
      |                                std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
Language: C++

#include<bits/stdc++.h>
#define re register 
#define ll long long
#define in inline
using namespace std;
inline ll read(){
	int t=0;
	char v=getchar();
	while(v<'0'||v>'9')v=getchar();
	while(v>='0'&&v<='9'){
		t=(t<<3)+(t<<1)+v-'0';
		v=getchar();
	}
	return t;
}
string s,t;
ll n,m;
int main(){
	cin>>n;
	cin>>s;
	for(re ll i=1;i<strlen(s);++i){
		if(a[i]!=a[i-1])m++;
	}
	printf("%lld",m-1);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   21 |         for(re ll i=1;i<strlen(s);++i){
      |                   ^
a.cc:21:32: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   21 |         for(re ll i=1;i<strlen(s);++i){
      |                                ^
      |                                |
      |                                std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
a.cc:22:20: error: 'a' was not declared in this scope
   22 |                 if(a[i]!=a[i-1])m++;
      |                    ^
Language: C++

#include <bits/stdc++.h>
#define PI 3.14159265359
#define NIL (-1)
#define LL long long
using namespace std;
const int64_t MOD = 1e9 + 7;
const int INF = INT_MAX;

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

	int MAX = 2 * 1e3 + 1;
	vector<int64_t> L(N), C(MAX);
	for (int i = 0; i < N; i++) {
		int n;
		cin >> n;
		C[n]++;
		L[i] = n;
	}
	for (int i = 1; i < MAX; i++) C[i] += C[i - 1];

	//for (int i = 0; i < 10; i++) {
	//	if (i) cout << ' ';
	//	cout << C[i];
	//}

	int64_t ret = 0;
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++) {
			if (i == j) continue;
			int64_t left, right;
			left = abs(L[i] - L[j]);
			right = L[i] + L[j];

			int64_t a = C[right - 1] - C[left];
			if (L[i] > left && L[i] < right) a--;
			if (L[j] > left && L[j] < right) a--;
			ret += max(a, 0LL);
		}
	}

	cout << ret / 6 << endl;
}

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

import bisect
N = int(input())
L = list(map(int,input().split()))
ans = 0

for i in range(N-2):
    for j in range(i+1,N-1):
        num = L[i] + L[j]
        ind = bisect.bisect_right(L,num - 1)
        if ind > j:
            ans += ind - j
print(ans)

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

import java.util.*;

public class Triangles {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        final int N = sc.nextInt();
        int[] sticks = scanSticks(sc, N);
        Arrays.sort(sticks);

        long answer = 0;

        for (int iLeft = 0; iLeft < N - 2; iLeft++) {
            int left = sticks[iLeft];

            int iMiddle = iLeft + 1;
            int iRight = iLeft + 2;
            int middle = sticks[iMiddle];
            int right = sticks[iRight];

            while (true) {
                if (isSatisfied(left, middle, right)) {
                    if (iRight != N - 1) {
                        answer++;
                        right = sticks[++iRight];
                    }
                    else {
                        answer += iRight - iMiddle;
                        break;
                    }
                }
                else if (iMiddle + 1 == iRight)
                    break;
                else
                    middle = sticks[++iMiddle];
            }
        }

        System.out.println(answer);
    }

    private static int[] scanSticks(Scanner sc, final int N) {
        int[] sticks = new int[N];

        for (int i = 0; i < N; i++)
            sticks[i] = sc.nextInt();

        return sticks;
    }

    private static boolean isSatisfied(int left, int middle, int right) {
        return left + middle > right;
    }
}

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

import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():
    n = I()
    l = LI()
    l.sort()
    ans = 0

    for i in range(n):
        for j in range(i):
            mini = l[i] - l[j]
            if mini < l[j]:
                ans += n-bisect.bisect_right(l, mini) - (n-j)

    print(ans)

main()


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import bisect,collections,copy,itertools,math,string
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i,n){
    cin >> a.at(i);
  }
  sort(a.begin(),a.end());
  int i,j;
  for(i=0;i<n;i++){
    for(j=i+1;j<n;j++){
      int p=a.at(j),q=a.at(n-1);
      while(
      
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:17:13: error: expected primary-expression at end of input
   17 |       while(
      |             ^
a.cc:17:13: error: expected ')' at end of input
   17 |       while(
      |            ~^
      |             )
a.cc:17:13: error: expected statement at end of input
a.cc:17:13: error: expected '}' at end of input
a.cc:15:23: note: to match this '{'
   15 |     for(j=i+1;j<n;j++){
      |                       ^
a.cc:17:13: error: expected '}' at end of input
   17 |       while(
      |             ^
a.cc:14:19: note: to match this '{'
   14 |   for(i=0;i<n;i++){
      |                   ^
a.cc:17:13: error: expected '}' at end of input
   17 |       while(
      |             ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
 
int main() {
  long long N,ans=0;
	cin>>N;
	vector<long long> L(N);
	rep(i,N)cin>>L[i];
	sort(L,begin(),L.end());
	for(int i=0;i<N-2;++i){
		for(int j=i+1;j<N-1;++j){
			for(int k=j+1;k<N;++k){
				if (L[k]<L[i]+L[j]) ++ans;
			}
		}
	}
	cout<<ans<<"\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:21: error: no matching function for call to 'begin()'
   10 |         sort(L,begin(),L.end());
      |                ~~~~~^~
In file included from /usr/include/c++/14/bits/algorithmfwd.h:39,
                 from /usr/include/c++/14/bits/stl_algo.h:59,
                 from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/initializer_list:88:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::begin(initializer_list<_Tp>)'
   88 |     begin(initializer_list<_Tp> __ils) noexcept
      |     ^~~~~
/usr/include/c++/14/initializer_list:88:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/range_access.h:52:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(_Container&)'
   52 |     begin(_Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:52:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:63:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(const _Container&)'
   63 |     begin(const _Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:63:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:95:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::begin(_Tp (&)[_Nm])'
   95 |     begin(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:95:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/valarray:1227:5: note: candidate: 'template<class _Tp> _Tp* std::begin(valarray<_Tp>&)'
 1227 |     begin(valarray<_Tp>& __va) noexcept
      |     ^~~~~
/usr/include/c++/14/valarray:1227:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/valarray:1238:5: note: candidate: 'template<class _Tp> const _Tp* std::begin(const valarray<_Tp>&)'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
/usr/include/c++/14/valarray:1238:5: note:   candidate expects 1 argument, 0 provided
Language: C

#include <stdio.h>
#include <stdlib.h>

int cmp(const void *a, const void *b)
{ return *(int *)b - *(int *)a ;}

int main()
{
  int n,i,j,k,count=0;
  int *l;

  scanf("%d", &n);
  l = calloc(n,sizeof(int));

  for(i=0; i<n; i++)
    scanf("%d",&l[i]);

  qsort(l,n,sizeof(int),cmp);

  for(i=0; i<n-2; i++){
    for(k=i+1; k<n-1; k++){
      for(j=k+1; j<n; j++){
        if(l[i]+l[k]>l[j] && l[i]+l[k]>l[j] && l[i]+l[k]>l[j]))
        count++;
      }
    }
  }

  printf("%d", count);
  free(l);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:23:63: error: expected statement before ')' token
   23 |         if(l[i]+l[k]>l[j] && l[i]+l[k]>l[j] && l[i]+l[k]>l[j]))
      |                                                               ^
Language: C++

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

int main() {
    int n;
    cin >> n;
    vector<int> L(n);
    rep(i,n) cin >> L[i];
    sort(L.begin(), L.end());
    int ans = 0;
    rep(b,n)rep(a,b) {
        int ab = L[a]+L[b];
        int r = lower_bound(L.begin(), L.end(), ab) - L.beegin();
        int l = b+1;
        ans += r-l;
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:57: error: 'class std::vector<int>' has no member named 'beegin'; did you mean 'begin'?
   16 |         int r = lower_bound(L.begin(), L.end(), ab) - L.beegin();
      |                                                         ^~~~~~
      |                                                         begin
Language: C++

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

int n;
vector<int> l;

bool isok(int a,int b, int c){
  if(l[a]+l[b]>l[c])return true;
  else return false;
}

    
int nibutan(int a,int b){
  int ok=b,ng=n;
  while(ng-ok>1){
    int naka=(ng+ok)/2;
    if(isok(a,b,naka))ok=naka;
    else{
      ng=naka;
    }
  }
    return ok-b;
  }
    
 int main(){
  cin>>n;
  rep(i,n){
    cin>>l[i];
  }
   ll ans=0;
  sort(l.begin(),l.end());
  for(int a=0;a<n;a++){
    for(int b=a+1;b<n;b++){
      ans+=nibutan(a,b);
    }
  }
 }
  cout<<ans<<endl;
}

Compiler output:
a.cc:40:3: error: 'cout' does not name a type
   40 |   cout<<ans<<endl;
      |   ^~~~
a.cc:41:1: error: expected declaration before '}' token
   41 | }
      | ^
Language: C++

#include <iostream>
#include<iomanip>
#include <string>
#include<vector>
#include<algorithm>
#include<utility>
#include<queue>
#include<math.h>
#include<stack>
#include<set>
#include<map>
#include<ctime>
#include<cstdlib>
#define INF 1001001001001001001
#define MAX 2001001
#define rep(i,n,m) for(int i=n;i<m;i++)

using namespace std;

int main() {
	int n;
	cin >> n;
	vector<int>L(n),fix(n);
	rep(i, 0, n) {
		cin >> L[i];
		fix[i] = L[i];
	}
	sort(fix.begin(), fix.end());

	long long int ans = n * (n - 1) * (n - 2) / 6;
	rep(i, 0, n) {
		rep(j, i, n) {
			if (i == j)continue;
			auto count = lower_bound(fix.begin(), fix.end(),fix[i] + fix[j]);
			ans = ans - long long int(fix.end() - count);
		}
	}
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:37: error: expected primary-expression before 'long'
   35 |                         ans = ans - long long int(fix.end() - count);
      |                                     ^~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
	
	int N;
	cin>>N;
	int arr[N];
	int count = 0;
	for(int i=0; i<N; i++)
	{
		cin>>arr[i];
	}

	int n = sizeof(arr)/sizeof(arr[0]); 
    sort(arr, arr+n); 

    for(int i=0; i<N; i++)
    {
    	int k = i+2;
    	for(int j=(i+1); j<N; j++)
    	{
    		while(k<N && (arr[i]+arr[j] > arr[k]))
    		{
    			k++;
    		}
    		count = count + k - j -1;
    	}
    }
    cout<<count;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   16 |     sort(arr, arr+n);
      |     ^~~~
      |     short
Language: C++

#include <iostream>
using namespace std;

int main(){
	
	int N;
	cin>>N;
	int arr[N];
	int count = 0;
	for(int i=0; i<N; i++)
	{
		cin>>arr[i];
	}

	int n = sizeof(arr)/sizeof(arr[0]); 
    qsort(arr, arr+n); 

    for(int i=0; i<N; i++)
    {
    	int k = i+2;
    	for(int j=(i+1); j<N; j++)
    	{
    		while(k<N && (arr[i]+arr[j] > arr[k]))
    		{
    			k++;
    		}
    		count = count + k - j -1;
    	}
    }
    cout<<count;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:19: error: invalid conversion from 'int*' to 'size_t' {aka 'long unsigned int'} [-fpermissive]
   16 |     qsort(arr, arr+n);
      |                ~~~^~
      |                   |
      |                   int*
a.cc:16:10: error: too few arguments to function 'void qsort(void*, size_t, size_t, __compar_fn_t)'
   16 |     qsort(arr, arr+n);
      |     ~~~~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdlib.h:970:13: note: declared here
  970 | extern void qsort (void *__base, size_t __nmemb, size_t __size,
      |             ^~~~~
Language: C++

/*
    @uthor: Amit Kumar
    user -->GitHub: drviruses ; CodeChef: dr_virus_ ; Codeforces,AtCoder,Hackerearth,Hakerrank: dr_virus;
*/
#include <bits/stdc++.h>
#include <chrono>
using namespace std;
using namespace std::chrono;
//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;
//#define ln mp::cpp_int;
#define ll    long long
#define ld    long double
#define ull   unsigned long long
#define endl "\n"
ll google_itr = 1;
#define google(x) cout<<"Case #"<<x<<":"
#define pi 3.14159265358979323846264338327950L

const ll mod = 1e9+7;
const ll inf = 1e18;

ll popcount(ll num){
    num = num - ((num >> 1) & 0x55555555);
    num = (num & 0x33333333) + ((num >> 2) & 0x33333333);
    return ((num + (num >> 4) & 0xF0F0F0F) * 0x1010101) >> 24;
}

vector<pair<ll,ll>> factor_arr;

void myfactor(ll num){ 
    ll count = 0;   
    while (!(num % 2)) { 
        num >>= 1; count++; 
    }  
    if (count) factor_arr.push_back({2,count}); 
    for (auto i = 3; i <= sqrt(num); i += 2) { 
        count = 0; 
        while (num % i == 0) { 
            count++; 
            num /= i; 
        } 
        if (count) factor_arr.push_back({i,count}); 
    } 
    if (num > 2) factor_arr.push_back({num,1});
}

void virus(){
        ll len;
        cin>>len;
        vector<ll> arr(len);
        for(auto &i:arr) cin>>i;
        sort(arr.begin(),arr.end());
        ll ans = 0;
        for(auto i=len-1; i>=0; i--){
            for(auto j=i-1; j>=0; j--){
                ll tot = lower_bound(arr.begin(),arr.end(),arr[i]+arr[j]) - arr.begin();
                ans += (len - 1 - i) - (len - tot)
            }
        }
        cout<<ans;
}


int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    
  /*#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif*/

    ll t=1;
    //cin>>t;
    while(t--){
           auto start = high_resolution_clock::now();
           virus();
           auto stop = high_resolution_clock::now();
           auto duration = duration_cast<seconds>(stop - start);
         //cout << "Time: "<<duration.count()<<endl;
        //your code goes here
    }
    return 0;
}

Compiler output:
a.cc: In function 'void virus()':
a.cc:58:51: error: expected ';' before '}' token
   58 |                 ans += (len - 1 - i) - (len - tot)
      |                                                   ^
      |                                                   ;
   59 |             }
      |             ~
Language: C++

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

 

int main() {
    int N;
    int k = 3;
    cin >> N;
    vector<int> L(N);
    rep(i,N) cin >> L.at(i);
    sort(L.begin(), L.end());
    int ans = 0;
    rep(i,N) for (int j = i + 1; j < N; ++j) {
        ans += max(0, distance(L.begin() + j, lower_bound(L.begin(), L.end(), L.at(i)+L.at(j))) - 1);
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:19: error: no matching function for call to 'max(int, std::__iterator_traits<__gnu_cxx::__normal_iterator<int*, std::vector<int> >, void>::difference_type)'
   18 |         ans += max(0, distance(L.begin() + j, lower_bound(L.begin(), L.end(), L.at(i)+L.at(j))) - 1);
      |                ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:18:19: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__iterator_traits<__gnu_cxx::__normal_iterator<int*, std::vector<int> >, void>::difference_type' {aka 'long int'})
   18 |         ans += max(0, distance(L.begin() + j, lower_bound(L.begin(), L.end(), L.at(i)+L.at(j))) - 1);
      |                ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:18:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   18 |         ans += max(0, distance(L.begin() + j, lower_bound(L.begin(), L.end(), L.at(i)+L.at(j))) - 1);
      |                ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main()
{
    vector<int> B;
    int count=0;
    // 整数の入力
    int N;
    cin >> N;
  int a,b,c;
    for(int i = 0; i < N; i++){
    // スペース区切りの整数の入力
      cin >> a ;
      B.push_back(a);
    }

  	// 計算
  	for(int a:B){
	  	for(int b:B){
  			for(int c:B){
              if((a+b>c)&&(b+c>a)&&(c+b>a) && ((a-b)&&(b-c)&&(c-a)){
                count++;
              }
            }
        }
    }
  
    // 出力
    cout << count << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:68: error: expected ')' before '{' token
   22 |               if((a+b>c)&&(b+c>a)&&(c+b>a) && ((a-b)&&(b-c)&&(c-a)){
      |                 ~                                                  ^
      |                                                                    )
a.cc:25:13: error: expected primary-expression before '}' token
   25 |             }
      |             ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main()
{
    vector<int> B;
    int count=0;
    // 整数の入力
    int N;
    cin >> N;
  int a,b,c;
    for(int i = 0; i < N; i++){
    // スペース区切りの整数の入力
      cin >> a ;
      B.push_back(a);
    }

  	// 計算
  	foreach(a,B){
	  	foreach(b,B){
  			foreach(c,B){
              if((a+b>c)&&(b+c>a)&&(c+b>a)){
                count++;
              }
            }
        }
    }
  
    // 出力
    cout << count << endl;
    return 0;
}


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

#include<iostream>
#include<vector>
using namespace std;
int main()
{
    vector<int> B;
    int count=0;
    // 整数の入力
    int N;
    cin >> N;
    for(int i = 0; i < N; i++){
    // スペース区切りの整数の入力
      cin >> a ;
      B.push_back(a);
    }

  	// 計算
  	foreach(a,B){
	  	foreach(b,B){
  			foreach(c,B){
              if((a+b>c)&&(b+c>a)&&(c+b>a)){
                count++;
              }
            }
        }
    }
  
    // 出力
    cout << count << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: 'a' was not declared in this scope
   13 |       cin >> a ;
      |              ^
a.cc:18:17: error: 'a' was not declared in this scope
   18 |         foreach(a,B){
      |                 ^
a.cc:18:9: error: 'foreach' was not declared in this scope; did you mean 'fread'?
   18 |         foreach(a,B){
      |         ^~~~~~~
      |         fread
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main()
{
    vector<int> B;
    int count=0;
    // 整数の入力
    int N;
    cin >> N;
    for(int i = 0; i < N; i++){
    // スペース区切りの整数の入力
      cin >> a ;
      B.push_back(a);
    }

  	// 計算
  	foreach(B,a){
	  	foreach(B,b){
  			foreach(B,c){
              if((a+b>c)&&(b+c>a)&&(c+b>a)){
                count++;
              }
            }
        }
    }
  
    // 出力
    cout << count << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: 'a' was not declared in this scope
   13 |       cin >> a ;
      |              ^
a.cc:18:19: error: 'a' was not declared in this scope
   18 |         foreach(B,a){
      |                   ^
a.cc:18:9: error: 'foreach' was not declared in this scope; did you mean 'fread'?
   18 |         foreach(B,a){
      |         ^~~~~~~
      |         fread