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

#include<iostream>
#include<vector>
#include<cmath>
#include<utility>
using namespace std;
typedef long long LL;
#define F first
#define S second
#define int LL

void main() {
	LL a, b;
	cin >> a >> b;
	if (abs(a - b) >= 2)cout << "Alice" << endl;
	else cout << "Brown" << endl;
	return;
}

Compiler output:
a.cc:11:1: error: '::main' must return 'int'
   11 | void main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:16:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   16 |         return;
      |         ^~~~~~
Language: C++

#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using namespace boost::multiprecision;
typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;

#define rep(i,j) for(int i=0;i<(j);i++)
#define reps(i,j,k) for(int i=j;i<k;i++)
#define in(i,j,k) ((i)>=(j)&&(i)<=(k))
#define INF (1<<28)
#define pb push_back
#define fs first
#define sc second


const char dx[]={0,1,0,-1},dy[]={1,0,-1,0};
template<class T>
ostream &operator<<(ostream &out, const vector<T> &v){
	out << "{";
	rep(i,v.size()) out << v[i] << ", " ;
	return out << "}" << endl;
}
template<class S,class T>
ostream &operator<<(ostream &out, const pair<S,T> p){
	return out << "(" << p.fs << ", " << p.sc << ")";
}
int main(){
	cpp_int x, y;
	cin >> x >> y;
	s = abs(x - y);
	cout << (s < (cpp_int)2 ?"Beown":"Alice") << endl;
	return 0;
}


Compiler output:
a.cc:2:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
    2 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using namespace boost::multiprecision;
typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;

#define rep(i,j) for(int i=0;i<(j);i++)
#define reps(i,j,k) for(int i=j;i<k;i++)
#define in(i,j,k) ((i)>=(j)&&(i)<=(k))
#define INF (1<<28)
#define pb push_back
#define fs first
#define sc second


const char dx[]={0,1,0,-1},dy[]={1,0,-1,0};
template<class T>
ostream &operator<<(ostream &out, const vector<T> &v){
	out << "{";
	rep(i,v.size()) out << v[i] << ", " ;
	return out << "}" << endl;
}
template<class S,class T>
ostream &operator<<(ostream &out, const pair<S,T> p){
	return out << "(" << p.fs << ", " << p.sc << ")";
}
int main(){
	cpp_int x, y;
	cin >> x >> y;
	s = abs(x - y);
	cout << (s < (cpp_int)2 ?"Beown":"Alice") << endl;
	return 0;
}


Compiler output:
a.cc:2:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
    2 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using namespace boost::multiprecision;
typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;

#define rep(i,j) for(int i=0;i<(j);i++)
#define reps(i,j,k) for(int i=j;i<k;i++)
#define in(i,j,k) ((i)>=(j)&&(i)<=(k))
#define INF (1<<28)
#define pb push_back
#define fs first
#define sc second


const char dx[]={0,1,0,-1},dy[]={1,0,-1,0};
template<class T>
ostream &operator<<(ostream &out, const vector<T> &v){
	out << "{";
	rep(i,v.size()) out << v[i] << ", " ;
	return out << "}" << endl;
}
template<class S,class T>
ostream &operator<<(ostream &out, const pair<S,T> p){
	return out << "(" << p.fs << ", " << p.sc << ")";
}
int main(){
	cppint x, y;
	cin >> x >> y;
	s = abs(x - y);
	cout << (s < (cpp_int)2 ?"Beown":"Alice") << endl;
	return 0;
}


Compiler output:
a.cc:2:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
    2 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <cstdio>
#define A() printf("Alice\n");
#define B() printf("Brown\n");
#define int long long
#define INF 1e+18
using namespace std;

