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

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

void lengthLIS(ll *arr,ll *ne,ll n)
{
    
    for(ll i=1;i<n;i++)
    {
        for(ll j=i-1;j>=0;j--)
        {
            if(arr[j]<arr[i]&&ne[j]+1>ne[i])
            {
                ne[i]=ne[j]+1;
                
                
                
            }
        }
    }
    return;
    
}

 
int main()
{
    ll n,a,start,end,mid,ma=1,t,b;
    //double x,y,z;
  
    cin>>n;
      ll arr[n];
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
      
    }
      ll cnt=1;
    for(int i=1;i<n;i++)
    {
      if(arr[i]<arr[i-1]
         {
           cnt++;
         }
         else arr[i]=arr[i-1];
      
    }
      cout<<cnt;
    return 0;
}
 
 

Compiler output:
a.cc: In function 'int main()':
a.cc:41:25: error: expected ';' before '{' token
   41 |       if(arr[i]<arr[i-1]
      |                         ^
      |                         ;
   42 |          {
      |          ~               
a.cc:45:10: error: expected primary-expression before 'else'
   45 |          else arr[i]=arr[i-1];
      |          ^~~~
a.cc:44:11: error: expected ')' before 'else'
   44 |          }
      |           ^
      |           )
   45 |          else arr[i]=arr[i-1];
      |          ~~~~
