criyle/codenet-compile-errors huggingface dataset:
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 ans=1;
  int Max=H.at(0);
  for(int i=1;i<N;i++){
  if(Max<=H.at(i)){
  Max=H.at(i);
    sum++;
  }
  
  }cout<<sum<<endl;
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: 'sum' was not declared in this scope
   14 |     sum++;
      |     ^~~
a.cc:17:10: error: 'sum' was not declared in this scope
   17 |   }cout<<sum<<endl;
      |          ^~~
Language: C

#include <stdio.h>
int main(void)
{
  int a=0;
  int b=0;
  int c=0;
  int e=0;
  int f=0;
  scanf("%d",&a);
  int d[a];
  for(b=0;b<a;b++){
    scanf("%d",&d[b]);
  }
  f=d[0];
  for(c=1;c<a;c++){
    if(f==d[c]){
      e++;
    }else
    if(f<d[c]){
      f=d[c]
      e++;
    }
  }
  printf("%d\n",e);
}


Compiler output:
main.c: In function 'main':
main.c:20:13: error: expected ';' before 'e'
   20 |       f=d[c]
      |             ^
      |             ;
   21 |       e++;
      |       ~
Language: C

#include<stdio.h>
int main (){
    int n,i,j,k,a[20];
    char c=0;
    scanf("%d%c",&n,&c);
    for(i=0;i==n;i++){
        scanf("%d%c",&a[i],&c);
    }
    k=i-1
    while(i-1){
        for(j=0;j==i;++j){
            if(a[j]>a[i-1]){
                k-=1;
                break;
            }

        }
        i--;
    }
    printf("%d",k);
    return 0;
    
}