signed main(){
	int n,m;
	cin >> n >> m;
	if(n <= 1 && m <= 1) B();
	else if(n == 0 || m == 0) A();
	else{
		if((n + m) % 2) A();
		else B();
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'else' without a previous 'if'
   13 |         else if(n == 0 || m == 0) A();
      |         ^~~~
a.cc:14:9: error: 'else' without a previous 'if'
   14 |         else{
      |         ^~~~
a.cc:16:17: error: 'else' without a previous 'if'
   16 |                 else B();
      |                 ^~~~
Language: C++

#include <iostream>
#include <cstdio>
#define A() printf("Alice\n");
#define B() printf("Brown\n");
#define int long long
#define INF 1e+18
#define 
using namespace std;

signed main(){
	int n,m;
	cin >> n >> m;
	if(n <= 1 && m <= 1) B();
	else if(n == 0 || m == 0) A();
	else{
		if((n + m) % 2) A();
		else B();
	}
	return 0;
}

Compiler output:
a.cc:7:9: error: no macro name given in #define directive
    7 | #define
      |         ^
a.cc: In function 'int main()':
a.cc:14:9: error: 'else' without a previous 'if'
   14 |         else if(n == 0 || m == 0) A();
      |         ^~~~
a.cc:15:9: error: 'else' without a previous 'if'
   15 |         else{
      |         ^~~~
a.cc:17:17: error: 'else' without a previous 'if'
   17 |                 else B();
      |                 ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int,int> pint;
typedef vector<pint> vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=n-1;i>=(0);i--)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define all(v) (v).begin(),(v).end()
#define eall(v) unique(all(v), v.end())
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll INFF = 1e18;

int main(void){
	ll X, Y;
	cin >> X >> Y;
	if(X <= 1 && Y <= 1){
		printf("Brown\n");
		return 0;
	}

	dfs(X, Y, 0);
	if(flag){
		printf("Alice\n");return 0;
	}


	if(X == Y){
		if(X % 2 && Y % 2){
			printf("Alice\n");
		}else{
			printf("Brown\n");
		}
	}else if(X > Y){
		if(X % 2 == 1 && Y % 2 == 1){
			printf("Alice\n");
		}else if(X % 2 == 0 && Y % 2 == 1){
			printf("Brown\n"); // ok
		}else if(X % 2 == 1 && Y % 2 == 0){
			printf("Alice\n");
		}else{
			printf("Alice\n");
		}
	}else if(X < Y){
		if(X % 2 == 1 && Y % 2 == 1){
			printf("Alice\n");
		}else if(X % 2 == 0 && Y % 2 == 1){
			printf("Alice\n");
		}else if(X % 2 == 1 && Y % 2 == 0){
			printf("Brown\n");
		}else{
			printf("Alice\n");
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:9: error: 'dfs' was not declared in this scope; did you mean 'ffs'?
   31 |         dfs(X, Y, 0);
      |         ^~~
      |         ffs
a.cc:32:12: error: 'flag' was not declared in this scope
   32 |         if(flag){
      |            ^~~~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <numeric>
#include <cmath>

using namespace std;

typedef unsigned long long int ulld;

//const lld mod = 1e9+7;
//const lld INF = 1e9;
//const lld MAXN = 1e9;

int main()
{
	ulld x,y;

	cin >> x >> y;
	string sol;

	if (x > y)
	{
		ulld temp = x;
		x = y;
		y = temp;
	}

	if (x == y)
	{
		sol = "Brown";
	}else if (y - x == 1)
	{
		sol = "Brown";
	}else if (x == 0)
	{
		sol = "Alice";
	}else
	{
		sol = "Alice"
		// if ((x%2 + y%2)%2 == 0)
		// {
		// 	sol = "Alice";
		// }else
		// {
		// 	sol = "Brown";
		// }
	}

	cout << sol << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:30: error: expected ';' before '}' token
   44 |                 sol = "Alice"
      |                              ^
      |                              ;
......
   52 |         }
      |         ~
Language: C++

#include <cstdio>
long long X,Y;
int main()
{
	scanf("%lld%lld",&X,&Y);
	if (x<y) 
		swap(x,y);
	if (x==y) 
		puts("Brown");
	else if (x<=2) 
		puts("Brown");
	else put("Alice");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: 'x' was not declared in this scope
    6 |         if (x<y)
      |             ^
a.cc:6:15: error: 'y' was not declared in this scope
    6 |         if (x<y)
      |               ^
a.cc:7:17: error: 'swap' was not declared in this scope
    7 |                 swap(x,y);
      |                 ^~~~
a.cc:8:13: error: 'x' was not declared in this scope
    8 |         if (x==y)
      |             ^
a.cc:8:16: error: 'y' was not declared in this scope
    8 |         if (x==y)
      |                ^
a.cc:12:14: error: 'put' was not declared in this scope; did you mean 'putw'?
   12 |         else put("Alice");
      |              ^~~
      |              putw
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <numeric>
#include <cmath>

using namespace std;

typedef unsigned long long int ulld;

const lld mod = 1e9+7;
const lld INF = 1e9;
//const lld MAXN = 1e9;

int main()
{
	ulld x,y;

	cin >> x >> y;
	string sol;

	if (x > y)
	{
		ulld temp = x;
		x = y;
		y = temp;
	}

	if (x == y)
	{
		sol = "Brown";
	}else if (x == 0 && y == 1)
	{
		sol = "Brown";
	}else if (x == 0)
	{
		sol = "Alice";
	}else
	{
		if ((x%2 + y%2)%2 == 0)
		{
			sol = "Alice";
		}else
		{
			sol = "Brown";
		}
	}

	cout << sol << endl;

	return 0;
}

Compiler output:
a.cc:15:7: error: 'lld' does not name a type; did you mean 'ulld'?
   15 | const lld mod = 1e9+7;
      |       ^~~
      |       ulld
a.cc:16:7: error: 'lld' does not name a type; did you mean 'ulld'?
   16 | const lld INF = 1e9;
      |       ^~~
      |       ulld
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

#define INF 2147483600

bool solve(long x, long y){
  if(x+y<=1) return dp[x][y] = false;
  if( (x==2 && y==0) || (x==0 && y==2) ) return dp[x][y] = true;

  if((y-x)%3 ==0) return false;
  else return true;
}

int main(){
  long x,y;
  cin>>x>>y;
  //
  // rep(i,100){
  //   rep(j,100) cout << solve(i,j);
  //   cout << endl;
  // }


  if(solve(x,y)) cout << "Alice" << endl;
  else cout << "Brown" << endl;

  return 0;
}


Compiler output:
a.cc: In function 'bool solve(long int, long int)':
a.cc:18:21: error: 'dp' was not declared in this scope; did you mean 'dup'?
   18 |   if(x+y<=1) return dp[x][y] = false;
      |                     ^~
      |                     dup
a.cc:19:49: error: 'dp' was not declared in this scope; did you mean 'dup'?
   19 |   if( (x==2 && y==0) || (x==0 && y==2) ) return dp[x][y] = true;
      |                                                 ^~
      |                                                 dup
Language: Java

import java.util.*;

public class Main {
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long X = sc.nextLong();
		long Y = sc.nextLong();
		System.out.println(Math.abs(X-Y)<=1 ? "Brown" : "Alice");
		
		sc.close();
	}
}



Compiler output:
Main.java:13: error: reached end of file while parsing
}
 ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back 
#define mp make_pair
#define fr first
#define sc second
#define Rep(i,n) for(int i=#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back 
#define mp make_pair
#define fr first
#define sc second
#define Rep(i,n) for(int i=0;i<(n);i++)
#define All(v) v.begin(),v.end()
typedef pair<int, int> Pii; typedef pair<int, Pii> Pip;
const int INF = 1107110711071107;

main()
{
  int X, Y;
  cin >> X >> Y;

  if( X <=2 && Y <= 2 ) cout << "Brown" << endl;
  else cout << "Alice" << endl;
}
0;i<(n);i++)
#define All(v) v.begin(),v.end()
typedef pair<int, int> Pii; typedef pair<int, Pii> Pip;
const int INF = 1107110711071107;

main()
{
  int X, Y;
  cin >> X >> Y;

  if( X <=2 && Y <= 2 ) cout << "Brown" << endl;
  else cout << "Alice" << endl;
}


Compiler output:
a.cc:8:16: error: '#' is not followed by a macro parameter
    8 | #define Rep(i,n) for(int i=#include<bits/stdc++.h>
      |                ^
a.cc:20:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   20 | main()
      | ^~~~
a.cc:28:1: error: expected unqualified-id before numeric constant
   28 | 0;i<(n);i++)
      | ^
a.cc:28:3: error: 'i' does not name a type
   28 | 0;i<(n);i++)
      |   ^
a.cc:28:9: error: 'i' does not name a type
   28 | 0;i<(n);i++)
      |         ^
a.cc:31:11: error: redefinition of 'const long long int INF'
   31 | const int INF = 1107110711071107;
      |           ^~~
a.cc:18:11: note: 'const long long int INF' previously defined here
   18 | const int INF = 1107110711071107;
      |           ^~~
a.cc:33:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   33 | main()
      | ^~~~
a.cc:33:1: error: redefinition of 'int main()'
a.cc:20:1: note: 'int main()' previously defined here
   20 | main()
      | ^~~~
Language: C++

#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define LL long long
#define st first
#define nd second
#define endl '\n'
using namespace std;
int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	LL x,y;
	cin>>x>>y;
	if(x==y||abs(x-y)==1)
		cout<<"Brown"<<endl;
	else cout<<"Alice"<<endl;g
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:34: error: 'g' was not declared in this scope
   17 |         else cout<<"Alice"<<endl;g
      |                                  ^
Language: C++

// ConsoleApplication7.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "iostream"
using namespace std;
typedef long long i64;
int n;
int D;
int Q;
i64 d[500005];
i64 a[500005];
i64 b[500005];
i64 q[500005];
bool f[500005];
int main()
{
	scanf("%d%d", &n, &D);
	for (int i = 0; i < n; ++i) {
		scanf("%d", d + i);
	}
	scanf("%d", &Q);
	for (int i = 0; i < Q; ++i) {
		scanf("%d", q + i);
		--q[i];
	}
	b[n] = 1;
	for (int i = 0; i < n; ++i) {
		if (abs((i > 0 ? a[i - 1] : 0) + d[i] - D) < abs((i > 0 ? a[i - 1] : 0) - D)) {
			a[i] = D - abs((i > 0 ? a[i - 1] : 0) + d[i] - D);
		}
		else {
			a[i] = (i > 0 ? a[i - 1] : 0);
		}
	}
	for (int i = n - 1; i >= 0; --i) {
		if (d[i] >= 2 * b[i + 1]) {
			b[i] = b[i + 1];
		}
		else {
			b[i] = b[i + 1] + d[i];
		}
	}
	for (int i = 0; i < Q; ++i) {
		bool f = (q > 0 ? a[q[i] - 1] : 0) <= (D - b[q[i] + 1]);
		if (f) {
			printf("YES\n");
		}
		else {
			printf("NO\n");
		}
	}
	return 0;
}



Compiler output:
a.cc:4:10: fatal error: stdafx.h: No such file or directory
    4 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

// ConsoleApplication7.cpp : Defines the entry point for the console application.
//


#include "iostream"
using namespace std;
int n;
int D;
int Q;
long long d[500005];
long long a[500005];
long long b[500005];
long long d[500005];
long long q[500005];
bool f[500005];
int main()
{
	scanf("%d%d", &n, &d);
	for (int i = 0; i < n; ++i) {
		scanf("%d", d + i);
	}
	scanf("%d", Q);
	for (int i = 0; i < Q; ++i) {
		scanf("%d", q + i);
		--q[i];
	}
	b[n] = 1;
	for (int i = 0; i < n; ++i) {
		if (abs((i > 0 ? a[i - 1] : 0) + d[i] - D) < abs((i > 0 ? a[i - 1] : 0) - D)) {
			a[i] = D - abs((i > 0 ? a[i - 1] : 0) + d[i] - D);
		}
		else {
			a[i] = (i > 0 ? a[i - 1] : 0);
		}
	}
	for (int i = n - 1; i >= 0; --i) {
		if (d[i] >= 2 * b[i + 1]) {
			b[i] = b[i + 1];
		}
		else {
			b[i] = b[i + 1] + d[i];
		}
	}
	for (int i = 0; i < Q; ++i) {
		bool f = (q > 0 ? a[q[i] - 1] : 0) <= (D - b[q[i] + 1]);
		if (f) {
			printf("YES\n");
		}
		else {
			printf("NO\n");
		}
	}
	return 0;
}



Compiler output:
a.cc:13:11: error: redefinition of 'long long int d [500005]'
   13 | long long d[500005];
      |           ^
a.cc:10:11: note: 'long long int d [500005]' previously declared here
   10 | long long d[500005];
      |           ^
a.cc: In function 'int main()':
a.cc:45:29: error: ordered comparison of pointer with integer zero ('long long int*' and 'int')
   45 |                 bool f = (q > 0 ? a[q[i] - 1] : 0) <= (D - b[q[i] + 1]);
      |                           ~~^~~
Language: C++

// ConsoleApplication7.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "iostream"
using namespace std;
int n;
int D;
int Q;
long long d[500005];
long long a[500005];
long long b[500005];
long long d[500005];
long long q[500005];
bool f[500005];
int main()
{
	scanf("%d%d", &n, &d);
	for (int i = 0; i < n; ++i) {
		scanf("%d", d + i);
	}
	scanf("%d", Q);
	for (int i = 0; i < Q; ++i) {
		scanf("%d", q + i);
		--q[i];
	}
	b[n] = 1;
	for (int i = 0; i < n; ++i) {
		if (abs((i > 0 ? a[i - 1] : 0) + d[i] - D) < abs((i > 0 ? a[i - 1] : 0) - D)) {
			a[i] = D - abs((i > 0 ? a[i - 1] : 0) + d[i] - D);
		}
		else {
			a[i] = (i > 0 ? a[i - 1] : 0);
		}
	}
	for (int i = n - 1; i >= 0; --i) {
		if (d[i] >= 2 * b[i + 1]) {
			b[i] = b[i + 1];
		}
		else {
			b[i] = b[i + 1] + d[i];
		}
	}
	for (int i = 0; i < Q; ++i) {
		bool f = (q > 0 ? a[q[i] - 1] : 0) <= (D - b[q[i] + 1]);
		if (f) {
			printf("YES\n");
		}
		else {
			printf("NO\n");
		}
	}
	return 0;
}



Compiler output:
a.cc:4:10: fatal error: stdafx.h: No such file or directory
    4 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#define abs(a) ((a)<0)?-(a):(a)
long d[500000],q[500000],a[500001],b[500001];

int main(int argc, char const *argv[]){
	long n,d,Q,i;
	scanf("%ld %ld",&n,&d);
	a[0]=d;
	for(i=0;i<n;i++){
		scanf("%ld",&d[i]);
		if(abs(a[i]-d[i])<a[i]) a[i+1]=abs(a[i]-d[i]);
		else a[i+1]=a[i];
	}
	b[n]=1;
	for(i=n-1;i>=0;i--){
		if(b[i+1]<d[i]/2) b[i]=b[i+1];
		else b[i]=b[i+1]+d[i];
	}
	scanf("%ld",&Q);
	for(i=0;i<Q;i++){
		scanf("%ld",&q[i]);
	}
	for(i=0;i<Q;i++){
		if(a[q[i]-1]>=b[q[i]]) printf("YES\n");
		else printf("NO\n");
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:31: error: subscripted value is neither array nor pointer nor vector
   10 |                 scanf("%ld",&d[i]);
      |                               ^
main.c:11:30: error: subscripted value is neither array nor pointer nor vector
   11 |                 if(abs(a[i]-d[i])<a[i]) a[i+1]=abs(a[i]-d[i]);
      |                              ^
main.c:2:18: note: in definition of macro 'abs'
    2 | #define abs(a) ((a)<0)?-(a):(a)
      |                  ^
main.c:11:30: error: subscripted value is neither array nor pointer nor vector
   11 |                 if(abs(a[i]-d[i])<a[i]) a[i+1]=abs(a[i]-d[i]);
      |                              ^
main.c:2:26: note: in definition of macro 'abs'
    2 | #define abs(a) ((a)<0)?-(a):(a)
      |                          ^
main.c:11:30: error: subscripted value is neither array nor pointer nor vector
   11 |                 if(abs(a[i]-d[i])<a[i]) a[i+1]=abs(a[i]-d[i]);
      |                              ^
main.c:2:30: note: in definition of macro 'abs'
    2 | #define abs(a) ((a)<0)?-(a):(a)
      |                              ^
main.c:11:58: error: subscripted value is neither array nor pointer nor vector
   11 |                 if(abs(a[i]-d[i])<a[i]) a[i+1]=abs(a[i]-d[i]);
      |                                                          ^
main.c:2:18: note: in definition of macro 'abs'
    2 | #define abs(a) ((a)<0)?-(a):(a)
      |                  ^
main.c:11:58: error: subscripted value is neither array nor pointer nor vector
   11 |                 if(abs(a[i]-d[i])<a[i]) a[i+1]=abs(a[i]-d[i]);
      |                                                          ^
main.c:2:26: note: in definition of macro 'abs'
    2 | #define abs(a) ((a)<0)?-(a):(a)
      |                          ^
main.c:11:58: error: subscripted value is neither array nor pointer nor vector
   11 |                 if(abs(a[i]-d[i])<a[i]) a[i+1]=abs(a[i]-d[i]);
      |                                                          ^
main.c:2:30: note: in definition of macro 'abs'
    2 | #define abs(a) ((a)<0)?-(a):(a)
      |                              ^
main.c:16:28: error: subscripted value is neither array nor pointer nor vector
   16 |                 if(b[i+1]<d[i]/2) b[i]=b[i+1];
      |                            ^
main.c:17:35: error: subscripted value is neither array nor pointer nor vector
   17 |                 else b[i]=b[i+1]+d[i];
      |                                   ^
Language: C++

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

#define MAX 500002

int n;
int d;

vector<long long int> v;

int q;

vector<int> ask[MAX];

bool ans[MAX];
void outt(){
	for (int i = 0; i < q; i++){
		if (ans[i] == false){
			puts("NO");
		}
		else{
			puts("YES");
		}
	}
	exit(0);
}
int main(){
	cin >> n >> d;
	for (int i = 0; i < n; i++){
		int a;
		scanf("%d", &a);
		v.push_back(a);
	}
	cin >> q;
	for (int i = 0; i < q; i++){
		int a;
		scanf("%d", &a);
		ask[a - 1].push_back(i);
	}
	long long int cur = d;
	for (int i = 0; i < n; i++){
		
		cur=min(cur,abs(cur-v[i]));
	}
	return 0;
}
エラー

Compiler output:
a.cc:49:1: error: '\U000030a8\U000030e9\U000030fc' does not name a type
   49 | エラー
      | ^~~~~~
Language: C++

#include <bits/stdc++.h> 
using namespace std;
typedef long long ll;
typedef double db;
#define fo(i,j,k) for(i=j;i<=k;i++)
#define fd(i,j,k) for(i=j;i>=k;i--)
const int N=1e6+5,mo=998244353;
struct rec
{
    ll v;
    db t;
}s[N];
ll sum,t[N],v[N],l,r,n,L,prod,i,dec;
int main()
{
    scanf("%lld %lld",&n,&L);
    l=1;
    r=0;
    fo(i,1,n)
    {
	        scanf("%lld %lld",t+i,v+i);
        while (sum+v[i]>L)
        {
            dec=min(s[l].v,sum+v[i]-L);
            s[l].v-=dec;
            sum-=dec;
            prod-=dec*s[l].t;
            if (!s[l].v) l++;
        }
        s[++r]={v[i],t[i]};
        prod+=v[i]*t[i];
        sum+=v[i];
        while (l<r&&s[r].t<s[r-1].t)
        {
            s[r-1].t=(s[r-1].t*s[r-1].v+s[r].t*s[r].v)/(s[r-1].v+s[r].v);
            s[r-1].v+=s[r].v;
            r--;
        }
        printf("%lf\n",(db)prod/L);
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:13: error: reference to 'dec' is ambiguous
   24 |             dec=min(s[l].v,sum+v[i]-L);
      |             ^~~
In file included from /usr/include/c++/14/streambuf:43,
                 from /usr/include/c++/14/bits/streambuf_iterator.h:35,
                 from /usr/include/c++/14/iterator:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54,
                 from a.cc:1:
/usr/include/c++/14/bits/ios_base.h:1079:3: note: candidates are: 'std::ios_base& std::dec(ios_base&)'
 1079 |   dec(ios_base& __base)
      |   ^~~
a.cc:13:33: note:                 'll dec'
   13 | ll sum,t[N],v[N],l,r,n,L,prod,i,dec;
      |                                 ^~~
a.cc:25:21: error: reference to 'dec' is ambiguous
   25 |             s[l].v-=dec;
      |                     ^~~
/usr/include/c++/14/bits/ios_base.h:1079:3: note: candidates are: 'std::ios_base& std::dec(ios_base&)'
 1079 |   dec(ios_base& __base)
      |   ^~~
a.cc:13:33: note:                 'll dec'
   13 | ll sum,t[N],v[N],l,r,n,L,prod,i,dec;
      |                                 ^~~
a.cc:26:18: error: reference to 'dec' is ambiguous
   26 |             sum-=dec;
      |                  ^~~
/usr/include/c++/14/bits/ios_base.h:1079:3: note: candidates are: 'std::ios_base& std::dec(ios_base&)'
 1079 |   dec(ios_base& __base)
      |   ^~~
a.cc:13:33: note:                 'll dec'
   13 | ll sum,t[N],v[N],l,r,n,L,prod,i,dec;
      |                                 ^~~
a.cc:27:19: error: reference to 'dec' is ambiguous
   27 |             prod-=dec*s[l].t;
      |                   ^~~
/usr/include/c++/14/bits/ios_base.h:1079:3: note: candidates are: 'std::ios_base& std::dec(ios_base&)'
 1079 |   dec(ios_base& __base)
      |   ^~~
a.cc:13:33: note:                 'll dec'
   13 | ll sum,t[N],v[N],l,r,n,L,prod,i,dec;
      |                                 ^~~
a.cc:30:25: warning: narrowing conversion of 't[i]' from 'll' {aka 'long long int'} to 'db' {aka 'double'} [-Wnarrowing]
   30 |         s[++r]={v[i],t[i]};
      |                      ~~~^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define ld long double
#define PI pair<ld,ll>
#define S second
#define F first
const int N=500005;
int n,L,top;
PI q[N];
ll sum[N];
ld ans[N];
PI operator +(PI a,PI b){
	return mp((a.F*a.S+b.F*b.S)/(a.S+b.S),a.S+b.S);
}
int main(){
	scanf("%d%d",&n,&L);
	for(int i=1;i<=n;i++){
		int t,v; scanf("%d%d",&t,&v);
		PI dq=mp(t,v);
		while(top&&q[top]>dq){if(q[top].S+dq.S>L)q[top].S=L-dq.S; dq=dq+q[top--]; }
		q[++top]=dq; sum[top]=sum[top-1]+dq.S; ans[top]=ans[top-1]+dq.F*dq.S;
		int pos=lower_bound(&sum[1],&sum[top+1],sum[top]-L)-sum;
		printf("%.7lf\n",(double)((ans[top]-ans[pos]+q[pos].F*(L-(sum[top]-sum[pos])))/L));
	}
}

Compiler output:
a.cc: In function 'std::pair<long double, long long int> operator+(std::pair<long double, long long int>, std::pair<long double, long long int>)':
a.cc:14:16: error: 'mp' was not declared in this scope
   14 |         return mp((a.F*a.S+b.F*b.S)/(a.S+b.S),a.S+b.S);
      |                ^~
a.cc: In function 'int main()':
a.cc:20:23: error: 'mp' was not declared in this scope
   20 |                 PI dq=mp(t,v);
      |                       ^~
Language: C++

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

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

  for(int i = 0; i < N; i++){
    // same を抜ける
    while (i+1 < N && A[i] == A[i+1]) ++i;

    // up
    if (i+1 < N && A[i] < A[i+1]) {
        while (i+1 < N && A[i] <= A[i+1]) ++i;
    }
    // down
    else if (i+1 < N && A[i] > A[i+1]) {
        while (i+1 < N && A[i] >= A[i+1]) ++i;
    }
    cnt++;
    }
  }
  cout << cnt << endl;
}

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

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

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

  for(int i = 0; i < N; i++){
    // same を抜ける
    while (i+1 < N && A[i] == A[i+1]) ++i;

    // up
    if (i+1 < N && A[i] < A[i+1]) {
        while (i+1 < N && A[i] <= A[i+1]) ++i;
    }
    // down
    else if (i+1 < N && A[i] > A[i+1]) {
        while (i+1 < N && A[i] >= A[i+1]) ++i;
    }
    cnt++;
    }
  }
  cout << cnt << endl;
}


Compiler output:
a.cc:1:5: error: stray '#' in program
    1 | int #include <bits/stdc++.h>
      |     ^
a.cc:1:14: error: expected initializer before '<' token
    1 | int #include <bits/stdc++.h>
      |              ^
a.cc: In function 'int main()':
a.cc:5:10: error: 'cin' was not declared in this scope
    5 |   int N; cin >> N;
      |          ^~~
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> A(N);
      |   ^~~~~~
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> A(N);
      |          ^~~
a.cc:9:12: error: 'A' was not declared in this scope
    9 |     cin >> A.at(i);
      |            ^
a.cc:14:23: error: 'A' was not declared in this scope
   14 |     while (i+1 < N && A[i] == A[i+1]) ++i;
      |                       ^
a.cc:17:20: error: 'A' was not declared in this scope
   17 |     if (i+1 < N && A[i] < A[i+1]) {
      |                    ^
a.cc: At global scope:
a.cc:27:3: error: 'cout' does not name a type
   27 |   cout << cnt << endl;
      |   ^~~~
a.cc:28:1: error: expected declaration before '}' token
   28 | }
      | ^
Language: C++

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

int main() {
    int N; cin >> N;
    vector<int> A(N);
    for (int i = 0; i < N; ++i) cin >> A[i];

    int res = 0;
    //i+1<Nを条件に常に入れることが大事
    for (int i = 0; i < N; ++i) {
        // same を抜ける
        while (i+1 < N && A[i] == A[i+1]) ++i;

        // up
        if (i+1 < N && A[i] < A[i+1]) {
            while (i+1 < N && A[i] <= A[i+1]) ++i;
        }
        // down
        else if (i+1 < N && A[i] > A[i+1]) {
            while (i+1 < N && A[i] >= A[i+1]) ++i;
        }
        ++res;
    }
    cout << res << endl;


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

#include <bits/stdc++.h> 
using namespace std; 
typedef long long int ll;
typedef long double ld;
typedef unsigned long long int ull;
const long long int m=pow(10,9)+7;

int main() 
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin>>n;
    vector<ll>a;
    for(ll i=0;i<n;i++)
    {
        ll x;
        cin>>x;
        a.push_back(x);
    }
    ll res=0;
    for(ll i=0;i<n;i++)
    {
        while(i+1<n&&a[i+1]==a[i])
            i++;
        if(a[i+1]>a[i])
        {
            while(i+1<n&&aa[i+1]>=a[i])
                i++;
        }
        else
        {
            while(i+1<n&&a[i+1]<=a[i])
                i++;
        }
        res++;
    }
    cout<<res<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:26: error: 'aa' was not declared in this scope; did you mean 'a'?
   28 |             while(i+1<n&&aa[i+1]>=a[i])
      |                          ^~
      |                          a
Language: C++

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

int main() {
    ll n, tmp = 0, cnt = 1;
    cin >> n;
    vector<ll> a(n);
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }

    if (n == 1) {
        cout << 1 << endl;
        return 0;
    }

    for(int i = 0,i < n-1; i++) {
        if (a[i] < a[i + 1]) {
            if (tmp = -1) {
                cnt++;
                tmp = 0;
            } else {
                tmp = 1;
            }
        }

        if (a[i] > a[i + 1]) {
            if (tmp == 1) {
                cnt++;
                tmp = 0;
            } else {
                tmp = -1;
            }
        }
    }
    cout << cnt << endl;
    return 0;
}

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

#include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<string>
#include<unordered_map>
#include<set>
using namespace std;

#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j,k
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define sort(a) sort(a.begin(),a.end())
#define push(a,b) (a).push_back(b)
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define sizeoof(a,b) (a,vector<ll>(b))
#define llpvec vector<pair<ll,ll>>
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*最小公倍数*/ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
/*n乗*/ll llpow(ll x,ll n){ll i,ans=1;rep(i,0,n)ans*=x;return ans;}
/*階乗*/ll fact(ll x){ll i,ans=1;rep(i,0,x)ans*=(x-i);return ans;}
/*nCr*/ll ncr(ll n,ll r){return fact(n)/fact(r)/fact(n-r);}
/*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);}
/*primejudge*/bool prime(ll a){if(a<=1)return false;ll i;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
llfor;///////////////////////////////////////////////////////////
int main(){
 ll n;sc(n);
 ll a[n],b[n]=;
 ll ans=1;
 rep(i,0,n){
  sc(a[i]);
 }
 rep(i,0,n-1){
   if(a[i]<a[i+1])b[i]=0;
   else if(a[i]>a[i+1])b[i]=1;
   else b[i]=b[i-1];
   if((b[i-1]==1&&b[i]==0)||(b[i-1]==0&&b[i]==1)){
    ans++;
   // cout<<b[i-1]<<" "<<b[i]<<" "<<i<<endl;
    b[i]=2;
   }
 }
 pr(ans);
 
return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:15: error: expected primary-expression before ';' token
   50 |  ll a[n],b[n]=;
      |               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  int L=0;
  cin>>N;
  vector<int>vec(N);
  for(int X=0;X<N;X++){
    cin>>vec.at(X);
    if(X>1){
      if(vec.at(X-2)>=vec.at(X-1) && vec.at(X-1)<=vec.at(X) && !(vec.at(X-2)=vec.at(X-1) && vec.at(X-1)=vec.at(X))){
        L++;
      }
      else if(vec.at(X-2)<=vec.at(X-1) && vec.at(X-1)>=vec.at(X) && !(vec.at(X-2)=vec.at(X-1) && vec.at(X-1)=vec.at(X))){
        L++;
      }
    }
  }
  cout<<L<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:90: error: lvalue required as left operand of assignment
   12 |       if(vec.at(X-2)>=vec.at(X-1) && vec.at(X-1)<=vec.at(X) && !(vec.at(X-2)=vec.at(X-1) && vec.at(X-1)=vec.at(X))){
      |                                                                              ~~~~~~~~~~~~^~~~~~~~~~~~~~
a.cc:15:95: error: lvalue required as left operand of assignment
   15 |       else if(vec.at(X-2)<=vec.at(X-1) && vec.at(X-1)>=vec.at(X) && !(vec.at(X-2)=vec.at(X-1) && vec.at(X-1)=vec.at(X))){
      |                                                                                   ~~~~~~~~~~~~^~~~~~~~~~~~~~
Language: C++

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

int main(){
  int N
  vector<int>A(N);
  
  for(int i=0;i<N;i++) cin>>A.at(N);
  //途中まで。
    

return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'vector'
    6 |   vector<int>A(N);
      |   ^~~~~~
a.cc:8:17: error: 'N' was not declared in this scope
    8 |   for(int i=0;i<N;i++) cin>>A.at(N);
      |                 ^
a.cc:8:29: error: 'A' was not declared in this scope
    8 |   for(int i=0;i<N;i++) cin>>A.at(N);
      |                             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int x;
  cin >> x;
  vector<int> arr(x);
  for (int i = 0; i<x; i++){
    cin >> arr[i];
  }
  vector<vector<int>> B(1);
  for (int i = 0; i<x; i++){
    if (B.back().size() == 0){
      B.back().push_back(arr[i]);
    } else if (B.back().size() == 1){
      B.back().push_back(arr[i]);
    } else if (B.back().front() == B.back().back()){
      B.back().push_back(arr[i]);
    } else if (B.back().front() < B.back().back()){
      if (B.back().back() <= arr[i]){
        B.back().push_back(arr[i]);
      } else {
        B.push_back(vector<int>(1, arr[i]));
      }
    } else {
      assert(B.back().front()>B.back().back());
      if (B.back().back() >= arr[i]){
        B.back().push_back(arr[i]);
      } else {
        B.push_back(vector<int>(1, arr[i]));
      }
    }
  }
  cout << B.size()
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:19: error: expected ';' before 'return'
   33 |   cout << B.size()
      |                   ^
      |                   ;
   34 |     return 0;
      |     ~~~~~~
Language: C++

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

const int NEUTRAL = 0;
const int ASCENDING = -1;
const int DESCENDING = 1;

int main(){
  int N, numbers[100005];
  cin >> N;
  for(int i=0; i<N; i++){
    cin >> numbers[i];
  }
  
  int flag = NEUTRAL;
  int ans = 0;
  for(int i=0; i<N-1; i++){
    if((flag == ASCENDING && numbers[i] > numbers[i+1]) || 
       (flag == DESCENDING && numbers[i] < numbers[i+1]) {
          ans++;
          flag = NEUTRAL;
       }
    else if(numbers[i] < numbers[i+1]) flag = ASCENDING;
    else if(numbers[i] > numbers[i+1]) flag = DESCENDING;
  }
  
  cout << ans << endl;
  
  return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:20:57: error: expected ';' before '{' token
   20 |        (flag == DESCENDING && numbers[i] < numbers[i+1]) {
      |                                                         ^~
      |                                                         ;
a.cc:24:5: error: expected primary-expression before 'else'
   24 |     else if(numbers[i] < numbers[i+1]) flag = ASCENDING;
      |     ^~~~
a.cc:23:9: error: expected ')' before 'else'
   23 |        }
      |         ^
      |         )
   24 |     else if(numbers[i] < numbers[i+1]) flag = ASCENDING;
      |     ~~~~ 
a.cc:19:7: note: to match this '('
   19 |     if((flag == ASCENDING && numbers[i] > numbers[i+1]) ||
      |       ^
Language: C++

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

int main() {
  int N;
  cin >> N;
  pair<int,int>data=mke_pair(0,0);
  int y;
  cin >> y;
  data.first=y;
  int count=1;
  for(int i=1;i<N;i++){
    int x;
    cin >> x;
    if(x>data.first&&data.second==2){
      count++;
      data.second=0;
    }
    else if(x<data.first&&data.second==1){
      count++;
      data.second=0;
    }
    else if(x>data.first&&data.second==0){
      data.second=1;
    }
    else if(x<data.first&&data.second==0){
      data.second=2;
    }
    data.first=x;
  }
  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:21: error: 'mke_pair' was not declared in this scope
    7 |   pair<int,int>data=mke_pair(0,0);
      |                     ^~~~~~~~
Language: C++


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

#define ll long long
#define pb push_back
#define mp make_pair

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


Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: 'else' without a previous 'if'
   21 |                 else if(i+1<n && a[i+1]>a[i])
      |                 ^~~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int>data(N);
  for(int i:data){
    cin >> data.at(i);
  }
  int count=1;
  int j=0;
  while(j<N){
    int status=0;
    int i=j;
    while(i<N-1){
      else if(data.at(i)<data.at(i+1)&&status!=2) status=1;
      else if(data.at(i)>data.at(i+1)&&status!=1) status=2;
      else if(data.at(i)==data.at(i+1)) status=status;
      else break;
      i++;
      j=i+1;
    }
    count++;
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:7: error: 'else' without a previous 'if'
   17 |       else if(data.at(i)<data.at(i+1)&&status!=2) status=1;
      |       ^~~~
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;
  vector<int> A(N);
  rep(i,N){
    cin >> A[N];
  }
  
  int i=0;
  int count=1;
  while(i<N-1){
    if(A[i]+1 == A[i+1]){
      while(A[i] == A[i+1] || A[i]+1 == A[i+1]){
        i++;
        if(A[i] != A[i+1] && A[i]+1 != A[i+1]) count++;
      }
    }
    
    if(A[i]-1 == A[i+1]){
      while(A[i] == A[i+1] || A[i]-1 == A[i+1]){
        i++;
        if(A[i] != A[i+1] && A[i]-1 != A[i+1]) count++;
      }
    }
    
    if(A[i] != A[i+1] && A[i]+1 != A[i+1] && A[i]-1 != A[i+1]){
      count++;
      i++
    }
  }
  
  cout << count << endl;
}
  
  
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:32:10: error: expected ';' before '}' token
   32 |       i++
      |          ^
      |          ;
   33 |     }
      |     ~
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;
  vector(int) A(N);
  rep(i,N){
    cin >> A(N);
  }
  
  int i=0;
  int count=1;
  while(i<N-1){
    if(A[i]+1 == A[i+1]){
      while(A[i] == A[i+1] || A[i]+1 == A[i+1]){
        i++;
        if(A[i] != A[i+1] && A[i]+1 != A[i+1]) count++;
      }
    }
    
    if(A[i]-1 == A[i+1]){
      while(A[i] == A[i+1] || A[i]-1 == A[i+1]){
        i++;
        if(A[i] != A[i+1] && A[i]-1 != A[i+1]) count++;
      }
    }
    
    if(A[i] != A[i+1] && A[i]+1 != A[i+1] && A[i]-1 != A[i+1]){
      count++;
    }
  }
  
  cout << count << endl;
}
  
  
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: missing template arguments before '(' token
    8 |   vector(int) A(N);
      |         ^
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector(int) A(N);
      |          ^~~
a.cc:10:12: error: 'A' was not declared in this scope
   10 |     cin >> A(N);
      |            ^
a.cc:16:8: error: 'A' was not declared in this scope
   16 |     if(A[i]+1 == A[i+1]){
      |        ^
a.cc:23:8: error: 'A' was not declared in this scope
   23 |     if(A[i]-1 == A[i+1]){
      |        ^
a.cc:30:8: error: 'A' was not declared in this scope
   30 |     if(A[i] != A[i+1] && A[i]+1 != A[i+1] && A[i]-1 != A[i+1]){
      |        ^
Language: C++

int main(){
    int N;
    cin >> N;
    vector<ll> A(N);
    rep(i,N) cin >> A[i];
    vector<ll> diff(N-1);
    rep(i,N-1){
        diff[i]=A[i+1]-A[i];
    }
    ll ans = 0;
    rep(i,N-2){
        if(diff[i]*diff[i+1]<0){
            // 増減の反転
            i++;
            ans++;
        }
    }
    ans++;
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> N;
      |     ^~~
a.cc:4:5: error: 'vector' was not declared in this scope
    4 |     vector<ll> A(N);
      |     ^~~~~~
a.cc:4:12: error: 'll' was not declared in this scope
    4 |     vector<ll> A(N);
      |            ^~
a.cc:4:16: error: 'A' was not declared in this scope
    4 |     vector<ll> A(N);
      |                ^
a.cc:5:9: error: 'i' was not declared in this scope
    5 |     rep(i,N) cin >> A[i];
      |         ^
a.cc:5:5: error: 'rep' was not declared in this scope
    5 |     rep(i,N) cin >> A[i];
      |     ^~~
a.cc:6:16: error: 'diff' was not declared in this scope
    6 |     vector<ll> diff(N-1);
      |                ^~~~
a.cc:10:7: error: expected ';' before 'ans'
   10 |     ll ans = 0;
      |       ^~~~
      |       ;
a.cc:18:5: error: 'ans' was not declared in this scope
   18 |     ans++;
      |     ^~~
a.cc:19:5: error: 'cout' was not declared in this scope
   19 |     cout << ans << endl;
      |     ^~~~
a.cc:19:20: error: 'endl' was not declared in this scope
   19 |     cout << ans << endl;
      |                    ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> vvl;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvec;
typedef vector<vector<bool>> vveb;
typedef vector<vector<string>> vves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pb push_back
#define pp pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
typedef long long int64;
//const int64 INF = 1LL << 58;
#define dame { puts("-1"); return 0;}
#define YES { cout << "YES" << endl; return 0; }
#define NO { cout << "NO" << endl; return 0; }
#define Yes { cout << "Yes" << endl; return 0; }
#define No { cout << "No" << endl; return 0; }
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};



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

    int n;
    cin >> n;
    vl a(n);
    rep(i,n){
        cin >> a[i];
    }
    int cnt = 0;
    rep(i,n){
        while(i+1<n && a[i]==a[i+1])++i;
        
        if(i+1<n && a[i]>a[i+1]){
            while(i+1<n && a[i]>=a[i+1])++i;
        }
        else if(i+1<n && a[i]>a[i+1]){
            while(i+1 && a[i]>=a[i+1)++i;
        }
    }
    ++cnt;
    cout << cnt << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:66:37: error: expected ']' before ')' token
   66 |             while(i+1 && a[i]>=a[i+1)++i;
      |                                     ^
      |                                     ]
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <cstdint>
#include <vector>
#include <sstream>
#include <unordered_map>

using namespace std;
typedef long long ll;


ll ans, mx, mn, flag, sum, cnt;

int main(){
	ll n;
	cin>>n;
	ans=1;
	ll a[n];
	for(ll i=0; i<n; i++){
		cin>>a[i];
	}
	
	//bool increase=false;
	for(ll i=1; i<n-1; i++){
		if(a[i]>a[i-1] && a[i]>=a[i+1]){
			ans++;
			i++;
			increase=true;
		}
		
		else if(a[i]<a[i-1] && a[i]<=a[i+1]){
			ans++;
			i++;
		}
	}
	cout<<ans<<endl;
	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:25: error: 'increase' was not declared in this scope
   30 |                         increase=true;
      |                         ^~~~~~~~
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 ans=1;
  int a=1;
  for(int i=1;i<N;i++){
   if(A.at(i-1)<A.at(i)){
    if(a==1){
    a=0;
    }else if(a==2){
      ans++; a=1;
    }else
      a=0;
   }
   if(A.at(i)<A.at(i-1)){
    if(a==1){
    a=2;
    }else if(a==0){
      ans++; a=1;
    }else
      a=2;
   }
   }
  }cout<<ans<<endl;
   return 0;
}

Compiler output:
a.cc:29:4: error: 'cout' does not name a type
   29 |   }cout<<ans<<endl;
      |    ^~~~
a.cc:30:4: error: expected unqualified-id before 'return'
   30 |    return 0;
      |    ^~~~~~
a.cc:31:1: error: expected declaration before '}' token
   31 | }
      | ^
Language: C++

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

int main() {
  int N;
  vector <int> A(N);
  for (int i=0;i<N;i++){
    cin >> A[i];
  }
  bool j=0;
  int c=1
  
  if (A[0] > A[1]){
    j=1;
  }
  
  for (int i=1;i<N;i++){
  if (j){
    if (A[i] < A[i-1]){
      continue;
    }
    else j=0,c++;
  }
  
  else {
    if (A[i] > A[i-1]){
      continue;
    }
    else j=1,c++;
  }
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: expected ',' or ';' before 'if'
   13 |   if (A[0] > A[1]){
      |   ^~