a.cc:41:9: note: to match this '('
   41 |       if(arr[i]<arr[i-1]
      |         ^
Language: C++

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <math.h>
#include <iomanip>
#include <bitset>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <utility>
#include <set>
using namespace std;
typedef long long int ll;
typedef long double ld;
const long long INF = 1LL << 60;
#define MOD 1000000007

vector<pair<ll,ll>> p;
bool pairCompare(const pair<double,ll>& firstElof, const pair<double,ll>& secondElof){
    return firstElof.first < secondElof.first;
}
 
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

#define MAX_V 100010
#define MAX_N 100010
bool x[MAX_N];
ll num[MAX_N];
 
ll fibl[MAX_N]={0};

ll cost[MAX_V][MAX_V];
ll d[MAX_V];
bool used[MAX_V];
ll V;

void dijkstra(ll s){
    fill(d,d+V,INF);
    fill(used,used+V,false);
    d[s]=0;
    while(true){
        ll V=-1;
        for (ll u=0;u<V;u++){
        }
    }
}

ll fib(ll a){
    if (fibl[a]!=0)return fibl[a];
    if (a==0){
        return 0;
    }else if (a==1){
        return 1;
    }
    return fibl[a]=fib(a-1)+fib(a-2);
}
 
ll eratosthenes(ll n) {
    int p = 0;
    for (ll i=0; i<=n; ++i) x[i] = true;
    x[0] = x[1] = false;
    for(int i=2; i<=n; ++i) {
        if(x[i]) {
            p++;
            for(int j=2*i; j<=n; j+=i) x[j] = false;
        }
        
        num[i] = p;
    }
    
    return p;
}
 
ll gcd(ll a,ll b){
    if (a%b==0)return(b);
    else return(gcd(b,a%b));
}

int main(){
    ll n;
    cin >> n;
    ll x[n],ans=n;
    for (ll i=0;i<n;i++){
        cin >> x[i];
    }
    for (ll i=0;i<n;i++){
        for (ll j=0;j<i;j++){
            if (x[i]<x[j]){
                ans--;
                break;
            }
        }
    }
    cout << ans << endl;
    return 0;
}



Compiler output:
/tmp/ccURWaw7.o: in function `dijkstra(long long)':
a.cc:(.text+0x34): relocation truncated to fit: R_X86_64_PC32 against symbol `V' defined in .bss section in /tmp/ccURWaw7.o
a.cc:(.text+0x43): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccURWaw7.o
a.cc:(.text+0x57): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccURWaw7.o
a.cc:(.text+0x6a): relocation truncated to fit: R_X86_64_PC32 against symbol `V' defined in .bss section in /tmp/ccURWaw7.o
a.cc:(.text+0x74): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/ccURWaw7.o
a.cc:(.text+0x89): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/ccURWaw7.o
a.cc:(.text+0xa4): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/ccURWaw7.o
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
int acs(const void *a, const void *b){return *(int*)a - *(int*)b;} /* 1,2,3,4.. */
int des(const void *a, const void *b){return *(int*)b - *(int*)a;} /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b){return *(char*)a - *(char*)b;} /* a,b,c,d.. */
int cmp_str(const void *a, const void *b){return strcmp(*(const char **)a, *(const char **)b);} /* aaa,aab.. */
#define min(a,b) (a < b ? a: b)
#define max(a,b) (a > b ? a: b)
#define rep(i, l, r) for (int i = l; i < r; i++)
#define MAX 200001
#define MOD 1000000007

typedef long long int lli;

int main(void) {
  int n;
  int p[MAX];
  scanf("%d", &n);

  rep(i, 0, n) scanf("%d", &p[i]);

  int cnt = 1;
  int min = a[0];
  rep(i, 1, n) {
    if (a[i] < min) cnt++;
    min = min(min, a[i]);
  }
  printf("%d\n", cnt);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:28:13: error: 'a' undeclared (first use in this function)
   28 |   int min = a[0];
      |             ^
main.c:28:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

int main(){
    int N;
    cin >> N;
    int num = 0, p[N], min[N];

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

    min[0]=p[0];
    for (int i = 1; i < N; i++){
        min[i]= min(p[i-1], p[i]);
    }
    for (int i = 0; i < N; i++)
    {
        if(min[i] == p[i]){
            num++;
        }
    }
    
    
    cout << num << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:20: error: 'min' cannot be used as a function
   15 |         min[i]= min(p[i-1], p[i]);
      |                 ~~~^~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main()

  {

  long int N,i,j,c=0,a=0;


  cin>>N;
  long int P[N];

  for(i=1;i<=N;i++)

    {

    cin>>P[i];

    }

  for(i=1;i<=N:i++)

    {

    for(j=1;j<=i;j++)

      {

      if(P[i]<=P[j])

        c++;

      if(c==j)

        continue;

      else

        break;

      }

    if(c==i)

      a=a+1;

    c=0;

    }

  cout<<a;

  }



Compiler output:
a.cc: In function 'int main()':
a.cc:23:11: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   23 |   for(i=1;i<=N:i++)
      |           ^
a.cc:23:15: error: found ':' in nested-name-specifier, expected '::'
   23 |   for(i=1;i<=N:i++)
      |               ^
      |               ::
a.cc:23:14: error: 'N' is not a class, namespace, or enumeration
   23 |   for(i=1;i<=N:i++)
      |              ^
a.cc:55:3: error: expected primary-expression before '}' token
   55 |   }
      |   ^
a.cc:53:11: error: expected ')' before '}' token
   53 |   cout<<a;
      |           ^
      |           )
   54 | 
   55 |   }
      |   ~        
a.cc:23:6: note: to match this '('
   23 |   for(i=1;i<=N:i++)
      |      ^
a.cc:55:3: error: expected primary-expression before '}' token
   55 |   }
      |   ^
Language: C

#include<stdio.h>
#include<malloc.h>
#define MAXSIZE 1000

struct NODE
{
	int data;
	struct NODE* next;
	int id;
};
typedef struct NODE NODE;


int search(NODE* head, int id)
{
	NODE* p;
	p = head;
	while (p != NULL)
	{
		if ((p->id)-1 == id)
			return p->data;
		p = p->next;
	}
}

int main()
{
	NODE* p = NULL, * head = NULL, * r=NULL;
	int a[MAXSIZE],N,i,j,count=0,flag=0;
	scanf_s("%d", &N);
	for (i = 0; i < N; i++)
	{
		if (i==0)
		{ 
			head = (NODE*)malloc(sizeof(NODE));
			scanf_s("%d", &head->data);
			head->id = 1;
			r = head;
		}
		else
		{
			p = (NODE*)malloc(sizeof(NODE));
			scanf_s("%d", &p->data);
			p->id = i + 1;
			r->next = p;
			r = p;
			p->next = NULL;
		}
	}
	for (i = 0; i < N; i++)
	{
		flag = 0;
		for (j = i; j >= 0; j--)
		{
			if (search(head,i) > search(head,j))
			{
				flag = 1;
				break;
			}
		}
		if (flag == 0)
			count++;
	}
	printf("%d", count);
}

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

#include<bits/stdc++.h>

using namespace std;

int main()

  {

  long int N,i,j,c=0,a=0,P[N];

  cin>>N;

  for(i=1;i<=N;i++)

    {

    cin>>P[i];

    }

  for(i=1;i<=N:i++)

    {

    for(j=1;j<=i;j++)

      {

      if(P[i]<=P[j])

        c++;

      if(c==j)

        continue;

      else

        break;

      }

    if(c==i)

      a=a+1;

    c=0;

    }

  cout<<a;

  }



Compiler output:
a.cc: In function 'int main()':
a.cc:21:11: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   21 |   for(i=1;i<=N:i++)
      |           ^
a.cc:21:15: error: found ':' in nested-name-specifier, expected '::'
   21 |   for(i=1;i<=N:i++)
      |               ^
      |               ::
a.cc:21:14: error: 'N' is not a class, namespace, or enumeration
   21 |   for(i=1;i<=N:i++)
      |              ^
a.cc:53:3: error: expected primary-expression before '}' token
   53 |   }
      |   ^
a.cc:51:11: error: expected ')' before '}' token
   51 |   cout<<a;
      |           ^
      |           )
   52 | 
   53 |   }
      |   ~        
a.cc:21:6: note: to match this '('
   21 |   for(i=1;i<=N:i++)
      |      ^
a.cc:53:3: error: expected primary-expression before '}' token
   53 |   }
      |   ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main()

  {

  long int N,i,j,c=0,a=0;

    int  P[N];

  cin>>N;

  for(i=1;i<=N;i++)

    {

    cin>>P[i];

    }

  for(i=1;i<=N:i++)

    {

    for(j=1;j<=i;j++)

      {

      if(P[i]<=P[j])

        c++;

      if(c==j)

        continue;

      else

        break;

      }

    if(c==i)

      a=a+1;

    c=0;

    }

  cout<<a;

  }



Compiler output:
a.cc: In function 'int main()':
a.cc:23:11: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   23 |   for(i=1;i<=N:i++)
      |           ^
a.cc:23:15: error: found ':' in nested-name-specifier, expected '::'
   23 |   for(i=1;i<=N:i++)
      |               ^
      |               ::
a.cc:23:14: error: 'N' is not a class, namespace, or enumeration
   23 |   for(i=1;i<=N:i++)
      |              ^
a.cc:55:3: error: expected primary-expression before '}' token
   55 |   }
      |   ^
a.cc:53:11: error: expected ')' before '}' token
   53 |   cout<<a;
      |           ^
      |           )
   54 | 
   55 |   }
      |   ~        
a.cc:23:6: note: to match this '('
   23 |   for(i=1;i<=N:i++)
      |      ^
a.cc:55:3: error: expected primary-expression before '}' token
   55 |   }
      |   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
  {
  long int N,i,j,c=0,a=0
    int  P[N];
  cin>>N;
  for(i=1;i<=N;i++)
    {
    cin>>P[i];
    }
  for(i=1;i<=N:i++)
    {
    for(j=1;j<=i;j++)
      {
      if(P[i]<=P[j])
        c++;
      if(c==j)
        continue;
      else
        break;
      }
    if(c==i)
      a=a+1;
    c=0;
    }
  cout<<a;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: expected ',' or ';' before 'int'
    6 |     int  P[N];
      |     ^~~
a.cc:10:10: error: 'P' was not declared in this scope
   10 |     cin>>P[i];
      |          ^
a.cc:12:11: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   12 |   for(i=1;i<=N:i++)
      |           ^
a.cc:12:15: error: found ':' in nested-name-specifier, expected '::'
   12 |   for(i=1;i<=N:i++)
      |               ^
      |               ::
a.cc:12:14: error: 'N' is not a class, namespace, or enumeration
   12 |   for(i=1;i<=N:i++)
      |              ^
a.cc:28:3: error: expected primary-expression before '}' token
   28 |   }
      |   ^
a.cc:27:11: error: expected ')' before '}' token
   27 |   cout<<a;
      |           ^
      |           )
   28 |   }
      |   ~        
a.cc:12:6: note: to match this '('
   12 |   for(i=1;i<=N:i++)
      |      ^
a.cc:28:3: error: expected primary-expression before '}' token
   28 |   }
      |   ^
Language: Java

package atcoder;

import java.util.ArrayList;
import java.util.Scanner;

public class BTNode {
	private Integer label;
	private BTNode left;
	private BTNode right;

	public BTNode() {
		this.label = label;
		this.left = left;
		this.right = right;
	}

	public void create(Integer a) {
		if (this == null) {
			this.label = a;
		}
		if (this.label >= a) {
			right.create(a);
		} else {
			left.create(a);
		}
	}

	public int search() {
		BTNode a;
		int ans = 0;
		for(;;) {
			if (this != null) {
				ans += 1;
				a = this.left;
			}
		}
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int ans = 0;
		int n = sc.nextInt();
		// スペース区切りの整数の入力
		ArrayList<Integer> p = new ArrayList<Integer>();
		p.add(sc.nextInt());

		BTNode tree = new BTNode();
		for (Integer input : p) {

			tree.create(input);
		}
		ans = tree.search();
		//System.out.println(tree);
		System.out.println(ans);
	}
}

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

#include<bits/stdc++.h>
using namespace std;
int main()
{
   long long int m,n,x=0,y,i;
    cin>>n;
    int a[n+3];
    x=a[0];
    for(i=1;i<=n;i++)
    {
        cin>>a[i];
        if(a[i]>=x)
        {
            c++;
            x=a[i];
        }
    }
    cout<<c<<endl;


      return 0;
    }


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

#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#define rep(i,n) for(int i = 0; i < (n); ++i)
typedef long long ll; 
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> p(n);
  rep(i, n)cin >> p[i];
  int count = 0;
  int mi = p[0];
  rep(i, n){
    if (p[i] <= mi ){++count;}
    ma = min(mi, p[i]);
  }
  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: 'ma' was not declared in this scope; did you mean 'mi'?
   18 |     ma = min(mi, p[i]);
      |     ^~
      |     mi
Language: C++

// #include <iostream>
// #include <algorithm>
// #include <string>
// #include <vector>
#include <bits/stdc++.h>
using namespace std;

int main() {
    int N;
    cin >> N;
    int P[N];
    for (int i=0; i<N; i++) {
        cin >> P[i];
    }
    int pen=0;
    for (int j=0; j<N; j++) {
        for (int k=0; k<j; k++){
            if (P[j] > P[k]) {
                pen +=1;
            }
        }
    }
    int toal = N -pen;
    cout << total;
    }


Compiler output:
a.cc: In function 'int main()':
a.cc:24:13: error: 'total' was not declared in this scope; did you mean 'toal'?
   24 |     cout << total;
      |             ^~~~~
      |             toal
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int n,i,j,d=0;c=0;
  cin>>n;
  int a[n];
  for (i=0;i<n;i++)
    cin>>a[i];
  for (i=1;i<n;i++)
  {
    for (j=0;j<i;i++)
    {
      if (a[i]<=a[j])
        c++;
    }
    if (c==i)
      d++;
  }
  cout<<d<<"/n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:17: error: 'c' was not declared in this scope
    5 |   int n,i,j,d=0;c=0;
      |                 ^
Language: Java

import java.util.Scanner;

public class Test_c	 {

	public static void Main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int P[] = new int[N];
		int sum = 1;
		boolean flag = true;
		for(int i=0; i < N; i++) {
		P[i] = scan.nextInt();
		}
		int pre_min = P[0];


		for(int i=1; i<N; i++) {
			loop: for(int j=1; j<i+1; j++) {
			flag = true;
			if(P[i] > pre_min) {
				flag = false;
				continue loop;
			}
			/*
			if(P[i] > P[j-1]) {
				flag = false;
				break;
			}

			if(P[i] == 0) {
				flag = true;
				break;
			}
			*/
		}
			if(flag == true) {
				sum += 1;
				pre_min = P[i];
			}
		}
		System.out.print(sum);


	}

}


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

#include <stdio.h>
#include <math.h>
int main(void)
{
  int N = 0;
  scanf("%d", &N);
 
  int P[N] = 0;
  for(int i = 0; i < N;i++){
  scanf("%d", &P[i]);
  }
  
  int ans = 0;
 
  for(int j = 0; j < N; j++){
    for(int k = 0; k <= j ; k ++){
      if(P[k] > P[j]){
        break;
      }if(k == j){
        ans++;
      }
    }
  }
      
  printf("%d", ans);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:14: error: variable-sized object may not be initialized except with an empty initializer
    8 |   int P[N] = 0;
      |              ^
Language: C++

#include <cstdlib>
#include <iostream>

using namespace std;

int main(){
  int a,cnt=0,cnt1=0;
  cin>>a;
  int n[a];
  for(int i=0;i<a;i++)cin>>a[i];
  for(int i=1;i<a;i++){
     for(int j=i-1;j>=0;j--){
       if(a[j]>=a[i])cnt++;
     }
    if(cnt==i-1)cnt1++;
  }
  cout<<cnt1+1;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:29: error: invalid types 'int[int]' for array subscript
   10 |   for(int i=0;i<a;i++)cin>>a[i];
      |                             ^
a.cc:13:12: error: invalid types 'int[int]' for array subscript
   13 |        if(a[j]>=a[i])cnt++;
      |            ^
a.cc:13:18: error: invalid types 'int[int]' for array subscript
   13 |        if(a[j]>=a[i])cnt++;
      |                  ^
Language: Java

import java.util.Scanner;

public class Test_c	 {

	public static void Main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int P[] = new int[N];
		int sum = 1;
		boolean flag = true;
		for(int i=0; i < N; i++) {
		P[i] = scan.nextInt();
		}
		int pre_min = P[0];


		for(int i=1; i<N; i++) {
			for(int j=1; j<i+1; j++) {
			flag = true;
			if(P[i] > pre_min) {
				flag = false;
				break;
			}
			/*
			if(P[i] > P[j-1]) {
				flag = false;
				break;
			}

			if(P[i] == 0) {
				flag = true;
				break;
			}
			*/
		}
			if(flag == true) {
				sum += 1;
				pre_min = P[i];
			}
		}
		System.out.print(sum);


	}

}


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

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// スペース区切りの整数の入力
		int b = sc.nextInt();
      int[] hairetu=new int[b];
        for(int i=0;i<hairetu.length;i++){
          int c=sc.nextInt();
          hairetu[i]=c;
        }
      int count=0;
      int champ=hairetu[0];
      for(int k=0;k<hairetu.length;k++){
        if(champ>=hairetu[i]){
          champ=hairetu[i];
          count++;
        }
      }
      System.out.println(count);
	}
}


Compiler output:
Main.java:15: error: cannot find symbol
        if(champ>=hairetu[i]){
                          ^
  symbol:   variable i
  location: class Main
Main.java:16: error: cannot find symbol
          champ=hairetu[i];
                        ^
  symbol:   variable i
  location: class Main
2 errors
Language: C++

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


int fact(int n) 
{ 

    return (n==1 || n==0) ? 1: n * fact(n - 1);  
} 

int main()
{
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    int t=1;
    for(int i=1;i<n;i++)
    {    
        
        if(fact(a[i-1])>fact(a[i]))
            t++:        
          
    }
    
    cout<<t;
    
    
    return 0;
}


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

#include <cstdlib>
#include <iostream>

using namespace std;

int main(){
  int a,cnt=0,cnt1=0;
  cin>>a;
  int n[a];
  for(int i=0;i<a;i++)cin>>a[i];
  for(int i=0;i<a;i++){
     for(int j=i-1;j>=0;j--){
       if(a[j]>=a[i])cnt++;
     }
    if(cnt==i-1)cnt1++;
  }
  cout<<cnt1;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:29: error: invalid types 'int[int]' for array subscript
   10 |   for(int i=0;i<a;i++)cin>>a[i];
      |                             ^
a.cc:13:12: error: invalid types 'int[int]' for array subscript
   13 |        if(a[j]>=a[i])cnt++;
      |            ^
a.cc:13:18: error: invalid types 'int[int]' for array subscript
   13 |        if(a[j]>=a[i])cnt++;
      |                  ^
Language: C++

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


int fact(int n) 
{ 

    return (n==1 || n==0) ? 1: n * fact(n - 1);  
} 

int main()
{
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    int t=1;
    for(int i=1;i<n;i++)
    {    
        
        if(fact(a[i-1])>fact(a[i]))
            t++        
          
    }
    
    cout<<t;
    
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:16: error: expected ';' before '}' token
   26 |             t++
      |                ^
      |                ;
   27 | 
   28 |     }
      |     ~
Language: C

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a[200005],n,cnt=0,Min,Max;
    scanf("%d",&n);
    for(int i=0; i<n; i++)
    {
        scanf("%d",&a[i]);
    }
    if(a[0]>a[1])
    {
        Max=a[0];
        for(int i=1; i<n; i++)
        {
            if(a[i]<Max)
            {
                cnt++;
            }
        }
    }
    else if(a[0]<a[1])
    {
        Min=a[0];
        for(int i=1; i<n; i++)
        {
            if(a[i]>Min)
            {
                cnt++;
            }
        }
    }
    printf("%d\n",(cnt+1));
return 0;

}


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

#include <cstdlib>
#include <iostream>

using namespace std;

int main(){
  int a,cnt=0,cnt1=0;
  cin>>a;
  int n[a];
  for(int i=0;i<a;i++)cin>>a[i];
  for(int i=0;i<a;i++){
     for(int j=i-1;j>=0;j--){
       if(a[j]>a[i])cnt++;
     }
    if(cnt==i-1)cnt1++;
  }
  cout<<cnt1;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:29: error: invalid types 'int[int]' for array subscript
   10 |   for(int i=0;i<a;i++)cin>>a[i];
      |                             ^
a.cc:13:12: error: invalid types 'int[int]' for array subscript
   13 |        if(a[j]>a[i])cnt++;
      |            ^
a.cc:13:17: error: invalid types 'int[int]' for array subscript
   13 |        if(a[j]>a[i])cnt++;
      |                 ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
  int n;
  cin >> n;
  int e=0;
  int d=0;
  vector<int> t(n);
  for(int i=0; i<n; i++){
    cin >> t[i];
  }
  for(int i=0; i<n; i++){
    for(int j=0; j<i; j++){
      if(t[i] <= t[j]){
        e=1;
      }
    }
    if(e ==1){
      d+=1;
  }
  cout << d << endl;
  return 0;
}
  


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

#include<iostream>
#include<vector>
using namespace std;
int main(){
  int n;
  cin >> n;
  int e=0;
  int d=0;
  vector<int> t(n);
  for(int i=0; i<n; i++){
    cin >> t[i];
  }
  for(int i=0; i<n; i++){
    for(int j=0; j<i; j++){
      if(t[i] <= t[j]){
        e=1;
      }
    }
    if(e ==1){
      d+=1:
  }
  cout << d << endl;
  return 0;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:20:11: error: expected ';' before ':' token
   20 |       d+=1:
      |           ^
      |           ;
a.cc:24:2: error: expected '}' at end of input
   24 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: Java

import java.io.*;
import java.util.StringTokenizer;


public class Main {

    public static void main(String[] args) throws Exception {
        FastScanner scanner = new FastScanner(System.in);
        int N = scanner.nextInt();
        int[] P = new int[N];
        for (int i = 0; i < N; i++) {
            P[i] = scanner.nextInt();
        }
        int ans = 0;
        for (int i = 0; i < N; i++) {
            ans++;
            for (int j = 0; j < i; j++) {
                if (P[i] > P[j]) {
                    ans--;
                    break;
                }
            }
        }

        // 出力
        PrintWriter printWriter = new PrintWriter(System.out);
        printWriter.printf("%d\n", ans);
        printWriter.close();
    }

    static class FastScanner {
        private BufferedReader reader = null;
        private StringTokenizer tokenizer = null;

        public FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }

        public String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }

            return tokenizer.nextToken("\n");
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public long nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
             return Double.parseDouble(next());
         }

        public int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        } 
    }
}

Compiler output:
Main.java:9: error: incompatible types: possible lossy conversion from long to int
        int N = scanner.nextInt();
                               ^
Main.java:12: error: incompatible types: possible lossy conversion from long to int
            P[i] = scanner.nextInt();
                                  ^
Main.java:78: error: incompatible types: possible lossy conversion from long to int
                a[i] = nextInt();
                              ^
3 errors
Language: C++

#include <bits/stdc++.h>
#define FOR(i,a,b) for(ll i=a; i<ll(b); i++) 
#define rep(i,n) for(ll i = 0; i < ll(n); i++)
using namespace std;
typedef long long ll;
const ll MOD = 1e9+7;
int gcd(int a, int b){ //a>=0,b>=0,￢(a=b=0)
  while(min(a,b)>0){if(a<b)swap(a,b);a=a%b;}return max(a,b);
}
//int:~2e9   小数:double

int main(){
  int n;
  cin >>n;
  vector<int> p(n);
  rep(i,n) cin >> p[i];
  vector<bool> st(n,true);
  int ans=n;
  for (int i = n-1; i>-1; i--){
    st[t-1]=false;
    rep(j,p[i]-1){
      if(st[j]) {
        
        ans--;
       // cout<<t<<endl;
        
        break;
      }
    }
  }
  //cout<<endl;
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:8: error: 't' was not declared in this scope
   20 |     st[t-1]=false;
      |        ^
Language: C++

#include <bits / stdc ++。h>
使用命名空间std;
int main（）
{
	int n;
	scanf（“％d”，＆n）;
	int i，a [1000000]，sum = 0，j，flag = 1;
	for（i = 0; i <n; i ++）
	{
		scanf（“％d”，＆a [i]）;
		标志= 1;
		for（j = 0; j <= i; j ++）
		{
			如果（a [i]> a [j]）
			{
				标志= 0;
				打破;
			}
		}
		如果（标志== 1）
		sum ++; 
	}
	printf（“％d”，sum）;
} 


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

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>

using namespace std;

int main()
{
	long long n, ans = 0,min;
	cin >> n;
	vector<long long> p(n);
	for (long long i = 0; i < n; i++)
		cin >> p[i];

	for (long long i = 0; i < n; i++)
	{
		if (i == 0)
			min = p[i];
		else if (min < p[i])
		{
			continue;
		}

		min = p[i];

		ans++;
	}

	cout << ans << endl;
} >> p[i];

	for (long long i = 0; i < n; i++)
	{
		if (n - p[i] < i)
			continue;

		if (p[i] == 1)
		{
			ans++;
			continue;
		}

		for (long long j = 0; j <= i; j++)
		{
			if (p[i] > p[j])
				break;

			if (j == i)
				ans++;
		}
	}
	
	cout << ans << endl;
}

Compiler output:
a.cc:32:3: error: expected unqualified-id before '>>' token
   32 | } >> p[i];
      |   ^~
a.cc:34:9: error: expected unqualified-id before 'for'
   34 |         for (long long i = 0; i < n; i++)
      |         ^~~
a.cc:34:31: error: 'i' does not name a type
   34 |         for (long long i = 0; i < n; i++)
      |                               ^
a.cc:34:38: error: 'i' does not name a type
   34 |         for (long long i = 0; i < n; i++)
      |                                      ^
a.cc:55:9: error: 'cout' does not name a type
   55 |         cout << ans << endl;
      |         ^~~~
a.cc:56:1: error: expected declaration before '}' token
   56 | }
      | ^
Language: C

#include <stdio.h>
int main(){
    int N,p[200001];
    scanf("%d",&N);
    int i,j,count,point;
    for(i=0;i<N;i++){
        if(scanf("%d",&p[i])==1){
        }
    }
    
    count = 1;
    for(i=1;i<N;i++){
        point = 0;
        for(j=0;j<i;j++){
            if(p[i]>p[j]){
                point = 1;
                break
            }
        }
        if(point == 0){
            count++;
        }
    }
    
    printf("%d\n",count);
    return 0;
}



Compiler output:
main.c: In function 'main':
main.c:17:22: error: expected ';' before '}' token
   17 |                 break
      |                      ^
      |                      ;
   18 |             }
      |             ~
Language: C++

/* 
 * Author: pawanmsr
 */

/*
 * Run in Mac using the following command:
 * g++ -std=c++14 <cpp_filename>
 * A binary will be generated. Then run:
 * ./a.out
 */

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <fstream>
#include <cstring>
#include <unordered_map>
#include <limits>
// #include <bits/stdc++.h>

using namespace std;
typedef long long int ll;

// Macro //
#define X first
#define Y second
#define pii pair<int,int>
#define pll pair<ll,ll>

// Global //
int n, p[100005];

// Functions //


// Main //
int main(int argc, char const *argv[])
{
    // ios_base::sync_with_stdio(false);
    // cin.tie(NULL);

    // #ifndef ONLINE_JUDGE
    // freopen("input.txt", "r", stdin);
    // // freopen("output.txt", "w", stdout);
    // #else
    // // online submission
    // #endif
    
    /* code */
    cin >> n;
    int mn = INT_MAX;
    
    int res = 0;
    for (int i=0; i<n; i++) {
        cin >> p[i];
        if (p[i] <= mn) {
            mn = p[i];
            res++;
        }
    }
    cout << res << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:65:14: error: 'INT_MAX' was not declared in this scope
   65 |     int mn = INT_MAX;
      |              ^~~~~~~
a.cc:31:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   30 | #include <cstring>
  +++ |+#include <climits>
   31 | #include <unordered_map>
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int n;
  cin>>n;
  int a[n];
  for(int i=0;i<n;i++)
    cin>>a[i];
  int sum=1;
  for(int i=1;i<n;i++)
  {
    for(int j=0;j<i;j++)
    {
      if(a[i]>a[j])
        break;
    }
    if(j==i)
      sum++;
  }
  cout<<sum;
  return 0;
            
}

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

#include<iostream>
#include<vector>
using namespace std;
int main(){
  int n,time=0;
  cin >> n;
  int d=0;
  vector<int> t(n);
  for(int i=0; i<n; i++){
    cin >> t[i];
    for(int j=0 j<i; j++){
      if(t[i] <= t[j]){
        d+=1;
      }  
    }
  }
  cout << d << endl;
  return 0;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: expected ';' before 'j'
   11 |     for(int j=0 j<i; j++){
      |                ^~
      |                ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,i,c=1,d=0;
  int a[200000];
  cin>>n;
  for(i=0;i<n;i++)
    cin>>a[i];
  for(i=1;i<n;i++)
  {
    for(j=0;j<i;j++)
    {
    if(a[i]>a[j])
      d++;
    }
    if(d==0)
      c++;
    d=0;
  }
  cout<<c;
}

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

#include <iostream>
using namespace std;

int main() {
	long n,c=0;
	cin>>n;
	int a[n];
	for(i=0;i<n;i++)
	cin>>a[i];
	if(n==1)
	cout<<1<<endl;
	else{
	for(i=0;i<n-1;i++)
	{
	    if(a[i+1]<a[i])
	    c++;
	}
	cout<<c+1;}
	return 0;
}


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

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

int main(){
    int N;
    cin >> N;
    vector<int> P(N);
    int ans = N;
    for (int i = 0; i < N; i++) {
        cin >> P.at(i);
        if (P.at(i) < i){
            for (int j = 0; j < i; j++){
                if (P.at(i) < P.at(j)){
                    ans--;
                    break;
                }
                else ans--;
        }
    }
    cout << ans << endl;
}

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

int main(void)
{
  unsigned long N;
  if (scanf("%lu", &N) != 1)
    return 0;

  unsigned long P;
  vector<unsigned long> Ps;
  for (int i = 0; i < N; i++)
  {
    if (scanf("%lu", &P) != 1)
      return 0;
    Ps.emplace_back(P);
  }
  
  unsigned long count = 0;

  for (int i = 1; i < N; i++)
  {
    bool flag = true;

    for (int j = i-1; j != -1; j--)
    {
      if (Ps[i] > Ps[j])
      {
        flag = false;
        break;
      }
    }
    if (flag)
      count ++;
  }
  cout << count + 1 << endl;

  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:7: error: 'scanf' was not declared in this scope
    4 |   if (scanf("%lu", &N) != 1)
      |       ^~~~~
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<unsigned long> Ps;
      |   ^~~~~~
a.cc:8:10: error: expected primary-expression before 'unsigned'
    8 |   vector<unsigned long> Ps;
      |          ^~~~~~~~
a.cc:11:9: error: 'scanf' was not declared in this scope
   11 |     if (scanf("%lu", &P) != 1)
      |         ^~~~~
a.cc:13:5: error: 'Ps' was not declared in this scope; did you mean 'P'?
   13 |     Ps.emplace_back(P);
      |     ^~
      |     P
a.cc:24:11: error: 'Ps' was not declared in this scope; did you mean 'P'?
   24 |       if (Ps[i] > Ps[j])
      |           ^~
      |           P
a.cc:33:3: error: 'cout' was not declared in this scope; did you mean 'count'?
   33 |   cout << count + 1 << endl;
      |   ^~~~
      |   count
a.cc:33:24: error: 'endl' was not declared in this scope
   33 |   cout << count + 1 << endl;
      |                        ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  int sum1==0;
  int sum2==0;
 
  vector<int> vec(N); 
 
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  
  for(int i = 0; i < N; i++){
    for(int j = 0;j <= i; j++){ 
     if(vec.at(j)>=vec.at(i))sum1++;
    }
  if(sum1==i+1)sum2++;
  sum1=0;
  }
  cout << sum2 << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: expected initializer before '==' token
    7 |   int sum1==0;
      |           ^~
a.cc:8:11: error: expected initializer before '==' token
    8 |   int sum2==0;
      |           ^~
a.cc:18:30: error: 'sum1' was not declared in this scope
   18 |      if(vec.at(j)>=vec.at(i))sum1++;
      |                              ^~~~
a.cc:20:6: error: 'sum1' was not declared in this scope
   20 |   if(sum1==i+1)sum2++;
      |      ^~~~
a.cc:20:16: error: 'sum2' was not declared in this scope
   20 |   if(sum1==i+1)sum2++;
      |                ^~~~
a.cc:21:3: error: 'sum1' was not declared in this scope
   21 |   sum1=0;
      |   ^~~~
a.cc:23:11: error: 'sum2' was not declared in this scope
   23 |   cout << sum2 << endl;
      |           ^~~~
Language: C++

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

int main(void){
    int N;
    cin >> N;
    std::vector<int> P(N);
    for (int i=0;i<N;i++){
        cin >> P.at(i);
    }
    int ans =0;
    int minimam = N+1;
    for (int i=0;i<N;i++){
        if (P.at(i)<minimam){
            minimam = P.at(i);
            ans++;
        }
        
        
    }
cout << ans<<endl;
return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:22:10: error: expected '}' at end of input
   22 | return 0;
      |          ^
a.cc:4:15: note: to match this '{'
    4 | int main(void){
      |               ^
Language: C++

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

int main()
{
  int i,j,N;
  int k;
  int h,sum;
  h=0;
  vector<int> P;
  sum=0;
  cin >> N;
  for( i=0;i<N;i++)
  {
    cin >>k;
    P.push_back(k);
  }
  
  std::vector<int>::iterator minIt = *std::min_element(P.begin(), P.end());
  size_t minIndex = std::distance(P.begin(), minIt);
  for( i=minIndex;i>=0;i--)
  {
    for( j=i-1;j>=0;j--)
    {
      if(P[i]>P[j])
      {
        h=1;
       
        break;
      }
    }
    if(h==0)
    {
      sum++;
    }
    h=0;
  }
  cout << sum<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:38: error: conversion from 'int' to non-scalar type 'std::vector<int>::iterator' requested
   19 |   std::vector<int>::iterator minIt = *std::min_element(P.begin(), P.end());
      |                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
 
int main(){
    int N;
    cin >> N;
    vector<int> P(N);
    for (int i=0; i<N; i++){
        cin >> P.at(i);
    }
 
    int num = 0;
    int minP = 0;

    for (int i=0; i<N; i++){
        minP = *std::min_element(P.begin(), i+1);
        if (P[i] == minP){
            num = num + 1;
        }
        
    }

    cout << num << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:22: error: 'min_element' is not a member of 'std'; did you mean 'tuple_element'?
   17 |         minP = *std::min_element(P.begin(), i+1);
      |                      ^~~~~~~~~~~
      |                      tuple_element
Language: C++

int main(void)
{
  unsigned long N;
  if (scanf("%lu", &N) != 1)
    return 0;

  unsigned long P;
  vector<unsigned long> Ps;
  for (int i = 0; i < N; i++)
  {
    if (scanf("%lu", &P) != 1)
      return 0;
    Ps.emplace_back(P);
  }

  //function<void(unsigned long, vector<unsigned long>&)> func = MyFunc;
  //func(N, Ps);

  unsigned long count = 0;

  for (int i = 1; i < N; i++)
  {
    bool flag = true;

    for (int j = i-1; j != -1; j--)
    {
      if (Ps[i] > Ps[j])
      {
        flag = false;
        break;
      }
    }
    if (flag)
      count ++;
  }
  cout << count + 1 << endl;

  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:7: error: 'scanf' was not declared in this scope
    4 |   if (scanf("%lu", &N) != 1)
      |       ^~~~~
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<unsigned long> Ps;
      |   ^~~~~~
a.cc:8:10: error: expected primary-expression before 'unsigned'
    8 |   vector<unsigned long> Ps;
      |          ^~~~~~~~
a.cc:11:9: error: 'scanf' was not declared in this scope
   11 |     if (scanf("%lu", &P) != 1)
      |         ^~~~~
a.cc:13:5: error: 'Ps' was not declared in this scope; did you mean 'P'?
   13 |     Ps.emplace_back(P);
      |     ^~
      |     P
a.cc:27:11: error: 'Ps' was not declared in this scope; did you mean 'P'?
   27 |       if (Ps[i] > Ps[j])
      |           ^~
      |           P
a.cc:36:3: error: 'cout' was not declared in this scope; did you mean 'count'?
   36 |   cout << count + 1 << endl;
      |   ^~~~
      |   count
a.cc:36:24: error: 'endl' was not declared in this scope
   36 |   cout << count + 1 << endl;
      |                        ^~~~
Language: C++

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

int main()
{
  int i,j,N;
  int k;
  int h,sum;
  h=0;
  vector<int> P;
  sum=0;
  cin >> N;
  for( i=0;i<N;i++)
  {
    cin >>k;
    P.push_back(k);
  }
  
  std::vector<int>::iterator minIt = *std::min_element(vec.begin(), vec.end());
  size_t minIndex = std::distance(vec.begin(), minIt);
  for( i=minIndex;i>=0;i--)
  {
    for( j=i-1;j>=0;j--)
    {
      if(P[i]>P[j])
      {
        h=1;
       
        break;
      }
    }
    if(h==0)
    {
      sum++;
    }
    h=0;
  }
  cout << sum<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:56: error: 'vec' was not declared in this scope
   19 |   std::vector<int>::iterator minIt = *std::min_element(vec.begin(), vec.end());
      |                                                        ^~~
Language: C++

/* 
 * Author: pawanmsr
 */

/*
 * Run in Mac using the following command:
 * g++ -std=c++14 <cpp_filename>
 * A binary will be generated. Then run:
 * ./a.out
 */

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <fstream>
#include <cstring>
#include <unordered_map>

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

using namespace std;
typedef long long int ll;

// Macro //
#define X first
#define Y second
#define pii pair<int,int>
#define pll pair<ll,ll>

// Global //
int n, p[100005];

// Functions //


// Main //
int main(int argc, char const *argv[])
{
    // ios_base::sync_with_stdio(false);
    // cin.tie(NULL);

    // #ifndef ONLINE_JUDGE
    // freopen("input.txt", "r", stdin);
    // // freopen("output.txt", "w", stdout);
    // #else
    // // online submission
    // #endif
    
    /* code */
    cin >> n;
    int mn = INT_MAX;
    
    int res = 0;
    for (int i=0; i<n; i++) {
        cin >> p[i];
        if (p[i] <= mn) {
            mn = p[i];
            res++;
        }
    }
    cout << res << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:65:14: error: 'INT_MAX' was not declared in this scope
   65 |     int mn = INT_MAX;
      |              ^~~~~~~
a.cc:31:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   30 | #include <cstring>
  +++ |+#include <climits>
   31 | #include <unordered_map>
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(){
  int i,j,n,p[200000],count=0,ans=0;
  
  scanf("%d",&n);
  
  for(i=0;i<n;i++){
    scanf("%d",&p[i]);
  }
  
  int total=p[0];
  
  if(p[0]>p[1]){
    ans++;
  }
  j=0;
  for(i=1;i<n;i++){
    count=0;
      if(p[j]>=p[i]){
        count++;
        //printf("p[i]=%d,p[j]=%d,count=%d,ans=%d\n",p[i],p[j],count,ans);
        if(count==i){
          count=0;
          ans++;
        }
      }
    else{
      break;
    }
    }
  }
  printf("%d\n",ans+1);
  return 0;
}

Compiler output:
main.c:34:10: error: expected declaration specifiers or '...' before string constant
   34 |   printf("%d\n",ans+1);
      |          ^~~~~~
main.c:34:17: error: unknown type name 'ans'
   34 |   printf("%d\n",ans+1);
      |                 ^~~
main.c:35:3: error: expected identifier or '(' before 'return'
   35 |   return 0;
      |   ^~~~~~
main.c:36:1: error: expected identifier or '(' before '}' token
   36 | }
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <fstream>
#include <stdio.h>
#include <cmath>
#define REP(i, n) for(int i = 0; i < n; i++)
//#define REPR(i, n) for(int i = n; i >= 0; i--)
//#define FOR(i, m, n) for(int i = m; i < n; i++)
//#define INF 1e9
//#define ALL(v) v.begin(), v.end()

using namespace std;
//typedef long long ll;

int main() {

    cin.tie(0);
    ios::sync_with_stdio(false);

    //std::cout << "Hello, World!\n";
    
    int N, m, tmp=0, ans=0;
    std::vector<int> v;
    cin>>N;
    m = N;
    while(1)
    {
        int x;
        std::cin >> x;
        if(std::cin.eof()){
            break;
        }
        v.push_back(x);
    }
    
    REP(i,N) {
        std::vector<int>::iterator p = std::find(v.begin(), v.end(), i);
        tmp = static_cast<int>(p - v.begin());
        if (tmp < m) {
            ans += 1;
            m = tmp;
        }
    }

    std::cout << ans;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:49: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   37 |         std::vector<int>::iterator p = std::find(v.begin(), v.end(), i);
      |                                        ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:37:49: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   37 |         std::vector<int>::iterator p = std::find(v.begin(), v.end(), i);
      |                                        ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
typedef  long long ll;
using namespace std;
int main(){   
   int n;
   cin>>n;
   vector<int> p(n);
   int count=0;
   int x=100000000;
   for (int i = 0; i < n; i++)
   {
    int a;
    cin>>a;
    p[i]=a;
    int flag=0;
    if(x<a) flag=1;    
    if(flag==0) count++;
    x=min(x,a);
   }
   cout<<count;
   
   

    
   return

Compiler output:
a.cc: In function 'int main()':
a.cc:26:10: error: expected primary-expression at end of input
   26 |    return
      |          ^
a.cc:26:10: error: expected ';' at end of input
   26 |    return
      |          ^
      |          ;
a.cc:26:10: error: expected '}' at end of input
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^