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

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = (int)(n); i >= 0; i--)
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())
#define REVSORT(c) SORT(c);REVERSE(c)
#define ALL(x) (x).begin(),(x).end()
const long long MOD = 1000000007;
typedef long long ll;

int main(){
	int N;
	cin >> N;
	vector<ll> H(N);
	rep(i, N)cin >> H[i];
	
	ll M = 0;
	ll cnt = 1;
	bool J = true;
	for(int i = 1; i < N; i++){
		if(H[i - 1] >= H[i]){
			cnt++;
			if(J)J = false;
		} else {
			M = max(cnt, M);
			cnt = 1;
		}
		if(i == N - 1){
			M = max(M, cnt);
		}
	}
	cout << max(0,M - 1) << endl;
}


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

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

#define rep(i,n) for(int i=0; i<n; i++)
#define rept(i,a,b) for(int i=a; i<b; i++)
#define all(x) (x).begin(),(x).end()
#define fst first
#define sec	second
#define pb push_back

typedef long long ll;
typedef vector<int> vi;
typedef pair<long,long> P;

const int mod = 1e9 + 7;


int main() {
	ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

	int n;
	cin >> n;
	vi h(n);
	rep(i, n){
		cin >> h[i];
	}

	int sum=0, ans=0;
	rep(i, n-1){
		if(h[i] >= h[i+1]){
			sum++;
		}else{
			sum=0;
			}
		}
		ans = max(ans, sum);
	}

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



Compiler output:
a.cc:39:9: error: 'cout' does not name a type
   39 |         cout << ans << endl;
      |         ^~~~
a.cc:40:5: error: expected unqualified-id before 'return'
   40 |     return 0;
      |     ^~~~~~
a.cc:41:1: error: expected declaration before '}' token
   41 | }
      | ^
Language: C++

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

#define rep(i,n) for(int i=0; i<n; i++)
#define rept(i,a,b) for(int i=a; i<b; i++)
#define all(x) (x).begin(),(x).end()
#define fst first
#define sec	second
#define pb push_back

typedef long long ll;
typedef vector<int> vi;
typedef pair<long,long> P;

const int mod = 1e9 + 7;


int main() {
	ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

	int n;
	cin >> n;
	vi h(n);
	rep(i, n){
		cin >> h[i];
	}

	int sum=0, ans=0;
	rep(i, n-1){
		if(h[j] >= h[j+1]){
			sum++;
		}else{
			sum=0;
			}
		}
		ans = max(ans, sum);
	}

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



Compiler output:
a.cc: In function 'int main()':
a.cc:30:22: error: 'j' was not declared in this scope
   30 |                 if(h[j] >= h[j+1]){
      |                      ^
a.cc: At global scope:
a.cc:39:9: error: 'cout' does not name a type
   39 |         cout << ans << endl;
      |         ^~~~
a.cc:40:5: error: expected unqualified-id before 'return'
   40 |     return 0;
      |     ^~~~~~
a.cc:41:1: error: expected declaration before '}' token
   41 | }
      | ^
Language: C++

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