Compiler output:
main.c: In function 'main':
main.c:9:10: error: expected ';' before 'while'
    9 |     k=i-1
      |          ^
      |          ;
   10 |     while(i-1){
      |     ~~~~~
Language: C

#include<stdio.h>
int main (){
    int n,i,j,k,a[20];
    char c=0;
    scanf("%d%c",n,c);
    for(i=0;i==n;i++){
        scanf("%d%c",a[i],c);
    }
    k=i-1
    while(i-1){
        for(j=0;j==i;++j){
            if(a[j]>a[i-1]){
                k-=1;
                break;
            }

        }
        i--;
    }
    printf("%d",k);
    return 0;
    
}

Compiler output:
main.c: In function 'main':
main.c:9:10: error: expected ';' before 'while'
    9 |     k=i-1
      |          ^
      |          ;
   10 |     while(i-1){
      |     ~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
int N;
  cin >>N;
  
     vector<int> A(N);
   for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  int count=0;
  
  for (int i = 0; i < N; i++) {
 for (int j = 0; j < i; j++) {
 
if(A[i]>=A[j]){
  count++;
}

}



}

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

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

int main() {
  int n;
  cin >> n;
  vector<int>n(h);
  rep(i,n) cin>>h.at(i);
  int count=0;
  int ma = h.at(0);
  rep(i,n){
    if(ma>=h.at(i)) count++;
    ma = max(ma,h.at(i));
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: conflicting declaration 'std::vector<int> n'
    9 |   vector<int>n(h);
      |              ^
a.cc:7:7: note: previous declaration as 'int n'
    7 |   int n;
      |       ^
a.cc:9:16: error: 'h' was not declared in this scope
    9 |   vector<int>n(h);
      |                ^
Language: C

#include<stdio.h>
int main(void){
  int n;
  scanf("%d",&n);
  int a[n],ians=1;
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
  }
  for(i=1;i<n;i++){
    if(a[0]<=a[i]) ans++;
  }
  printf("%d",ans);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:7: error: 'i' undeclared (first use in this function)
    6 |   for(i=0;i<n;i++){
      |       ^
main.c:6:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:20: error: 'ans' undeclared (first use in this function); did you mean 'ians'?
   10 |     if(a[0]<=a[i]) ans++;
      |                    ^~~
      |                    ians
Language: C++

N=int(input())
H=list(map(int,input().split()))
high=H[0]
count=1
for i in range(1,N):
    if high<=H[i]:
        count=count+1
        high=H[i]
    else:
        pass
print(count)


Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N=int(input())
      | ^
Language: Java

import java.util.*;

/*
問題文
東西に N 個の山が連なっており、西の果てには広大な海が広がっています。
各山頂には旅館があり、あなたは海を眺められる旅館を選ぶことにしました。

西から i 番目の山の高さは Hi です。
西から 1 番目の山頂にある旅館からは必ず海を眺めることができます。

西から i (i=2,3,...,N) 番目の山頂にある旅館については、
H1≤Hi,H2≤Hi,..., かつ Hi−1≤Hi のとき、その旅館から海を眺めることができます。

これら N 個の旅館のうち、海を眺められる旅館はいくつあるでしょうか。

制約
入力は全て整数である。
1≤N≤20
1≤Hi≤100
*/

public class Main {
    public static void main(String[] args){

        Scanner s = new Scanner(System.in);
        int a = s.nextInt();
        int mounts[] = new int[a];

        int max = 0;
        int count;
        for (int i = 0; i < a; i++) {
          mounts[i] = s.nextInt();
          if (mounts[i] >= max) {
            max = mounts[i];
            count++;
          }
        }
        
        System.out.println(count);
    }
}

Compiler output:
Main.java:35: error: variable count might not have been initialized
            count++;
            ^
Main.java:39: error: variable count might not have been initialized
        System.out.println(count);
                           ^
2 errors
Language: C++

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

int main(){
  int N,cnt=1;
  cin >> N;
  vector<int> H(N);
  loop(i,N)
    cin >> H.at(i);
  int highest = H.at(0);
  for(int i=1;i<N;++i){
    if(H.at(i)>=highest){
      ++cnt;
      highest = h.at(i);
    }
  }
  cout << cnt;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'h' was not declared in this scope
   15 |       highest = h.at(i);
      |                 ^
Language: C++

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

int main(){
  int N,cnt=1;
  cin >> N;
  vector<int> H(N);
  loop(i,N)
    cin >> H.at(i);
  int highest = H.at(0);
  for(int i=1;i<N;++i){
    if(h.at(i)>=highest){
      ++cnt;
      highest = h.at(i);
    }
  }
  cout << cnt;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:8: error: 'h' was not declared in this scope
   13 |     if(h.at(i)>=highest){
      |        ^
Language: C++

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

int main(){
  int N,cnt=1;
  cin >> N;
  vector<int> H(N);
  loop(i,N)
    cin >> H.at(i);
  int highest = H.at(0);
  for(i=1;i<N;++i){
    if(h.at(i)>=higest){
      ++cnt;
      highest = h.at(i);
    }
  }
  cout << cnt;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: 'i' was not declared in this scope
   12 |   for(i=1;i<N;++i){
      |       ^
a.cc:13:8: error: 'h' was not declared in this scope
   13 |     if(h.at(i)>=higest){
      |        ^
a.cc:13:17: error: 'higest' was not declared in this scope; did you mean 'highest'?
   13 |     if(h.at(i)>=higest){
      |                 ^~~~~~
      |                 highest
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i = 0; i < (N); i++)
int main() {
  int N;
  vector <int> H(N);
  for(int i = 0; i < N; i++){
    cin >> H.at(i);
  }
  int ans=0;
    rep(i,N){
        bool a = true;
        for(int j=0; j<i; j++){
            if(h.at(i)<h.at(j)){
              a = false;
            }
        }
        if(a){
          ans++;
        }
    }
    cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: 'h' was not declared in this scope
   14 |             if(h.at(i)<h.at(j)){
      |                ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  ll n, a, b;
  b = 0;
  a = 0;
  in(n);
  vector<ll> c(n);
  rep(i, n)
    in(c[i]);
    if(a <= c[i]){
      a = c[i];
      b++;
    }
  out(b);
  memi;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:15: error: 'i' was not declared in this scope
   25 |     if(a <= c[i]){
      |               ^
Language: C++

//#define _GLIBCXX_DEBUG

#include<bits/stdc++.h>
using namespace std;
const int INF= 1e9+5;
typedef long long ll;

int main(){
  int n;
  cin>>n;
  vector<int>v(n);
  int count=1;
  for(int i=0;i<n;i++)cin>>v[i];
  for(int i=1;i<n;i++){
    for(int j=0;j<i;j++){
      bool b=true;
      if(v[j]>v[i])b=false;
     
    }
     if(b)count++;
  }
  cout<<count<<endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'b' was not declared in this scope
   20 |      if(b)count++;
      |         ^
Language: C++

N=int(input())
H=list(map(int,input().split()))

X=1
for i in range(1,N):
    if max(H[:i])<=H[i]:
        X+=1

print(X)

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N=int(input())
      | ^
Language: C++

using System;
using System.Linq;
using System.Collections.Generic;

static class Program{
    static void Main() {
        Console.ReadLine();
        int[]a=Console.ReadLine().Split().Select(int.Parse).ToArray();
        int now=0,ans=0;
        foreach(int x in a){
            if(now<=x){
                ans++;
                now=x;
            }
        }
        Console.WriteLine(ans);
    }
}


Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Linq;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:18:2: error: expected ';' after class definition
   18 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Program::Main()':
a.cc:7:9: error: 'Console' was not declared in this scope
    7 |         Console.ReadLine();
      |         ^~~~~~~
a.cc:8:12: error: structured binding declaration cannot have type 'int'
    8 |         int[]a=Console.ReadLine().Split().Select(int.Parse).ToArray();
      |            ^~
a.cc:8:12: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:8:12: error: empty structured binding declaration
a.cc:8:14: error: expected initializer before 'a'
    8 |         int[]a=Console.ReadLine().Split().Select(int.Parse).ToArray();
      |              ^
a.cc:10:17: error: expected primary-expression before 'int'
   10 |         foreach(int x in a){
      |                 ^~~
a.cc:10:9: error: 'foreach' was not declared in this scope
   10 |         foreach(int x in a){
      |         ^~~~~~~
a.cc: At global scope:
a.cc:5:1: error: a storage class can only be specified for objects and functions
    5 | static class Program{
      | ^~~~~~
Language: C

#include <stdio.h>
int main(void){
int n;
  int max=0;
  int ans=0;
  int h[200];
  scanf("%d",&n);
  for(int i=1;i<=n;i++){
  scanf("%d",&h[count]);
  }
    for(int i=1;i<=n;i++){
  if(max<=h[count]){ans++;max=h[count];}
  }
  printf("%d",ans);
return 0;}

Compiler output:
main.c: In function 'main':
main.c:9:17: error: 'count' undeclared (first use in this function)
    9 |   scanf("%d",&h[count]);
      |                 ^~~~~
main.c:9:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

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

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
 int wari(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }
 int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
 int souwa(int a){
  return a*(a+1)/2;
 }
 int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
signed main(){
  int n;
  cin>>n;
  vector<int> h(n);
  for(int i=0; i<n; i+++)
    cin>>h[i];
  int cn=1;
  int max=h[0];
  for(int i=1; i<n; i++){
    if(max<=h[i])
      cn++;
    max=(max,h[i]);
  }
  cout<<cn<<endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:61:25: error: expected primary-expression before ')' token
   61 |   for(int i=0; i<n; i+++)
      |                         ^
Language: C++

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

int main()
{
  int N;
  int H[101];
  int res=1;
  cin >> N;

  rep(i,N) cin >> H[i];

  for(int i=1; i<N; i++) {
    bool oceanview=true;
    for(int j=0; j<i; j++){
      if(H[i]<H[j]) oceanview=false;
    }
    if(oceanview) res++;
  }

  cout << res << endl;
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:11:3: error: 'cin' was not declared in this scope
   11 |   cin >> N;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | include <bits/stdc++.h>
a.cc:23:3: error: 'cout' was not declared in this scope
   23 |   cout << res << endl;
      |   ^~~~
a.cc:23:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:18: error: 'endl' was not declared in this scope
   23 |   cout << res << endl;
      |                  ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | include <bits/stdc++.h>
Language: C++

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

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

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

int main()
{
 int n;
  cin>>n;
  vector<int> v(n);
  for(int &i:v) cin>>i;
  int ans=1;
  for(int i=1;i<n;i++)
  {
    bool flag=true;
    for(int j=0;j<i;j++)
      if(v[j]>v[i])
        flag=false;
    if(flag)
      ans++;
  }
  cout<ans<<"\n";
  
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:11: error: invalid operands of types 'int' and 'const char [2]' to binary 'operator<<'
   20 |   cout<ans<<"\n";
      |        ~~~^~~~~~
      |        |    |
      |        int  const char [2]
Language: C++

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

int main(){
    int n,sum=1;
    bool a;
    cin >> n;
    vector<int> h(n);
    cin >> v.at(0);
    for(int i=1;i<n;i++){
        a=true;
        cin >>v.at(i);
        for(int l=0;l<i;l++){
            if(h.at(i)>h.at(l)){
                a=false;
                break;
            }
        }
        if(a){
            sum++;
        }
    }
    cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: 'v' was not declared in this scope
    9 |     cin >> v.at(0);
      |            ^
Language: C++

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

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

    vector <int> a(n);
    for (int i = 0; i < n; i ++) {
        cin >> a.at(i);
    }

    vector <int> m(n);
    for(int i = 0 ; i < n; i++) {

        if(i == 0) {
            m.at(0) = a.at(0);
        } else {
            m.at(i) = max(m.at(i - 1),a.at(i));
        }


    }

    int ans = 0;

    for (int i = 0; i < n; i ++) {
        if(i == 0){
            ans++;
        } else {
if(a.at(i)>=m.at()){
    ans ++;
}
        }
        
    }


}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:17: error: no matching function for call to 'std::vector<int>::at()'
   31 | if(a.at(i)>=m.at()){
      |             ~~~~^~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1180:7: note: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::at(size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]'
 1180 |       at(size_type __n)
      |       ^~
/usr/include/c++/14/bits/stl_vector.h:1180:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_vector.h:1199:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::at(size_type) const [with _Tp = int; _Alloc = std::allocator<int>; const_reference = const int&; size_type = long unsigned int]'
 1199 |       at(size_type __n) const
      |       ^~
/usr/include/c++/14/bits/stl_vector.h:1199:7: note:   candidate expects 1 argument, 0 provided
Language: C++

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

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

    vetcor <int> a(n);
    for (int i = 0; i < n; i ++) {
        cin >> a.at(i);
    }

    vector <int> m(n);
    for(int i = 0 ; i < n; i++) {

        if(i == 0) {
            m.at(0) = a.at(0);
        } else {
            m.at(i) = max(m.at(i - 1),a.at(i));
        }


    }

    int ans = 0;

    for (int i = 0; i < n; i ++) {
        if(i == 0){
            ans++;
        } else {
if(a.at(i)>=m.at()){
    ans ++;
}
        }
        
    }


}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'vetcor' was not declared in this scope
    8 |     vetcor <int> a(n);
      |     ^~~~~~
a.cc:8:13: error: expected primary-expression before 'int'
    8 |     vetcor <int> a(n);
      |             ^~~
a.cc:10:16: error: 'a' was not declared in this scope
   10 |         cin >> a.at(i);
      |                ^
a.cc:17:23: error: 'a' was not declared in this scope
   17 |             m.at(0) = a.at(0);
      |                       ^
a.cc:19:39: error: 'a' was not declared in this scope
   19 |             m.at(i) = max(m.at(i - 1),a.at(i));
      |                                       ^
a.cc:31:4: error: 'a' was not declared in this scope
   31 | if(a.at(i)>=m.at()){
      |    ^
a.cc:31:17: error: no matching function for call to 'std::vector<int>::at()'
   31 | if(a.at(i)>=m.at()){
      |             ~~~~^~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1180:7: note: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::at(size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]'
 1180 |       at(size_type __n)
      |       ^~
/usr/include/c++/14/bits/stl_vector.h:1180:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_vector.h:1199:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::at(size_type) const [with _Tp = int; _Alloc = std::allocator<int>; const_reference = const int&; size_type = long unsigned int]'
 1199 |       at(size_type __n) const
      |       ^~
/usr/include/c++/14/bits/stl_vector.h:1199:7: note:   candidate expects 1 argument, 0 provided
Language: C++

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

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

    vecor <int> a(n);
    for (int i = 0; i < n; i ++) {
        cin >> a.at(i);
    }

    vecor <int> m(n);
    for(int i = 0 ; i < n; i++) {

        if(i == 0) {
            m.at(0) = a.at(0);
        } else {
            m.at(i) = max(m.at(i - 1),a.at(i));
        }


    }

    int ans = 0;

    for (int i = 0; i < n; i ++) {
        if(i == 0){
            ans++;
        } else {
if(a.at(i)>=m.at()){
    ans ++;
}
        }
        
    }


}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'vecor' was not declared in this scope
    9 |     vecor <int> a(n);
      |     ^~~~~
a.cc:9:12: error: expected primary-expression before 'int'
    9 |     vecor <int> a(n);
      |            ^~~
a.cc:11:16: error: 'a' was not declared in this scope
   11 |         cin >> a.at(i);
      |                ^
a.cc:14:12: error: expected primary-expression before 'int'
   14 |     vecor <int> m(n);
      |            ^~~
a.cc:18:13: error: 'm' was not declared in this scope
   18 |             m.at(0) = a.at(0);
      |             ^
a.cc:18:23: error: 'a' was not declared in this scope
   18 |             m.at(0) = a.at(0);
      |                       ^
a.cc:20:13: error: 'm' was not declared in this scope
   20 |             m.at(i) = max(m.at(i - 1),a.at(i));
      |             ^
a.cc:20:39: error: 'a' was not declared in this scope
   20 |             m.at(i) = max(m.at(i - 1),a.at(i));
      |                                       ^
a.cc:32:4: error: 'a' was not declared in this scope
   32 | if(a.at(i)>=m.at()){
      |    ^
a.cc:32:13: error: 'm' was not declared in this scope
   32 | if(a.at(i)>=m.at()){
      |             ^
Language: C++

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

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

    vecor <int> a(n);
    for (int i = 0; i < n; i ++) {
        cin >> a.at(i);
    }

    vecor <int> m(n);
    for(int i = 0 ; i < n; i++) {

        if(i == 0) {
            m.at(0) = a.at(0);
        } else {
            m.at(i) = max(m.at(i - 1),a.at(i));
        }


    }

    int ans = 0;

    for (int i = 0; i < n; i ++) {
        if(i == 0){
            ans++;
        } else {
if(a.at(i)>=m.at()){
    ans ++;
}
        }
        
    }


}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'vecor' was not declared in this scope
    8 |     vecor <int> a(n);
      |     ^~~~~
a.cc:8:12: error: expected primary-expression before 'int'
    8 |     vecor <int> a(n);
      |            ^~~
a.cc:10:16: error: 'a' was not declared in this scope
   10 |         cin >> a.at(i);
      |                ^
a.cc:13:12: error: expected primary-expression before 'int'
   13 |     vecor <int> m(n);
      |            ^~~
a.cc:17:13: error: 'm' was not declared in this scope
   17 |             m.at(0) = a.at(0);
      |             ^
a.cc:17:23: error: 'a' was not declared in this scope
   17 |             m.at(0) = a.at(0);
      |                       ^
a.cc:19:13: error: 'm' was not declared in this scope
   19 |             m.at(i) = max(m.at(i - 1),a.at(i));
      |             ^
a.cc:19:39: error: 'a' was not declared in this scope
   19 |             m.at(i) = max(m.at(i - 1),a.at(i));
      |                                       ^
a.cc:31:4: error: 'a' was not declared in this scope
   31 | if(a.at(i)>=m.at()){
      |    ^
a.cc:31:13: error: 'm' was not declared in this scope
   31 | if(a.at(i)>=m.at()){
      |             ^
Language: C++

# include < bits / stdc ++. h >
using namespace std ;
int main () {
// input
int N; cin >> N ;
vector <int > H ( N );
for ( int i = 0; i < N ; ++ i ) {
cin >> H [ i ];
}
// compute
int ans = 0;
for ( int i = 0; i < N ; ++ i ) {
bool is_candidate = true ;
for ( int j = 0; j < i ; ++ j ) {
if ( H [ j ] > H [ i ]) {
is_candidate = false ;
break ;
}
}
if ( is_candidate ) {
++ ans ;
}
}
// output
cout << ans << endl ;
}

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

#include<stdio.h>

main(){
  int str[20],num,max,cnt=1,i;
  scanf("%d,%d",&num,&str[0]);
  max = str[0];
  for(i=1;i<num;i++){
    scanf("%d",&str[i]);
    if(str[i]>=max){
      max = str[i];
      cnt++;
    }
  }
  
  printf("%d",cnt);


Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:15:20: error: expected '}' at end of input
   15 |   printf("%d",cnt);
      |                    ^
a.cc:3:7: note: to match this '{'
    3 | main(){
      |       ^
Language: C++

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

int main(){
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0;i < N; i++) cin >> a.at(i);
  int count = 1;
  for (int i = 1; i < (N - 1); i++){
    if (a.at(i) < a.at(i + 1)) count++;
  }
  cout << count << endl;
}

Compiler output:
a.cc:2:1: error: 'usng' does not name a type
    2 | usng namespace std;
      | ^~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> N;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> a(N);
      |   ^~~~~~
a.cc:7:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> a(N);
      |          ^~~
a.cc:8:37: error: 'a' was not declared in this scope
    8 |   for (int i = 0;i < N; i++) cin >> a.at(i);
      |                                     ^
a.cc:11:9: error: 'a' was not declared in this scope
   11 |     if (a.at(i) < a.at(i + 1)) count++;
      |         ^
a.cc:13:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |   cout << count << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:13:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   13 |   cout << count << endl;
      |                    ^~~~
      |                    std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
using namespace std;
int main(){
     int N;
     cin>>N;
     int maxv=0;
     int sum=0;
     for(int i=0;i<N;i++){
         int H;
         cin>>H;
         if(i==0){
             maxv=H;
             sum++;
         }
         if(maxv<=H){
             if(maxv==H){
                 sum++;
             }
             else if(maxv<H){
                 sum++;
                 maxv=H;
             }
         
     }
     cout<<sum<<endl;
}

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

#include<stdio.h>
#include<cmath>
#include<algorithm>
int main(void)
{
	int N,S[110],A=1,k=0;
	scanf("%d", &N);
	for (int i = 0; i < N; i++)
	{
		scanf("%d", &S[i]);
	}
	for (int i = 0; i < N - 1; i++)
	{
		
		{
			if ( S[i]>=k)			
			{
				A++;
			}
			if (i>=2&&S[i-1] < S[i])
			{
				k = S[i];
		
		}

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

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

#include<iostream>
#include<vector>

using namespace std

int main(){
	int N,ans(0),M;
  	cin >> N;
  	vector<int> h(N);
  	for(int i = 0 ; i < N ; i ++){
      	cin >> h[i];
      	if(h[i] >= M){
        	M = h[i];
          	ans ++;
        }
    }
  	cout << ans << endl;
}

Compiler output:
a.cc:4:20: error: expected ';' before 'int'
    4 | using namespace std
      |                    ^
      |                    ;
    5 | 
    6 | int main(){
      | ~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
int main (){

   int N;
cin>>N;
int H[N];
for(int i=0;i<N;i++)
    cin>>H[i];
int cnt=0;
int r =H[0];
for(int i=1;i<=N;i++){
    if(r<=H[i+1]){
    cnt++;
    r=H[i+1];
    }
}
cout<<cnt;
return 0;

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

#include <bits/stdc++.h>
using namespace std;
int main() {

int a,b[30],c;
   cin >> a;

for (int i = 0; i < a; ++i) 
cin >> b[i];

int c = 0;
for (int i = 0; i < a; ++i) {
bool abc = true;
for (int j = 0; j < i; ++j) {
if (b[j] > b[i]) {
 abc = false;
break;
}
}
if (abc) {
++c;
}
}

cout << c << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: redeclaration of 'int c'
   11 | int c = 0;
      |     ^
a.cc:5:13: note: 'int c' previously declared here
    5 | int a,b[30],c;
      |             ^
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[i];

  int res = 0;
  int current_max = 0;
  for (int = 0; i < N; i++) {
    
    if (H[i] >= current_max) res++;

    if (current_max < H[i]) current_max = H[i];
  }
cout << res << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: expected unqualified-id before '=' token
   10 |   for (int = 0; i < N; i++) {
      |            ^
a.cc:10:11: error: expected ';' before '=' token
   10 |   for (int = 0; i < N; i++) {
      |           ^~
      |           ;
a.cc:10:12: error: expected primary-expression before '=' token
   10 |   for (int = 0; i < N; i++) {
      |            ^
a.cc:10:17: error: 'i' was not declared in this scope
   10 |   for (int = 0; i < N; i++) {
      |                 ^
a.cc:10:22: error: expected ')' before ';' token
   10 |   for (int = 0; i < N; i++) {
      |       ~              ^
      |                      )
a.cc:10:24: error: 'i' was not declared in this scope
   10 |   for (int = 0; i < N; i++) {
      |                        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()  {
  int N;
  cin >> N;
  vector<int> a(N);
  int ans = 0;
  for (int i = 0; i < N; i++) cin >> a[i];
  for (int i = 0; i < N; i++)  {
    bool is_candidate = true
    for (int j = 0; j < i; j++)  {
      if (a[j]>=a[i])  {
      is_candidate = false;
      break;
    }
  }
  if(is_candidate) ++ans;
}
cout << ans <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: expected ',' or ';' before 'for'
   11 |     for (int j = 0; j < i; j++)  {
      |     ^~~
a.cc:11:21: error: 'j' was not declared in this scope
   11 |     for (int j = 0; j < i; j++)  {
      |                     ^
Language: C++

#include <stdio.h>
using namespace std;

int main() {
	int n;
	scanf("%d",&n);
	int count = 0;
	int max = 0;
	for (int i = 0; i < n; i++) {
		int h;
		scanf("%d",&h);
		if (h >= max) {
			max = h[i];
			count++;
		}
	}
	
	printf("%d",count);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:32: error: invalid types 'int[int]' for array subscript
   13 |                         max = h[i];
      |                                ^
Language: C++

#include <stdio.h>
using namespace std;

int main() {
	int n;
	scanf("%d",&n);
	int count = 0;
	int max = 0;
	for (int i = 0; i < n; i++) {
		if (h[i] >= max) {
			max = h[i];
			count++;
		}
	}
	
	printf("%d",count);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:21: error: 'h' was not declared in this scope
   10 |                 if (h[i] >= max) {
      |                     ^
Language: C++

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

int main() {
  
  int N;
  cin >> N;
  
  vector<int> S(4);
  int num = 1;

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

  for(int i = 0;i < N;++i){
    for(int k = 0;k < N;++k){
      if(S[i] > S[i + num2]){
        continue;
      }
      num2++;
    }
    num++;
  }
        
      
  


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

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

int main() {
  
  int N;
  cin >> N;
  
  vector<int> S(4);
  int num = 1;

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

  for(int i = 0;i < N;++i){
    for(int k = 0;k < N;++K){
      if(S[i] > S[i + num2]){
        continue;
      }
      num2++;
    }
    num++;
  }
        
      
  

Compiler output:
a.cc: In function 'int main()':
a.cc:19:27: error: 'K' was not declared in this scope
   19 |     for(int k = 0;k < N;++K){
      |                           ^
a.cc:26:4: error: expected '}' at end of input
   26 |   }
      |    ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int main() {
	// your code goes here
	int n,i,c[30],max,ans=1;
	cin >> n;
	for(i=1;i<=n;i++){
		cin >> c[i];
		if(i==1){
			max=a[i];
		} else {
			if(max<=a[i]){
				ans++;
				max=a[i];
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:29: error: 'a' was not declared in this scope
   11 |                         max=a[i];
      |                             ^
a.cc:13:33: error: 'a' was not declared in this scope
   13 |                         if(max<=a[i]){
      |                                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define LLMAX (1ll << 60) - 1
#define llMAX (1 << 30) - 1
#define MOD 1000000007 
#define NMAX 1000*100+1
#define MSET(x,y) memset(x,y,sizeof(x))
#define gcd(a,b) __gcd(a,b)
#define all(x)  x.begin(),x.end()
#define vi vector<ll>
#define prll(x)    for(auto it=x.begin();it!=x.end();it++) cout<<*it<<' '; cout<<endl;
#define in(x,n)   for(ll e=0;e<n;e++){ll y;cin>>y;x.pb(y);}
#define vl vector<long long>
#define ii pair<ll,ll>
#define pll pair<ll,ll>
#define vii vector<ii>
#define F first
#define S second
#define mp make_pair


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll a,n;
    ll a[30];
    cin>>n;
    for(int i=0;i<n;i++){
    	cin>>a[i];
	}
	ll m=-1,ans=0;
	for(int i=0;i<n;i++){
    	if(a[i]<=m])
    	ans++;
    	m=max(m,a[i]);
	}
	cout<<ans;
    return 0;
}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:29:8: error: conflicting declaration 'long long int a [30]'
   29 |     ll a[30];
      |        ^
a.cc:28:8: note: previous declaration as 'long long int a'
   28 |     ll a,n;
      |        ^
a.cc:32:15: error: invalid types 'long long int[int]' for array subscript
   32 |         cin>>a[i];
      |               ^
a.cc:36:13: error: invalid types 'long long int[int]' for array subscript
   36 |         if(a[i]<=m])
      |             ^
a.cc:36:19: error: expected ')' before ']' token
   36 |         if(a[i]<=m])
      |           ~       ^
      |                   )
a.cc:36:19: error: expected primary-expression before ']' token
a.cc:38:18: error: invalid types 'long long int[int]' for array subscript
   38 |         m=max(m,a[i]);
      |                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for( int i = 0 ; i < n ; i++ )
 
int main() {
  
  int N  ;
  cin >> N ;
  int max = 0 ;
  int ans = 0 ; 
  vector<int> A(N) ; 
  rep(i,N) cin >> A.at(i);
  rep(i,N){
    if( max =< A.at(i) ) {
    ans++;
    max = A.at(i) ;  
    }
  cout << ans << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:14: error: expected primary-expression before '<' token
   14 |     if( max =< A.at(i) ) {
      |              ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for( int i = 0 ; i < n ; i++ )
 
int main() {
  
  int N  ;
  cin >> N ;
  int max = 0 ;
  int ans = 0 ; 
  vector<int> A(N) ; 
  rep(i,N) cin >> A.at(i);
  rep(i,N){
    if( max =< A.at(i) ) {
    ans++;
    max = A.at(i) ;  
    }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:14: error: expected primary-expression before '<' token
   14 |     if( max =< A.at(i) ) {
      |              ^
a.cc:19:2: error: expected '}' at end of input
   19 | }
      |  ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for( int i = 0 ; i < n ; i++ )
 
int main() {
  
  int N  ;
  cin >> N ;
  int max = 0 ;
  int ans = 0 ; 
  vector<int> A(N) ; 
  rep(i,N) cin >> A(i);
  rep(i,N){
    if( max =< A.at(i) ) {
    ans++;
    max = A.at(i) ;  
    }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: no match for call to '(std::vector<int>) (int&)'
   12 |   rep(i,N) cin >> A(i);
      |                   ~^~~
a.cc:14:14: error: expected primary-expression before '<' token
   14 |     if( max =< A.at(i) ) {
      |              ^
a.cc:19:2: error: expected '}' at end of input
   19 | }
      |  ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <set>
#include <map>

#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define for_p(i, a, b) for(int i = a; i < b; i++)
#define for_m(i, a, b) for(int i = a - 1; i >= b; i--)

//a = s1.size();
//vector<string> s1;
//string s2 = accumulate( s1.begin(), s1.end(), string() );

using namespace std;

int main()
{
  int a = 0 , b = 0, c = 0, d = 0, e = 0, f = 0;
  int i = 0, j = 0;
  double d1 = 0, d2 = 0, d3 = 0, d4 = 0, d5 = 0, d6 = 0;
  int a1[256], a2[512], a3[1024];
  char s1[200000], s2[200000], s3[200000];
  
  cin >> a;
  
  for(i = 0; i < a; i++){
    cin >> a[i];
  }
  
  b++;
  
  for(i = 1; i < a; i++){
    for(j = 0; j < i; j++){
      if(a[j] < a[i]){
        c++;
      }
    }
    if(c == 0){
      b++;
    }
    c = 0;
  }
  cout << c << endl;
} 
  



Compiler output:
a.cc: In function 'int main()':
a.cc:36:13: error: invalid types 'int[int]' for array subscript
   36 |     cin >> a[i];
      |             ^
a.cc:43:11: error: invalid types 'int[int]' for array subscript
   43 |       if(a[j] < a[i]){
      |           ^
a.cc:43:18: error: invalid types 'int[int]' for array subscript
   43 |       if(a[j] < a[i]){
      |                  ^
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <set>
#include <map>

#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define for_p(i, a, b) for(int i = a; i < b; i++)
#define for_m(i, a, b) for(int i = a - 1; i >= b; i--)

//a = s1.size();
//vector<string> s1;
//string s2 = accumulate( s1.begin(), s1.end(), string() );

using namespace std;

int main()
{
  int a = 0 , b = 0, c = 0, d = 0, e = 0, f = 0;
  int i = 0, j = 0;
  double d1 = 0, d2 = 0, d3 = 0, d4 = 0, d5 = 0, d6 = 0;
  int a1[256], a2[512], a3[1024];
  char s1[200000], s2[200000], s3[200000];
  
  cin >> a;
  
  for(i = 0; i < a; i++){
    cin >> a[i];
  }
  
  b++;
  
  for(i = 1; i < a; i++){
    for(j = 0; j < i; j++){
      if(a[j] < a[i]){
        c++;
      }
    }
    if(c == 0){
      b++;
    }
    c = 0;
  }
  cout << c << endl;
}
  
  
  cout << c << endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:36:13: error: invalid types 'int[int]' for array subscript
   36 |     cin >> a[i];
      |             ^
a.cc:43:11: error: invalid types 'int[int]' for array subscript
   43 |       if(a[j] < a[i]){
      |           ^
a.cc:43:18: error: invalid types 'int[int]' for array subscript
   43 |       if(a[j] < a[i]){
      |                  ^
a.cc: At global scope:
a.cc:56:3: error: 'cout' does not name a type
   56 |   cout << c << endl;
      |   ^~~~
a.cc:57:1: error: expected declaration before '}' token
   57 | }
      | ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;

int main()
{
	int N;
	cin >> N;
	vector<int> H(N + 1);
	for (int i = 1; i <= N; i++)
	{
		cin >> H[i];
	}
	int ans = 0;
	for (int i = 1; i <= N; i++)
	{
		bool view = true;
		for (int j = 1; j < i; j++)
		{
			if (H[j]>H[i])
			{
				view = false;
				break;
			}
		}
		if (view)
		{
			ans++;
		}
	}
	cout << ans << endl;
	return 0;


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

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

int main() {
    int n,mx=0;h;
    cin>>n;
    int ans=0;
    while (n--) {
        cin>>h;
        if (mx<=h) {
            mx=h;
            ans++;
        }
    }
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:16: error: 'h' was not declared in this scope
    6 |     int n,mx=0;h;
      |                ^
Language: C++

#include<iostream>
#include<array>
#include<string>
using namespace std;

int main() {
	int num;
	cin >> num;
	int mou;
	int max = 0;
	int see = 0;
	int f = 0;
	int loop = 0;
	int max = 0;
	while (num--) {
		cin >> mou;
		if (mou > max && mou >= f)
		{
			see++;
		}
		if (loop == 0) {
			f = mou;
		}
		else if(mou>=max){
			max = mou;
		}
		loop++;
	}
	cout << see << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: redeclaration of 'int max'
   14 |         int max = 0;
      |             ^~~
a.cc:10:13: note: 'int max' previously declared here
   10 |         int max = 0;
      |             ^~~
Language: C++

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

string divide[4] = {"dream","dreamer","erase","eraser"};

int main(){
	int N; //山の数
	cin >> N;
	vector<int> H(N); //山の高さ
	for(int i = 0; i < N; i++){
		cin >> H[i]; //高さを順番に入力
	}
	//1番目の山の高さと同じかそれより高い山を数える
	int count = 0;
	int max = 0; //一番高い山の高さを入れる変数
	for(int i = 0; i < N; i++){
		if(max < H[i]){
			max += H[i]
		}
		if(max <= H[i]){
			count++;
		}
	}
	cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:36: error: expected ';' before '}' token
   26 |                         max += H[i]
      |                                    ^
      |                                    ;
   27 |                 }
      |                 ~
Language: C++

#include <iostream>
#include <vector>

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

    std::vector<int> H(N+1);
    for (int i = 0; i < N; i++) {
        std::cin >> H[i];
    }
    H[N] = H[N-1];

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: found ':' in nested-name-specifier, expected '::'
    6 |     int N:
      |          ^
      |          ::
a.cc:6:9: error: 'N' has not been declared
    6 |     int N:
      |         ^
a.cc:7:14: error: qualified-id in declaration before '>>' token
    7 |     std::cin >> N;
      |              ^~
a.cc:9:24: error: 'N' was not declared in this scope
    9 |     std::vector<int> H(N+1);
      |                        ^
Language: C++

#include<algorithm>//sort(all(変数),greater<型名>())　で降順に
#include<cmath>//切り上げceil(値)
#include<deque>
#include<iomanip>//setprecision(数字)
#include<iostream>
#include<list>
#include<map>
#include<numeric> //xとyの最大公約数は__gcd(x,y),xとyの最小公倍数は(x*y)/__gcd
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<vector>

#include<bits/stdc++.h>
#include<cstdio>
#include<cstdlib>
#include<tuple>
#include<utility>
#define rep(i,n) for(ll i=0; i<n; i++)
#define vll vector<ll>
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define mod 1000000007
using ll = long long;
using namespace std;

int main(){
  int n;  cin >> n;
  vi h(n);
  rep(i,n){
    cin >> h[i];
  }
  int ans = 0;
  rep(i,n){
    bool flag = true;
    rep(j,i){
      if(h[i] > h[j]){
        flag = false:
        break;
      }
    }
    if(flag){
      ans++;
    }
  }
  cout << ans;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:21: error: expected ';' before ':' token
   43 |         flag = false:
      |                     ^
      |                     ;
Language: C++

#include <iostream>
#include <vector>
using namespace std;

int main() {
  int N; cin >>N;
  vector<int> H(N);
  for (int i=0; i<N;++i)cin >> H[i];
  
  int ans =0;
  int current_max =0;
  for (int i =0;i<N,++i){
    if (H[i]>=current_max)++ans;
    if (current_max<H[i])current_max=H[i];
  }
  cout <<ans <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:24: error: expected ';' before ')' token
   12 |   for (int i =0;i<N,++i){
      |                        ^
      |                        ;
Language: C++

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

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

import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner;
      int n = sc.nextInt();
      int[] array = new int[n];
      int count = 0;
      int sum = 1;
      for(int i = 0;i < n;i++){
      	array[i] = sc.nextInt();
      }
      for(int i = 1;i < n;i++){
      	for(int j = 0;j < i;j++){
        	if(array[i] >= array[j]) count++;
        }
        if(count == i) sum++;
        count = 0;
      }
      System.out.println(sum);
    }
}

Compiler output:
Main.java:4: error: '(' or '[' expected
    	Scanner sc = new Scanner;
    	                        ^
1 error