int main()
{
  int n,i;
  cin>>n;
  int arr[n];
  for( i=0;i<n;i++)
    cin>>arr[i];
  int count=0;
  int max=INT_MIN;
  int j = arr[n-1];
  for( i=n-2;i>=0;i--)
  {
   while(arr[i]>=arr[i+1])
   {
     count++;
     ans=i;
   }
    i=ans;
  }
  cout<<count;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:6: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 |      ans=i;
      |      ^~~
      |      abs
a.cc:21:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   21 |     i=ans;
      |       ^~~
      |       abs
Language: C++

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

int main()
{
  int n,i;
  cin>>n;
  int arr[n];
  for( i=0;i<n;i++)
    cin>>arr[i];
  int count=0;
  int max=INT_MIN;
  int j = arr[n-1];
  for( i=n-2;i>=0;i--)
  {
   while(arr[i]>=arr[i+1])
   {
     count++;
   }
  }
  cout<<count;
  return 0;

}
  
  i

Compiler output:
a.cc:26:3: error: 'i' does not name a type
   26 |   i
      |   ^
Language: C++

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

int main()
{
  int n,i;
  cin>>n;
  int arr[n];
  for( i=0;i<n;i++)
    cin>>arr[i];
  int count=0;
  int max=INT_MIN;
  int j = arr[n-1];
  for( i=n-2;i>=0;i--)
  {
   while(arr[i]>=arr[i+1])
   {
     count++;
   }
  }
  cout<<count;
  return 0;

}
  
  i

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespaces'
    2 | using namespaces std;
      |       ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin>>n;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:21:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   21 |   cout<<count;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc: At global scope:
a.cc:26:3: error: 'i' does not name a type
   26 |   i
      |   ^
Language: C++

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

int main()
{
  int n;
  cin>>n;
  int arr[n];
  for(int i=0;i<n;i++)
    cin>>arr[i];
  int count=0;
  int max=INT_MIN;
  int j = arr[n-1];
  for(int i=n-2;i>=0;i--)
  {
   while(arr[i]>=arr[i+1])
   {
     count++;
   }
  }
  cout<<count;
  return 0;

}
  
  i

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespaces'
    2 | using namespaces std;
      |       ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin>>n;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:21:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   21 |   cout<<count;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc: At global scope:
a.cc:26:3: error: 'i' does not name a type
   26 |   i
      |   ^
Language: C++

#include <bits/stc++.h>

using namespace std;

int main()
{
 	int n;
  cin>>n;
  int niza[n];
for(int i=0; i<n; i++)
{
	cin>>niza[i];
}
  int MAX=0;
  int curr=0;
  for(int i=0; i<n; i++)
  {
   		curr=0;
    for(int j=i; j<n-1; j++)
    {
      if(niza[j]>niza[j+1])curr+;
      else break;
    }	
    MAX=max(MAX,curr);
  }
  cout<<MAX<<endl;
  return 0;
}

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

#include<stdio.h>

#define N_MAX 100000

int main(void){

    int N,i,ans=0,AbleToDown = 0;
    long int H[N_MAX];

    scanf("%d",&N);
    for(i = 0;i < N;i++){
        scanf("%ld",&H[i]);
    }

    for(i = 0;i< N - 1;i++){
        if(H[i] >= H[i + 1]){
            AbleToDown++;
        }else{
            if(ans < AbleToDown){
                ans = AbleToDown;
            }
          　AbleToDown = 0;
        }
    }

    if(ans < AbleToDown){
        ans = AbleToDown;
    }

    printf("%d",ans);
    return 0;
}



Compiler output:
main.c: In function 'main':
main.c:22:11: error: stray '\343' in program
   22 |           <U+3000>AbleToDown = 0;
      |           ^~~~~~~~
Language: C++

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


 
int main()
{
    int n;
    cin>>n;
    int h;
    cin>>h;
    int min=h;
    for(int i=1 ; i<n ; i++)
    {
        cin>>h;
        if(h<=min)
        p++;
        else
        {
            min=h;
            v.push_back(p);
            p=0;
        }
        sort(v.begin(),v.end());
        cout<<v[v.size()-1];
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'p' was not declared in this scope
   18 |         p++;
      |         ^
a.cc:22:13: error: 'v' was not declared in this scope
   22 |             v.push_back(p);
      |             ^
a.cc:22:25: error: 'p' was not declared in this scope
   22 |             v.push_back(p);
      |                         ^
a.cc:25:14: error: 'v' was not declared in this scope
   25 |         sort(v.begin(),v.end());
      |              ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
    long long n;
    cin >> n;
    long long memo, ans = 0;
    vector<long long> h(n);
    for (long long i = 0; i < n; i++) cin >> h[i];
    for (long long j = 1; j < n; j++) {
        if (h[j-1] >= h[j]) {
            memo++;
            ans = max(memo, ans);
        }
        else (h[j-1] < h[j]) memo = 0;
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:29: error: expected ';' before 'memo'
   15 |         else (h[j-1] < h[j]) memo = 0;
      |                             ^~~~~
      |                             ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  int h;
  cin>>h;
  int min=h;
  vector<int> v;
  for(int i=1 ; i<n ; i++)
  	{
    	cin>>h;
    if(h<=min)
      p++;
    else
    {
      min=h;
      v.push_back(p);
     p=0;
    }
  	}
  sort(v.begin(),v.end());
  cout<<v[v.size()-1];
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:15:7: error: 'p' was not declared in this scope
   15 |       p++;
      |       ^
a.cc:19:19: error: 'p' was not declared in this scope
   19 |       v.push_back(p);
      |                   ^
Language: Java

import java.util.*;
class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int[] b;
        int n = 0;
        int bestn = 0;
        for(int i = 0; i < a;i++){
            b[i] = sc.nextInt();
        }
        for(int x=1; x >= a ;x++){
            int wk = b[i];
            n = 0;
            for(int y=i; y >= a ;y++){
                if(b[y] >= b[y+1]){
                    break;
                }else{
                    n++;
                }
            }
            if(bestn < n){
                bestn = n;
            }
        }
        System.out.println(bestn);
        sc.close();
    }
}


Compiler output:
Main.java:13: error: cannot find symbol
            int wk = b[i];
                       ^
  symbol:   variable i
  location: class Main
Main.java:15: error: cannot find symbol
            for(int y=i; y >= a ;y++){
                      ^
  symbol:   variable i
  location: class Main
2 errors
Language: C

#include <stdio.h>

void main(void){
  int N;
  int H[N];
  int i
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
  scanf("%d", &H[i]);
  }
  int ima=0;
  int count=0;
  for(i = 0; i < 100000000-1; i++) {
    if H[i]<H[i+1]{
      count=0;
      max = (max>count)?max:count;
    }else{
      count++
    }
 print(max)
}

Compiler output:
main.c: In function 'main':
main.c:7:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanf'
    7 |   scanf("%d", &N);
      |   ^~~~~
main.c:8:8: error: 'i' undeclared (first use in this function)
    8 |   for (i = 0; i < N; i++) {
      |        ^
main.c:8:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:8: error: expected '(' before 'H'
   14 |     if H[i]<H[i+1]{
      |        ^
      |        (
main.c:21:1: error: expected declaration or statement at end of input
   21 | }
      | ^
Language: Java

import java.util.*;
class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int[] b;
        int n = 0;
        int bestn = 0;
        for(int i = 0; i < a;i++){
            b[i] = sc.nextInt();
        }
        for(int x=1; x >= a ;x++){
            int wk = b[i]
            n = 0;
            for(int y=i; y >= a ;y++){
                if(b[y] >= b[y+1]){
                    break;
                }else{
                    n++;
                }
            }
            if(bestn < n){
                bestn = n;
            }
        }
        System.out.println(bestn);
        sc.close();
    }
}


Compiler output:
Main.java:13: error: ';' expected
            int wk = b[i]
                         ^
1 error
Language: C++

#include <iostream>
using namespace std;
 
int main()
{
  	int N, times = 0;
  	int *H = new int[N]();
  	for(int i = 0; i < N; cin >> int[i], i++);
  	for(int i = 0; i < N; i++)
    {
      	int count = 0;
		for(int j = i + 1; j < N; j++)
        {
			if(H[j] <= H[i])	count++;	
        }
      	if(count > times) times = count;
    }
  	cout << times << endl;
  	delete[] H;
	return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:38: error: expected primary-expression before 'int'
    8 |         for(int i = 0; i < N; cin >> int[i], i++);
      |                                      ^~~
a.cc:8:37: error: expected ')' before 'int'
    8 |         for(int i = 0; i < N; cin >> int[i], i++);
      |            ~                        ^~~~
      |                                     )
a.cc:8:41: error: structured binding declaration cannot have type 'int'
    8 |         for(int i = 0; i < N; cin >> int[i], i++);
      |                                         ^~~
a.cc:8:41: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:8:42: error: redeclaration of 'auto i'
    8 |         for(int i = 0; i < N; cin >> int[i], i++);
      |                                          ^
a.cc:8:17: note: 'int i' previously declared here
    8 |         for(int i = 0; i < N; cin >> int[i], i++);
      |                 ^
a.cc:8:44: error: expected initializer before ',' token
    8 |         for(int i = 0; i < N; cin >> int[i], i++);
      |                                            ^
a.cc:8:44: error: expected ';' before ',' token
Language: C

#include <stdio.h>

void main(void){
  int N;
  int H[N];
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
  scanf("%d", &H[i]);
  }
  int ima=0;
  int count=0;
  for(i = 0; i < 100000000-1; i++) {
    if H[i]<H[i+1]{
      count=0;
      max = (max>count)?max:count;
    }else{
      count++
    }
 print(max)
}

Compiler output:
main.c: In function 'main':
main.c:12:7: error: 'i' undeclared (first use in this function)
   12 |   for(i = 0; i < 100000000-1; i++) {
      |       ^
main.c:12:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:8: error: expected '(' before 'H'
   13 |     if H[i]<H[i+1]{
      |        ^
      |        (
main.c:20:1: error: expected declaration or statement at end of input
   20 | }
      | ^
Language: C


#include<stdio.h>
int main()
{
    int i, N ,a, aMax, j;
	scanf("%d",&N);

	int h[N]
	for (i = 0; i < N; i++){
		scanf("%d",&h[i]);
	}
	
	aMax = 0;
	for(j = 0; j < N - 1; j++){
		if(h[j] >= h[j+1]){
			a++;
			if (aMax < a){
				aMax = a;
			}
		else
			a = 0;
		}	
	}
	
	printf("%d" , a);
  
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'for'
    9 |         for (i = 0; i < N; i++){
      |         ^~~
main.c:10:29: error: 'h' undeclared (first use in this function)
   10 |                 scanf("%d",&h[i]);
      |                             ^
main.c:10:29: 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 =  1, count = 0;
  vector<int> H(N);
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> H.at(i);
  }
  vector<int> c(0);
  for (int i = 0;i < N; i++) {
    if (H.at(i) >= H.at(i + 1)) {
      count++;
    }
    else {
      c.push_back(count);
      count = 0;
    }
  }
  int s =  max(c.begin(), c.end());
  cout << s << endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:21:15: error: cannot convert 'const __gnu_cxx::__normal_iterator<int*, std::vector<int> >' to 'int' in initialization
   21 |   int s =  max(c.begin(), c.end());
      |            ~~~^~~~~~~~~~~~~~~~~~~~
      |               |
      |               const __gnu_cxx::__normal_iterator<int*, std::vector<int> >
Language: C++

#include <iostream>

using namespace std;

int main()
{
  long n,ma=0,s=0;
  long a[1000000000];
   cin>>n;
   for(int i=0;i<n;i++)
   {
      cin>>a[i];
   }
   m=a[0];
   for(int i=0;i<n;i++)
   {
       if(m>a[i])
       {
           m=a[i];
           s=0;
       }
       else
       {
         s++;
       }
       if(s>ma)
       {
          ma=s;
       }
   }
  cout<<ma;
   
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:4: error: 'm' was not declared in this scope
   14 |    m=a[0];
      |    ^
Language: C++

#include <iostream>

using namespace std;

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

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

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;



int main()
{
int n;
cin >> n;
  int a;
  
  int ans;
  vector<long> v;
  for(int i=0;i<n;i++){
   cin >>a;
    v.emplace_back(a);
  }
  reverse(v.begin(),v.end());
//	cout << v[0] <<endl;
  for(int i=0;i<n;i++){
  	if(v[i] <= v[i+1]){
    ans++;
    }else{
    break;
    }
  }
  cout << ans<<endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:30:21: error: expected '}' at end of input
   30 |   cout << ans<<endl;
      |                     ^
a.cc:10:1: note: to match this '{'
   10 | {
      | ^
Language: C++

#include <iostream>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:18:12: error: 'm' was not declared in this scope
   18 |            m=a[i];
      |            ^
a.cc:21:8: error: 'else' without a previous 'if'
   21 |        else
      |        ^~~~
Language: C++

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

int main(){
  int n;
  cin >> n;
  vector<int>x(n+5);
  for(int i = 0; i < n; i++){
    cin >> x.at(i);
  }
  int ans=0;
  int ansF=0;
  
  int i,j=0
  for(i=0; i<n; i++){
    j = i;
    while( x.at(j) < x.at(j+1) ){
        break;
    }
    ans++;
    j++;
    
    if(ansF<ans){
      ansF = ans;
    }
    ans = 0;
  }
  cout << ansF << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:3: error: expected ',' or ';' before 'for'
   18 |   for(i=0; i<n; i++){
      |   ^~~
a.cc:18:20: error: expected ';' before ')' token
   18 |   for(i=0; i<n; i++){
      |                    ^
      |                    ;
Language: C++

int main() {
  int i;
  long long n,a = 0,max;
  cin >> n;
  vector<long long> h(n),v;
  for(i = 0; i < n; i++) cin >> h.at(i); 
  for(int j = 0; j < n - 1; j++){
    if(h.at(j) >= h.at(j + 1)) {
      a++;
    }else{
      v.push_back(a);
      a = 0;
    }   
    v.push_back(a);
    }
  max = *max_element(v.begin(),v.end());
  cout << max << endl;
  } 

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope
    4 |   cin >> n;
      |   ^~~
a.cc:5:3: error: 'vector' was not declared in this scope
    5 |   vector<long long> h(n),v;
      |   ^~~~~~
a.cc:5:10: error: expected primary-expression before 'long'
    5 |   vector<long long> h(n),v;
      |          ^~~~
a.cc:6:33: error: 'h' was not declared in this scope
    6 |   for(i = 0; i < n; i++) cin >> h.at(i);
      |                                 ^
a.cc:8:8: error: 'h' was not declared in this scope
    8 |     if(h.at(j) >= h.at(j + 1)) {
      |        ^
a.cc:11:7: error: 'v' was not declared in this scope
   11 |       v.push_back(a);
      |       ^
a.cc:14:5: error: 'v' was not declared in this scope
   14 |     v.push_back(a);
      |     ^
a.cc:16:22: error: 'v' was not declared in this scope
   16 |   max = *max_element(v.begin(),v.end());
      |                      ^
a.cc:16:10: error: 'max_element' was not declared in this scope
   16 |   max = *max_element(v.begin(),v.end());
      |          ^~~~~~~~~~~
a.cc:17:3: error: 'cout' was not declared in this scope
   17 |   cout << max << endl;
      |   ^~~~
a.cc:17:18: error: 'endl' was not declared in this scope
   17 |   cout << max << endl;
      |                  ^~~~
Language: C++

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

void solve(){
cin>>n;
  ll arr[n];
  for(ll k=0;k<n;k++){
    cin>>arr[k];
  }
    ll lds[n]; 
    ll i, j, max = 0; 
  
    // Initialize LDS with 1 for all index 
    // The minimum LDS starting with any 
    // element is always 1 
    for (i = 0; i < n; i++) 
        lds[i] = 1; 
  
    // Compute LDS from every index 
    // in bottom up manner 
    for (i = 1; i < n; i++){ 
        for (j = 0; j < i; j++){
            if (arr[i]<arr[j] && lds[i] < lds[j] + 1) 
            {lds[i] = lds[j] + 1;}
          if (arr[i]==arr[j]) 
            {lds[i] = lds[i];}
        }}
  
    // Select the maximum  
    // of all the LDS values 
    for (i = 0; i < n; i++) 
        if (max < lds[i]) 
            max = lds[i]; 
  
    // returns the length of the LDS 
    cout<<max<<endl; 
}

int main(){
    solve();
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:6:6: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 | cin>>n;
      |      ^
      |      yn
a.cc:9:10: error: 'arr' was not declared in this scope
    9 |     cin>>arr[k];
      |          ^~~
a.cc:18:9: error: 'lds' was not declared in this scope
   18 |         lds[i] = 1;
      |         ^~~
a.cc:24:17: error: 'arr' was not declared in this scope
   24 |             if (arr[i]<arr[j] && lds[i] < lds[j] + 1)
      |                 ^~~
a.cc:24:34: error: 'lds' was not declared in this scope
   24 |             if (arr[i]<arr[j] && lds[i] < lds[j] + 1)
      |                                  ^~~
a.cc:26:15: error: 'arr' was not declared in this scope
   26 |           if (arr[i]==arr[j])
      |               ^~~
a.cc:27:14: error: 'lds' was not declared in this scope
   27 |             {lds[i] = lds[i];}
      |              ^~~
a.cc:33:19: error: 'lds' was not declared in this scope
   33 |         if (max < lds[i])
      |                   ^~~
Language: C

#include<stdio.h>
int main()
{int a[100000]=0,b[100000]=0,c=0,sum=0,i,j,n;
 long int H[100000];
 scanf("%d",&n);
 for(i=0;i<n;i++)
   scanf("%d",&H[i]);
for(i=0;i<n;i++)
{for(j=i;j<n;j++)
{if(H[j]>H[j+1])
a[i]++;}}
 for(i=0;i<n-1;i++)
 {if(a[i]>a[i+1])
   a[i+1]=a[i];}
 printf("%d",a[n]);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:3:16: error: invalid initializer
    3 | {int a[100000]=0,b[100000]=0,c=0,sum=0,i,j,n;
      |                ^
main.c:3:28: error: invalid initializer
    3 | {int a[100000]=0,b[100000]=0,c=0,sum=0,i,j,n;
      |                            ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <stack>
#include <istream>
#include <map>
#include <set>
#include <queue>
#define rep0(i,n) for (int i = 0; i <= (n); ++i)
#define rep1(i,n) for (int i = 1; i <= (n); ++i)
#define REP(a,b) for (int i = a; i <= (b); ++i) 
#define mREP(a,b) for (int i = a; i == (b); --i) 
typedef long long ll;
using namespace std;
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	/*
	　　　  　 ,ﾍ／L──- 、
	　　　   　Lﾆ)r_」=＝= ｲ
	　　 　,ﾍ、i ﾉノλﾉﾊﾉﾍ
	　　   ,'　｀(ﾊﾘ ﾟ ヮﾟﾉi)　',
	　　 .i　　 >〈(つ,i!と)　　i
	　　  vﾍγk´_/___i,ゝﾍノ
	　　　　　 ｀ﾞr_,ｨ_ｧﾞ´
	*/
	int n; cin >> n;
	vector<ll>a(n);
	vector<int>b(n - 1, 0);
	int count = 0;
	int ans = 0;
	ll now = 0;
	rep0(i, n - 1) {
		scanf_s("%lld", &a[i]);
	}

	rep0(k, n - 1) {
		if (now >= a[k]) {
			count++;
			now = a[k];
		}
		else {
			count = 0;
			now = a[k];

		}
		ans = max(ans, count);
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   39 |                 scanf_s("%lld", &a[i]);
      |                 ^~~~~~~
      |                 scanf
Language: C++

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

int main(){
    int N;
    cin >> N;
    vector<int> h(N);
    for (int i=0; i<N; i++){
        cin >> h.at(i);
    }

    int num = 0;
    int sub_num = 0;
    
    for (int i=0; i<N-1; i++){
        for (int j=0; j<N-i; j++){
            if (h[i+j] >= h[i+j+1]){
                num = num + 1;
            }
            else{
                num = max(num, sub_num);
                subnum = num;
                break;
            }
        }
    }

    cout << num << endl;
}

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

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

int main(){
    int N;
    cin >> N;
    vector<int> h(N);
    for (int i=0; i<N; i++){
        cin >> h.at(i);
    }

    int num = 0;
    int sub_num = 0;
    
    for (int i=0; i<N-1; i++){
        for (int j=0; j<N-i; j++){
            if (h[i+j] >= h[i+j+1]){
                num = num + 1
            }
            else{
                num = max(num, sub_num);
                subnum = num;
                break;
            }
        }
    }

    cout << num << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:30: error: expected ';' before '}' token
   18 |                 num = num + 1
      |                              ^
      |                              ;
   19 |             }
      |             ~                 
a.cc:22:17: error: 'subnum' was not declared in this scope; did you mean 'sub_num'?
   22 |                 subnum = num;
      |                 ^~~~~~
      |                 sub_num
Language: C++

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

int main(){
    int N;
    cin >> N;
    vector<int> h(N);
    for (int i=0; i<N; i++){
        cin >> h.at(i);
    }

    int num = 0;
    int sub_num = 0;
    
    for (int i=0; i<N-1; i++){
        for (int j=0; j<N-i){
            if (h[i+j] >= h[i+j+1]){
                num = num + 1
            }
            else{
                num = max(num, sub_num);
                subnum = num;
                break;
            }
        }
    }

    cout << num << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:28: error: expected ';' before ')' token
   16 |         for (int j=0; j<N-i){
      |                            ^
      |                            ;
a.cc:18:30: error: expected ';' before '}' token
   18 |                 num = num + 1
      |                              ^
      |                              ;
   19 |             }
      |             ~                 
a.cc:22:17: error: 'subnum' was not declared in this scope; did you mean 'sub_num'?
   22 |                 subnum = num;
      |                 ^~~~~~
      |                 sub_num
Language: C++

#include<bits/stdc++.h>
#include<vector>
#include<map>
using namespace std;
typedef long long ll;
int main()
{
  
  ll n;cin>>n;
  
  ll arr[n];
  for(int i=0;i<n;i++)
    cin>>arr[i];
  int  max=0;int cnt++;
  for(int i=0;i<n;i++)
  {
    if(arr[i+1]<=arr[i])
    {
      cnt++;max++;
    }
    else if(arr[i+1]>arr[i])
    {
      max=max-cnt;cnt=0;
    }
  }
  cout<<max<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:21: error: expected initializer before '++' token
   14 |   int  max=0;int cnt++;
      |                     ^~
a.cc:19:7: error: 'cnt' was not declared in this scope; did you mean 'int'?
   19 |       cnt++;max++;
      |       ^~~
      |       int
a.cc:23:15: error: 'cnt' was not declared in this scope; did you mean 'int'?
   23 |       max=max-cnt;cnt=0;
      |               ^~~
      |               int
Language: C++

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

int main(){
    int N;
    cin >> N;
    vector<int> h(N);
    for (int i=0; i<N; i++){
        cin >> h.at(i);
    }

    int num = 0;
    int sub_num = 0;
    
    for (int i=0; i<N-1; i++){
        for (int j=0; j<N){
            if (h[i+j] >= h[i+j+1]){
                num = num + 1
            }
            else{
                num = max(num, sub_num);
                subnum = num;
                break;
            }
        }
    }

    cout << num << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:26: error: expected ';' before ')' token
   16 |         for (int j=0; j<N){
      |                          ^
      |                          ;
a.cc:18:30: error: expected ';' before '}' token
   18 |                 num = num + 1
      |                              ^
      |                              ;
   19 |             }
      |             ~                 
a.cc:22:17: error: 'subnum' was not declared in this scope; did you mean 'sub_num'?
   22 |                 subnum = num;
      |                 ^~~~~~
      |                 sub_num
Language: C++

#include<bits/stdc++.h>
#include<vector>
#include<map>
using namespace std;
typedef long long ll;
int main()
{
  
  ll n;cin>>n;
  
  ll arr[n];
  for(int i=0;i<n;i++)
    cin>>arr[i];
  int  max=0;int cnt++;
  for(int i=0;i<n;i++)
  {
    if(arr[i+1]<=arr[i])
    {
      cnt++;max++;
    }
    else if(arr[i+]>arr[i])
    {
      max=max-cnt;cnt=0;
    }
  }
  cout<<max<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:21: error: expected initializer before '++' token
   14 |   int  max=0;int cnt++;
      |                     ^~
a.cc:19:7: error: 'cnt' was not declared in this scope; did you mean 'int'?
   19 |       cnt++;max++;
      |       ^~~
      |       int
a.cc:21:19: error: expected primary-expression before ']' token
   21 |     else if(arr[i+]>arr[i])
      |                   ^
a.cc:23:15: error: 'cnt' was not declared in this scope; did you mean 'int'?
   23 |       max=max-cnt;cnt=0;
      |               ^~~
      |               int
Language: C++

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



int main(void) {
	
	int n,sum=0;
	std::cin >> n;
	std::vector<int> a(n);
	for (int i = 0; i < n; i++) {
		std::cin >> a.at(i);
	}
	std::vector<int> count(n);
	for (int k = 0; k < n; k++) {
		for (int i = k; i < n; i++) {
			if (a.at(i) < a.at(i + 1)) break;
			count.at(k)=count.at(k)+1
		}

	}
	for (int i = 0; i < n; i++) {
		if (sum < count.at(i)) sum = count.at(i);
	}
	std::cout << sum << std::endl;
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:50: error: expected ';' before '}' token
   21 |                         count.at(k)=count.at(k)+1
      |                                                  ^
      |                                                  ;
   22 |                 }
      |                 ~
Language: C++

#include<iostream>
#include<unordered_set>
using namespace std;
typedef long long ll;
#include<algorithm>

int main(){
    ll n,i,j,x;
    cin>>n;
    ll a[n];
    vector<int> v;
    v.reserve(10000);
    for(i=0;i<n;i++) cin>>x,a[i]=x;
    
    for(i=0;i<n;i++){
        int count=0;
        if(a[i+1]<=a[i]){
            count++;
            for(j=i+1;j<n;j++){
                if(a[j+1]<=a[j]) count++;
                else break;
            }
            v.push_back(count);
        }
    }
    
    sort(v.begin(), v.end(),greater<int>());
    cout<<*v.begin();
    
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'vector' was not declared in this scope
   11 |     vector<int> v;
      |     ^~~~~~
a.cc:6:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    5 | #include<algorithm>
  +++ |+#include <vector>
    6 | 
a.cc:11:12: error: expected primary-expression before 'int'
   11 |     vector<int> v;
      |            ^~~
a.cc:12:5: error: 'v' was not declared in this scope
   12 |     v.reserve(10000);
      |     ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int n;
  cin>>n;
  int a[n];
  int i;
  for(i=0;i<n;i++)
  {
    cin>>a[i];
  }
  int square,count=0;
  cin>>square;
  i=square;
  int m=sqaure+1;
  while (a[square]<=a[m] && m<=n)
  {
    count++;
    ++m;
  }
  cout<<count;
}


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

#include <stdio.h>
int main(void)
{
  int N;
  scanf("%d", &N);
  int H[N];
  for(int i = 0; i++; i < N){
  scanf("%d", &H[i]);
  }
  for(int j = 0; j++; j < N){
    for(int k = 0; k++; k < N - j){
      if(H[j + k] >= H[j + k + 1]){
        int *tmp = 0;
        tmp++;
      }else{break;}
    }
    int n = 0;
    if(&tmp > n){n = tmp;}
  }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:18:9: error: 'tmp' undeclared (first use in this function)
   18 |     if(&tmp > n){n = tmp;}
      |         ^~~
main.c:18:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <stack>
#include <istream>
#include <map>
#include <set>
#include <queue>
#define rep0(i,n) for (int i = 0; i <= (n); ++i)
#define rep1(i,n) for (int i = 1; i <= (n); ++i)
#define REP(a,b) for (int i = a; i <= (b); ++i) 
#define mREP(a,b) for (int i = a; i == (b); --i) 
typedef long long ll;
using namespace std;
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	/*
	　　　  　 ,ﾍ／L──- 、
	　　　   　Lﾆ)r_」=＝= ｲ
	　　 　,ﾍ、i ﾉノλﾉﾊﾉﾍ
	　　   ,'　｀(ﾊﾘ ﾟ ヮﾟﾉi)　',
	　　 .i　　 >〈(つ,i!と)　　i
	　　  vﾍγk´_/___i,ゝﾍノ
	　　　　　 ｀ﾞr_,ｨ_ｧﾞ´
	*/
	int n; cin >> n;
	vector<ll>a(n);
	vector<int>b(n - 1,0);
	int count = 0;
	int ans = 0;
	ll now = 1e9;
	rep0(i, n - 1) {
		scanf_s("%lld", &a[i]);
	}
	
	rep0(k, n - 1) {
		if (now >= a[k]) {
			count++;
			now = a[k];
		}
		else {
			count = 0;
			now = a[k];
			
		}
		ans = max(ans, count);
	}
	cout << ans <<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   39 |                 scanf_s("%lld", &a[i]);
      |                 ^~~~~~~
      |                 scanf
Language: C++

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

using namespace std;
typedef long long ll;

int main() {
	int n;
	ll h[n+2];
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> h[i];
	}	
	int ans = 0;
	int flag = 0;
	int max = 0;
	for (int i = 0; i < n-1; i++){
		if(h[i] >= h[i+1]){ 
			flag++;
			cout << "" << endl;
			if(max < flag) {max = flag;}
		}
		else {
			if(max < flag) {max = flag;}
			flag = 0;
			cout << "" << endl
		}
	}
	cout << max << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:43: error: expected ';' before '}' token
   28 |                         cout << "" << endl
      |                                           ^
      |                                           ;
   29 |                 }
      |                 ~
Language: C

#include <stdio.h>
int main(void)
{
  int N;
  scanf("%d", &N);
  int H[N];
  for(int i = 0; i++; i < N){
  scanf("%d", &H[i]);
  }
  for(int j = 0; j++; j < N){
    for(int k = 0; k++; k < N - j){
      if(H[j + k] >= H[j + k + 1]){
        int tmp = 0;
        tmp++;
      }else{break;}
    }
    int n = 0;
    if(tmp > n){n = tmp;}
  }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:18:8: error: 'tmp' undeclared (first use in this function)
   18 |     if(tmp > n){n = tmp;}
      |        ^~~
main.c:18:8: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

using namespace std;
int LMax(int n){
    int b[num]={0};
    b[1]=1;
    int max=0；
    for(int i=2;i<=n;i++){
        int k=0;
        for(int j=1;j<i;j++){
            if(a[j]<=a[i]&&k<b[j]){
                k=b[j];
                b[i]=k+1;
            }
            if(max<b[i]){
                max=b[i];
            }
        }
    }
    return max;    
}
int main(void){
    int n;
    cin>>n;
    a=(int *)malloc(n*sizeof(int))
    for(int i=n;i>=0;i--){
        cin>>a[i];
    }
    cout<<LMax(n)<<endl;
}

Compiler output:
a.cc: In function 'int LMax(int)':
a.cc:6:11: error: 'num' was not declared in this scope; did you mean 'enum'?
    6 |     int b[num]={0};
      |           ^~~
      |           enum
a.cc:7:5: error: 'b' was not declared in this scope
    7 |     b[1]=1;
      |     ^
a.cc:8:13: error: unable to find numeric literal operator 'operator""\U0000ff1b'
    8 |     int max=0；
      |             ^~~
a.cc:9:17: error: 'i' was not declared in this scope
    9 |     for(int i=2;i<=n;i++){
      |                 ^
a.cc: In function 'int main()':
a.cc:26:5: error: 'a' was not declared in this scope
   26 |     a=(int *)malloc(n*sizeof(int))
      |     ^
a.cc:27:17: error: 'i' was not declared in this scope
   27 |     for(int i=n;i>=0;i--){
      |                 ^
Language: C++

#include<bits/stdc++.h>
#include<Cstdlib>
using namespace std;
int LMax(int n){
    int b[num]={0};
    b[1]=1;
    int max=0；
    for(int i=2;i<=n;i++){
        int k=0;
        for(int j=1;j<i;j++){
            if(a[j]<=a[i]&&k<b[j]){
                k=b[j];
                b[i]=k+1;
            }
            if(max<b[i]){
                max=b[i];
            }
        }
    }
    return max;    
}
int main(void){
    int n;
    cin>>n;
    a=(int *)malloc(n*sizeof(int))
    for(int i=n;i>=0;i--){
        cin>>a[i];
    }
    cout<<LMax(n)<<endl;
}

Compiler output:
a.cc:2:9: fatal error: Cstdlib: No such file or directory
    2 | #include<Cstdlib>
      |         ^~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>
int main(void)
{
  int N;
  scanf("%d", &N);
  int H[N];
  for(int i = 0; i++; i < N;){
  scanf("%d", &H[i]);
  }
  for(int j = 0; j++; j < N;){
    for(int k = 0; k++; k < N - j;){
      if(H[j + k] >= H[j + k + 1]){
        int tmp = 0;
        tmp++;
      }else{break;}
    }
    int n = 0;
    if(tmp > n;){n = tmp;}
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:28: error: expected ')' before ';' token
    7 |   for(int i = 0; i++; i < N;){
      |      ~                     ^
      |                            )
main.c:10:28: error: expected ')' before ';' token
   10 |   for(int j = 0; j++; j < N;){
      |      ~                     ^
      |                            )
main.c:11:34: error: expected ')' before ';' token
   11 |     for(int k = 0; k++; k < N - j;){
      |        ~                         ^
      |                                  )
main.c:18:8: error: 'tmp' undeclared (first use in this function)
   18 |     if(tmp > n;){n = tmp;}
      |        ^~~
main.c:18:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:18:15: error: expected ')' before ';' token
   18 |     if(tmp > n;){n = tmp;}
      |       ~       ^
      |               )
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = (ll)1e5;  
using  p = pair<int,int>;
int gcd(int a,int b){
	return b==0 ? a : gcd(b,a%b);
}

int main(){
   int n;
   cin >>n;
   auto ans = 0;
   for (int i = 1; i <= n/2; i++)
   {
      //int s = gcd(n,i);
       ans += n/s - i/s; 
   }

   auto used = vector<int>(n+1,0);
   for (int i = n; i >= n/2+1; i--)
   {
      ll _max = 0;
      int memo = -1;
      for (int j = n/2; j >=1; j--)
      {
         if(_max<i%j && used[j]==0){
            _max = (ll)i%j;
            memo = j;
         }
         if(memo!=-1) used[memo] = 1;
         ans+=_max;
      }
   }

   cout << ans;

}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 's' was not declared in this scope
   17 |        ans += n/s - i/s;
      |                 ^
Language: C++

#include <stdio.h>

int main()
{
  int N, H[100000];
  int max = 0;
  
  scanf("%d", &N);
  for(int i = 0; i < N; i++)
    scanf("%d", &H[i]);
  
  for(int i = 0; i < N-1; i++) {
    int cnt = 0;
    while(H[i] >= H[i+1]) {
      now++;
      cnt++;
      if(now >= N-1)
        break;
     if(max < cnt)
       max = cnt;
    }
  }
  printf("%d\n", max);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:7: error: 'now' was not declared in this scope
   15 |       now++;
      |       ^~~
Language: C

#include<stdio.h>
#include<string.h>
int main(){
  int n;
  scanf("%d", &n);
  
  char *str_h = (char *)malloc((2n-1)*sizeof(char));
  scanf("%s", str_h);
  
  int max = -1, cnt = 0;
  int cell_now, cell_next;
  char *ptr;
  
  ptr = strtok(str_h, " ");
  cell_now = atoi(ptr);
  
  while(ptr = strtok(NULL, " ")){
    cell_next = atoi(ptr);
    if(cell_next <= cell_now){
      cnt++;
    }else{
      if(cnt > cnt_max){
        cnt_max = cnt;
      }
      cnt = 0;
    }
    cell_now = cell_next;
  }
  
  if(cnt > cnt_max){
    cnt_max = cnt;
  }
  
  printf("%d", cnt_max);
}


Compiler output:
main.c: In function 'main':
main.c:7:25: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
    7 |   char *str_h = (char *)malloc((2n-1)*sizeof(char));
      |                         ^~~~~~
main.c:3:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    2 | #include<string.h>
  +++ |+#include <stdlib.h>
    3 | int main(){
main.c:7:25: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
    7 |   char *str_h = (char *)malloc((2n-1)*sizeof(char));
      |                         ^~~~~~
main.c:7:25: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:7:33: error: invalid suffix "n" on integer constant
    7 |   char *str_h = (char *)malloc((2n-1)*sizeof(char));
      |                                 ^~
main.c:15:14: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
   15 |   cell_now = atoi(ptr);
      |              ^~~~
main.c:22:16: error: 'cnt_max' undeclared (first use in this function)
   22 |       if(cnt > cnt_max){
      |                ^~~~~~~
main.c:22:16: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <stdio.h>

int main()
{
  int N, H[100000];
  int max = 0;
  
  scanf("%d", &N);
  for(int i = 0; i < N; i++)
    scanf("%d", &H[i]);
  
  for(int i = 0; i < N-1; i++) {
    int cnt = 0;
    while(H[i] >= H[i+1]) {
      now++;
      cnt++;
      if(now >= N-1)
        break;
     if(max < cnt)
       max = cnt;
printf("%d\n", max);

Compiler output:
a.cc: In function 'int main()':
a.cc:15:7: error: 'now' was not declared in this scope
   15 |       now++;
      |       ^~~
a.cc:21:21: error: expected '}' at end of input
   21 | printf("%d\n", max);
      |                     ^
a.cc:14:27: note: to match this '{'
   14 |     while(H[i] >= H[i+1]) {
      |                           ^
a.cc:21:21: error: expected '}' at end of input
   21 | printf("%d\n", max);
      |                     ^
a.cc:12:32: note: to match this '{'
   12 |   for(int i = 0; i < N-1; i++) {
      |                                ^
a.cc:21:21: error: expected '}' at end of input
   21 | printf("%d\n", max);
      |                     ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C

#include<stdio.h>
#include<string.h>
int main(){
  int n;
  scanf("%d", &n);
  
  char *str_h = (char *)malloc((2n-1)*sizeof(char));
  scanf("%d", str_h);
  
  int max = -1, cnt = 0;
  int cell_now, cell_next;
  char *ptr;
  
  ptr = strtok(str_h, " ");
  cell_now = atoi(ptr);
  
  while(ptr = strtok(NULL, " ")){
    cell_next = atoi(ptr);
    if(cell_next <= cell_now){
      cnt++;
    }else{
      if(cnt > cnt_max){
        cnt_max = cnt;
      }
      cnt = 0;
    }
    cell_now = cell_next;
  }
  
  if(cnt > cnt_max){
    cnt_max = cnt;
  }
  
  printf("%d", cnt_max);
}

Compiler output:
main.c: In function 'main':
main.c:7:25: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
    7 |   char *str_h = (char *)malloc((2n-1)*sizeof(char));
      |                         ^~~~~~
main.c:3:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    2 | #include<string.h>
  +++ |+#include <stdlib.h>
    3 | int main(){
main.c:7:25: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
    7 |   char *str_h = (char *)malloc((2n-1)*sizeof(char));
      |                         ^~~~~~
main.c:7:25: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:7:33: error: invalid suffix "n" on integer constant
    7 |   char *str_h = (char *)malloc((2n-1)*sizeof(char));
      |                                 ^~
main.c:15:14: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
   15 |   cell_now = atoi(ptr);
      |              ^~~~
main.c:22:16: error: 'cnt_max' undeclared (first use in this function)
   22 |       if(cnt > cnt_max){
      |                ^~~~~~~
main.c:22:16: note: each undeclared identifier is reported only once for each function it appears in