criyle/codenet-compile-errors huggingface dataset:
Language: Java

/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		long first = sc.nextLong();
		long second = sc.nextLong();
		String result = "";
		if(first > second) {
			result = "GREATER"
		} else if(first < second) {
			result = "LESS";
		} else {
			result = "EQUAL";
		}
		System.out.println(result);
	}
}

Compiler output:
Main.java:17: error: ';' expected
			result = "GREATER"
			                  ^
1 error
Language: Java

import java.util.Scanner;
 
class Main {
  public static void main (String[] args) {
    Scanner scanner = new Scanner(System.in);
 
double a = scanner.nextDouble();
double b = scanner.nexDouble();
 
if(a > b) {
    System.out.println("GREATER");
} else if(a < b) {
    System.out.println("LESS");
} else {
    System.out.println("EQUAL");
}
}
}

Compiler output:
Main.java:8: error: cannot find symbol
double b = scanner.nexDouble();
                  ^
  symbol:   method nexDouble()
  location: variable scanner of type Scanner
1 error
Language: Java

import java.util.scanner;
 
class Main {
  public static void main (String[] args) {
    Scanner scanner = new Scanner(System.in);
 
int a = scanner.nextInt();
int b = scanner.nextInt();
 
if(a > b) {
    System.out.println("GREATER");
} else if(a < b) {
    System.out.println("LESS");
} else {
    System.out.println("EQUAL");
}
}
}

Compiler output:
Main.java:1: error: cannot find symbol
import java.util.scanner;
                ^
  symbol:   class scanner
  location: package java.util
Main.java:5: error: cannot find symbol
    Scanner scanner = new Scanner(System.in);
    ^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
    Scanner scanner = new Scanner(System.in);
                          ^
  symbol:   class Scanner
  location: class Main
3 errors
Language: Java

import java.util.Scanner;
 
class Main {
  public static void main (String[] args) {
    Scanner scanner = new Scanner(System.in);
 
int a = scanner.nextInt();
int b = scanner.nextInt();
 
if(a > b) {
    System.out.println("GREATER");
} else if(a < b) {
    System.out.println("LESS");
} else {
    System.out.println("EQUAL");
}
}

Compiler output:
Main.java:17: error: reached end of file while parsing
}
 ^
1 error
Language: Java

import java.util.scanner;

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

int a = scanner.nextInt();
int b = scanner.nextInt();

if(a > b) {
    System.out.println("GREATER");
} else if(a < b) {
    System.out.println("LESS");
} else {
    System.out.println("EQUAL");
}
}

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

#include <iostream>
#include <stdio.h>
#include <cstring>

using namespace std;

int main()
{
	char a[101] = {0};
	char b[101] = {0};
	int check = 0;
	cin >> a >> b;
	
	int aa = strlen(a);
	int bb = strlen(b);
	
	if(a > b)
		cout << "GREATER";
	
	else if(a == b)
		cout << "EQUAL";
	
	else if(a < b)
		cout << "LESS";
		
	else
		for(int i = 0; i < aa; i++){
		
			if(a[i] > b[i]){
				
				cout << "GREATER";
				check = 1
				break;
			}
			
			else if(a[i] < b[i]){
				
				cout << "LESS";
				check = 1;
				break;
			}	
		}
	
	if(check == 0)
		cout << "EQUAL";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:42: error: expected ';' before 'break'
   32 |                                 check = 1
      |                                          ^
      |                                          ;
   33 |                                 break;
      |                                 ~~~~~
Language: C++

#include <iostream>
#include <stdio.h>
#include <cstring>

using namespace std;

int main()
{
	string a, b;
	cin >> a >> b;
	if(a > b){
		
		cout << "GREATER";
	}
	
	if(a == b){
		
		cout << "EQUAL";
	}
	
	else
		cout << " "
}


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

unsigned long long int a,b;
scanf("%llu%llu",a,b);
if(a==b){
	printf("EQUAL");
}else if(a<b){
	printf("LESS");
}else{
	printf("GREATER");
}
}

Compiler output:
main.c:2:7: error: expected declaration specifiers or '...' before string constant
    2 | scanf("%llu%llu",a,b);
      |       ^~~~~~~~~~
main.c:2:18: error: expected declaration specifiers or '...' before 'a'
    2 | scanf("%llu%llu",a,b);
      |                  ^
main.c:2:20: error: expected declaration specifiers or '...' before 'b'
    2 | scanf("%llu%llu",a,b);
      |                    ^
main.c:3:1: error: expected identifier or '(' before 'if'
    3 | if(a==b){
      | ^~
main.c:5:2: error: expected identifier or '(' before 'else'
    5 | }else if(a<b){
      |  ^~~~
main.c:7:2: error: expected identifier or '(' before 'else'
    7 | }else{
      |  ^~~~
main.c:10:1: error: expected identifier or '(' before '}' token
   10 | }
      | ^
Language: Java

import java.util.Scanner;

public class Main{
	public static void main(System.in){
		
		Scanner scan = new Scanner(System.in);
		String a = scan.next();
		String b = scan.next();

		if(a.length() > b.length()){
			System.out.println("GREATER");
			break;
		} else if(a.length() < b.length()){
			System.out.println("LESS");
			break;
		} else {
			for(int i = 0 ; i < a.length() ; i++){
				if(a.charAt(i) > b.charAt(i)){
					System.out.println("GREATER");
					break;
				} else if(a.charAt(i) > b.charAt(i)){
					System.out.println("LESS");
					break;
				} else {
					if(i == a.length - 1){
						System.out.println("EQUAL");
					}
				}
			}
		}
	}
}


Compiler output:
Main.java:4: error: <identifier> expected
	public static void main(System.in){
	                                 ^
1 error
Language: C

#include <iostream>
#include <cmath>
#include <cstdio>
using namespace std;
const long D = 1000000007;

int main()
{
  string a, b;
  cin >> a >> b;
  if (a.length() < b.length())
  {
    cout << "LESS" << endl;
  }
  else if (a.length() > b.length())
  {
    cout << "GREATER" << endl;
  }
  else
  {
    cout << (a > b ? "GREATER" : a == b ? "EQUAL" : "LESS") << endl;
  }
  return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<fstream>
#include<string>
#include<cmath>
#include<queue>
using namespace std;


int main(){
	
	string A,B;
	int numA,numB,dA,dB;
	int i;
	
	cin >> A;
	cin >> B;
	
	numA=A.length();
	numB=B.length();
	
	if (numA>numB){
		cout<<"GREATER"<<endl;
	}
	else if(numA<numB){
		cout<<"LESS"<<endl;
	}
	else{
		for(i=0;i<=numA-1;i++){
			if(A[i]>B[i]){
				cout<<"GREATER"<<endl;
				break;
			}
			else if(A[i]<B[i]){
				cout<<"LESS"<<endl;
				break;
			}
			else{
				if(i==0){
					cout<<"EQUAL"<<endl;
					break;
				}
			}
		}
	}

}

return 0;
};

Compiler output:
a.cc:48:1: error: expected unqualified-id before 'return'
   48 | return 0;
      | ^~~~~~
a.cc:49:1: error: expected declaration before '}' token
   49 | };
      | ^
Language: C++

#include<iostream>
using namespace std;
 int main(){
int a,b;
cin>>a>>b;
if(a>b)cout<<"GREATER"<<endl;
else if(a==b)cout<<"EQUAL"<<endl;
else cout<<"LESS"<<ednl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:20: error: 'ednl' was not declared in this scope
    8 | else cout<<"LESS"<<ednl;
      |                    ^~~~
Language: C++

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	sc := NewScanner()

	a := ""
	a = sc.NextLine()
	b := ""
	b = sc.NextLine()

	if a == b {
		fmt.Printf("EQUAL\n")
	} else if a > b {
		fmt.Printf("GREATER\n")
	} else {
		fmt.Printf("LESS\n")
	}
}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r: rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			result = append(result, v)
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	result = append(result, v)

	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}


Compiler output:
a.cc:1:1: error: 'package' does not name a type
    1 | package main
      | ^~~~~~~
a.cc:27:1: error: 'type' does not name a type; did you mean 'typeof'?
   27 | type Scanner struct {
      | ^~~~
      | typeof
a.cc:33:1: error: 'func' does not name a type
   33 | func NewScanner() *Scanner {
      | ^~~~
a.cc:37:6: error: expected constructor, destructor, or type conversion before '(' token
   37 | func (s *Scanner) Next() string {
      |      ^
a.cc:49:6: error: expected constructor, destructor, or type conversion before '(' token
   49 | func (s *Scanner) NextLine() string {
      |      ^
a.cc:55:6: error: expected constructor, destructor, or type conversion before '(' token
   55 | func (s *Scanner) NextInt() int {
      |      ^
a.cc:60:6: error: expected constructor, destructor, or type conversion before '(' token
   60 | func (s *Scanner) NextIntArray() []int {
      |      ^
a.cc:77:6: error: expected constructor, destructor, or type conversion before '(' token
   77 | func (s *Scanner) NextMap() map[int]bool {
      |      ^
a.cc:94:6: error: expected constructor, destructor, or type conversion before '(' token
   94 | func (s *Scanner) pre() {
      |      ^
a.cc:100:6: error: expected constructor, destructor, or type conversion before '(' token
  100 | func (s *Scanner) readLine() {
      |      ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <queue>

using namespace std;

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

  string A, B;
  cin >> A;
  cin >> B;
  int n = max(A.size(), B.size());
  string ans;
  if (A.size() > B.size())
  {
    cout << "GREATER" << endl;
    return;
  }
  else if (B.size() < A.size())
  {
    cout << "LESS" << endl;
  }
  else
  {

    for (int i = 0; i < n; i++)
    {
      if (A[i] > B[i])
      {
        ans = "GREATER";
        break;
      }
      else if (A[i] < B[i])
      {
        ans = "LESS";
        break;
      }
      else
      {
        ans = "EQUAL";
      }
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
   22 |     return;
      |     ^~~~~~
Language: Java

import java.util.Scanner;


public class ABC {
	 public static void main(String args[]){
			Scanner sc = new Scanner(System.in);
			// 整数の入力
			String input1 = sc.next();
			String input2 = sc.next();
			int a = new Integer(input1).intValue();
			int b = new Integer(input2).intValue();
			
				if(a == b) System.out.println("EQUAL");
				if(a>b)System.out.println("GREATER");
				if(a<b)System.out.println("LESS");
		  }

}


Compiler output:
Main.java:4: error: class ABC is public, should be declared in a file named ABC.java
public class ABC {
       ^
Main.java:10: warning: [removal] Integer(String) in Integer has been deprecated and marked for removal
			int a = new Integer(input1).intValue();
			        ^
Main.java:11: warning: [removal] Integer(String) in Integer has been deprecated and marked for removal
			int b = new Integer(input2).intValue();
			        ^
1 error
2 warnings
Language: C++

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

using namespace std;
int main() {
	string a, b;
	int c=0;
	cin >> a >> b;
	for (int i = 0; i < min(a.size(), b.size());i++) {
		if (a[i] < b[i]) {
			c = 1;
			break;
		}
		else if (a[i] > b[i]) {
			c = 2;
			break;
		}
	}
	if (a.size() < b.size()) {
		c = 1;
		break;
	}
	if (a.size() > b.size()) {
		c = 2;
		break;
	}
	if (c == 1) {
		cout << "LESS" << endl;
	}
	else if (c == 2) {
		cout << "GREATER" << endl;
	}
	else if (c == 0) {
		cout << "EQUAL" << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:17: error: break statement not within loop or switch
   22 |                 break;
      |                 ^~~~~
a.cc:26:17: error: break statement not within loop or switch
   26 |                 break;
      |                 ^~~~~
Language: C

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

int main(){
   char one[100] = {0};
   char two[100] = {0};
   int length i = 0;
   int length j = 0;
   int x;
   char buffer;
   scanf("%c",&buffer);
   while(buffer != '\n'){
        one[i] = buffer;
        i++;
        scanf("%c",&buffer);
   }
   scanf("%c",&buffer);
   while(buffer >= '0' || buffer <= '9'){
       two[j] = buffer;
      j++;
      scanf("%c",&buffer);
   }

   if(i > j){
       printf("GREATER\n");
   }else if(i < j){
       printf("LESS\n");
   }else{
       while(i >=0){
          x = j-i;
          if(one[x] > two[x]) {printf("GREATER\n"); break;}
          if(two[x] > one[x]) {printf("LESS\n"); break;}
          i--;
          if(i<0) printf("EQUAL\n");
      }
   }
   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'i'
    7 |    int length i = 0;
      |               ^
main.c:7:15: error: 'i' undeclared (first use in this function)
main.c:7:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'j'
    8 |    int length j = 0;
      |               ^
main.c:8:15: error: 'j' undeclared (first use in this function)
Language: C++

#incldue<bits/stdc++.h>
using namespace std;
int main(){
 int a,b;
 cin>>a>>b;
 if(a>b)cout<<"GREATER"<<endl;
 else if(a==b)cout<<"EQUAL"<<endl;
 else cout<<"LESS"<<endl;
 return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #incldue; did you mean #include?
    1 | #incldue<bits/stdc++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:5:2: error: 'cin' was not declared in this scope
    5 |  cin>>a>>b;
      |  ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #incldue<bits/stdc++.h>
a.cc:6:9: error: 'cout' was not declared in this scope
    6 |  if(a>b)cout<<"GREATER"<<endl;
      |         ^~~~
a.cc:6:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:6:26: error: 'endl' was not declared in this scope
    6 |  if(a>b)cout<<"GREATER"<<endl;
      |                          ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #incldue<bits/stdc++.h>
a.cc:7:15: error: 'cout' was not declared in this scope
    7 |  else if(a==b)cout<<"EQUAL"<<endl;
      |               ^~~~
a.cc:7:15: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:7:30: error: 'endl' was not declared in this scope
    7 |  else if(a==b)cout<<"EQUAL"<<endl;
      |                              ^~~~
a.cc:7:30: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
a.cc:8:7: error: 'cout' was not declared in this scope
    8 |  else cout<<"LESS"<<endl;
      |       ^~~~
a.cc:8:7: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:8:21: error: 'endl' was not declared in this scope
    8 |  else cout<<"LESS"<<endl;
      |                     ^~~~
a.cc:8:21: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: Java

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String num1 = in.next();
		String num2 = in.next();
		Compare com = new Main();
		int result = com.Compare(num1, num2);
		String display = "";
		if (result == -1) {
			display = "LESS";
		}else if (result == 1) {
			display = "GREATER";
		} else {
			display = "EQUAL";
		}
		System.out.println(display);
	}
	
	private int Compare(String num1, String num2) {
		// TODO Auto-generated method stub
		int len1 = num1.length();
		int len2 = num2.length();
		if (len1 < len2) {
			return -1;
		}else if (len1 > len2) {
			return 1;
		}else {
			int i = 0;
			while (i < len1) {
				if (num1.charAt(i) > num2.charAt(i)) {
					return 1;
				}else if(num1.charAt(i) < num2.charAt(i)){
					return -1;
				}
				i++;
			}
		}
		return 0;
	}
}

Compiler output:
Main.java:8: error: cannot find symbol
		Compare com = new Main();
		^
  symbol:   class Compare
  location: class Main
1 error
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<queue>
#include<vector>
#include<map>

#define For(i,a,b) for(int i=a;i<=b;i++)
#define ForD(i,a,b) for (int i=a;i>=b;i--)
#define LL long long
#define INF (2147483647)
#define sqr(x)	((x)*(x))

using namespace std;

inline int read(){
    int data=0,w=1; char ch=0;
    while (ch!='-'&&(ch<'0'||ch>'9')) ch=getchar();
    if (ch=='-') w=-1,ch=getchar();
    while  (ch>='0' && ch<='9') data=data*10+ch-'0',ch=getchar();
    return data*w;
}

inline void write(int x){
	if(x<0) putchar('-'),x=-x;
    if(x>9) write(x/10);
    putchar(x%10+'0');
} 

int main(){	
	char s1[1000],s2[1000];
	scanf("%s",s1),scanf("%s",s2);
	if (strlen(s1)<strlen(s2))
		puts("LESS");
	else if (strlen(s2)<strlen(s1))
		puts("GREATER");
	if (strlen(s1)==strlen(s2)){
		int t=0;
		For(i,0,strlen(s1)){
			if (s1[i]<s2[i]){
				t=1;break;
			}
			if (s1[i]>s2[i]){
				t=2;break;
			}
		}a
		if (t==1)
			puts("LESS");
		if (t==2)	puts("GREATER");
		if (t==0)	puts("EQUAL");
			
			
	}
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:48:18: error: 'a' was not declared in this scope
   48 |                 }a
      |                  ^
Language: C++

#include<iostream>
#include <string>
#include <algorithm>
using namespace std;
void main()
{
	long A, B;
	cin >> A >>B;
	//cin >> B ;
	if (A < B) {
		cout << "LESS" << endl;
	}
	else if (A == B) {
		cout << "EQUAL" << endl;
	}
	else if (A > B) {
		cout << "GREATER" << endl;
	}
}

Compiler output:
a.cc:5:1: error: '::main' must return 'int'
    5 | void main()
      | ^~~~
Language: C++

#include<iostream>
#include<string>

using namespace std;
int main(){

long long int a,b;
cin>>a>>b;
long long char c=a,d=b;
if(c>d){
cout<<"GREATER"<<endl;
}
if(c<d){
cout<<"LESS"<<endl;
}
if(c==d){
cout<<"EQUAL"<<endl;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:6: error: 'long long' specified with 'char'
    9 | long long char c=a,d=b;
      |      ^~~~
a.cc:9:6: error: 'long long' specified with 'char'
Language: C++

#include<iostream>
#include<string>

using namespace std;
int main(){
long long char a,b;
cin>>a>>b;
if(a>b){
cout<<"GREATER"<<endl;
}
if(a<b){
cout<<"LESS"<<endl;
}
if(a==b){
cout<<"EQUAL"<<endl;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: 'long long' specified with 'char'
    6 | long long char a,b;
      |      ^~~~
a.cc:6:6: error: 'long long' specified with 'char'
Language: C++

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

int main() {
    int a, b;
    scanf("%d%d", &a, &b)l
    if (a > b) printf("GREATER\n");
    else if (a == b) printf("EQUAL\n");
    else printf("LESS\n");
}



Compiler output:
a.cc: In function 'int main()':
a.cc:6:26: error: expected ';' before 'l'
    6 |     scanf("%d%d", &a, &b)l
      |                          ^
      |                          ;
a.cc:8:5: error: 'else' without a previous 'if'
    8 |     else if (a == b) printf("EQUAL\n");
      |     ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
    string A, B; cin >> A >> B;
    ll len = max(A.size(), B.size());
    while (A.size() < len) A = "0" + A;
    while (B.size() < len) B = "0" + B;
    if (A < B) cout << "LESS" << endl;
    else if (A > B) cout << "GREATER" << endl;
    else cout << "EQUAL" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'll' was not declared in this scope
    7 |     ll len = max(A.size(), B.size());
      |     ^~
a.cc:8:23: error: 'len' was not declared in this scope
    8 |     while (A.size() < len) A = "0" + A;
      |                       ^~~
a.cc:9:23: error: 'len' was not declared in this scope
    9 |     while (B.size() < len) B = "0" + B;
      |                       ^~~
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println(a59_b(sc.next(),sc.next()));
    }

    static String a59_b(String i1, String i2) {
        BigInteger b1 = new BigInteger(i1);
        BigInteger b2 = new BigInteger(i2);

        int i = b1.compareTo(b2);
        if (i == -1) {
            return "LESS";
        } else if (i == 1) {
            return "GREATER";
        } else {
            return "EQUAL";
        }
    }
}


Compiler output:
Main.java:10: error: cannot find symbol
        BigInteger b1 = new BigInteger(i1);
        ^
  symbol:   class BigInteger
  location: class Main
Main.java:10: error: cannot find symbol
        BigInteger b1 = new BigInteger(i1);
                            ^
  symbol:   class BigInteger
  location: class Main
Main.java:11: error: cannot find symbol
        BigInteger b2 = new BigInteger(i2);
        ^
  symbol:   class BigInteger
  location: class Main
Main.java:11: error: cannot find symbol
        BigInteger b2 = new BigInteger(i2);
                            ^
  symbol:   class BigInteger
  location: class Main
4 errors
Language: C++

#include <iostream>
using namespace std;
 
int main(void){
  char A,B;
  cin >> A >> B;
  if(A.length() > B.length())
    cout << "GREATER" << endl;  
  else if(A.length() < B.length())
    cout << "LESS" << endl;
  else{
    if(+A == +B)
      cout << "EQUAL" << endl;
    else if(+A > +B)
      cout << "GREATER" << endl;
   else if(+A < +B)
     cout << "LESS" << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: request for member 'length' in 'A', which is of non-class type 'char'
    7 |   if(A.length() > B.length())
      |        ^~~~~~
a.cc:7:21: error: request for member 'length' in 'B', which is of non-class type 'char'
    7 |   if(A.length() > B.length())
      |                     ^~~~~~
a.cc:9:13: error: request for member 'length' in 'A', which is of non-class type 'char'
    9 |   else if(A.length() < B.length())
      |             ^~~~~~
a.cc:9:26: error: request for member 'length' in 'B', which is of non-class type 'char'
    9 |   else if(A.length() < B.length())
      |                          ^~~~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;

int main(){
    string a,b;
    cin>>a>>b;
    if(a.size()>b.size())cout<<"GREATER"<<endl;
    else if(a>b)cout<<"GREATER"<<endl;
    else if(a==b)cout<<"EQUAL"<<endl;
    else if(a<b)<<"LESS"<<endl;
    
    
    return 0;
    
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:17: error: expected primary-expression before '<<' token
   23 |     else if(a<b)<<"LESS"<<endl;
      |                 ^~
Language: Java

import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class TaskB {

  public static void main(String[] args) {
      Scanner in = new Scanner(System.in);
      int result;
      String a = in.nextLine();
      String b = in.nextLine();

      BigInteger aa = new BigInteger(a);
      BigInteger bb = new BigInteger(b);

      result = aa.compareTo(bb);

      if (result == 0) {
        System.out.println("EQUAL");
      } else if (result == 1) {
        System.out.println("GREATER");
      } else if (result == -1) {
          System.out.println("LESS");
      }
  }
}


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

import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		String A =scan.next();
		String B =scan.next();
		int a = 0;
		int b = 0;
		int count=0;
		
		if(A.length()>B.length()){
			System.out.println("GREATER");
			System.exit(0);
		}else if (B.length()>A.length()){
			System.out.println("LESS");
			System.exit(0);
		}else if(A.length()==B.length()){
			for(int i =0;i<A.length();i++){
				a= Character.getNumericValue(A.charAt(i));
				b= Character.getNumericValue(B.charAt(i));
				if(a>b){
					System.out.println("GREATER");
					System.exit(0);
				}else if(b>a){
					System.out.println("LESS");
					System.exit(0);
				}else{
					count++;
					if(count==A.length()){
						System.out.println("EQUAL");
					}
				}
			}
		}


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

#include <iostream>
#include <string>

using namespace std;

const int MAX_N = 1000;
char A[MAX_N], B[MAX_N];


void solve() {
	if (strcmp(A, B) > 0) {
		cout << "GREATER" << endl;
	}
	else if (strcmp(A, B) < 0) {
		cout << "LESS" << endl;
	}
	else if (strcmp(A, B) == 0) {
		cout << "EQUAL" << endl;
	}
}

int main()
{
	//入力
	cin >> A >> B;
	solve();
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:11:13: error: 'strcmp' was not declared in this scope
   11 |         if (strcmp(A, B) > 0) {
      |             ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

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

int main() {
  string a, b;
  cin >> a >> b;

  const auto s1 = a.size(), s2 = b.size();
  if (s1 == s2) {
    const auto c = strcmp(a.c_str(), b.c_str());
    if (c < 0) {
      cout << "LESS" << endl;
    } else if (c > 0) {
      cout << "GREATER" << endl;
    } else {
      cout << "EQUAL" << endl;
    }
  } else if (s1 > s2) {
    cout << "GREATER" << endl;
  } else {
    cout << "LESS" << endl;
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:20: error: 'strcmp' was not declared in this scope
   14 |     const auto c = strcmp(a.c_str(), b.c_str());
      |                    ^~~~~~
a.cc:6:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <vector>
  +++ |+#include <cstring>
    6 | using namespace std;
Language: C

include <stdio.h>

int main(void){

  int a,b;

  scanf("%d",&a);
  scanf("%d",&b);

  if(&a>&b){
    printf("GREATER");
  }else if(&a<&b){
    printf("LESS");
  }else{
    printf("EQUAL");
  }

  printf("\n");

  return 0;

}

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
Language: C

include <stdio.h>

int main(void){

  int a,b;

  scanf("%d",&a);
  scanf("%d",&b);

  if(a>b){
    printf("GREATER");
  }else if(a<b){
    printf("LESS");
  }else{
    printf("EQUAL");
  }

  printf("\n");

  return 0;
  return 0;

}

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
Language: C++

#include <cstdio>
using namespace std;

int main(){
    long double A, B;
    scanf("%Lf\n%Lf", &A, &B);
    if (A > B) printf("GREATER\n");
    else if (A < B) printf("LESS\n");
    else if (A == B) printf("EQUAL\n");
    return 0;
}
[ohwa

Compiler output:
a.cc:12:1: error: expected unqualified-id before '[' token
   12 | [ohwa
      | ^
Language: C

    #include <stdio.h>
    #include <stdlib.h>
    #include <math.h>
    #include <string.h>
     
    int in(void){
    	int i;scanf("%d",&i);
    	return i;
    }
    long long llin(void){
    	long long i;scanf("%lld",&i);
    	return i;
    }
    void print(int a){
    	printf("%d\n",a);
    }
    void llprint(long long a){
    	printf("%lld\n",a);
    }
    void print2(int a,int b){
    	printf("%d %d\n",a,b);
    }
    long long max(long long a,long long b){
    	return a>b?a:b;
    }
    long long min(long long a,long long b){
    	return a<b?a:b;
    }
     
    int main(void){
    	char a[102],b[102];
    	scanf("%s",a);
    	scanf("%s",b);
    	if(strlen(a)!=strlen(b)){
    		puts(strlen(a)>strlen(b)?"GREATER":"LESS");
    	}
    	else{
    		int i;
    		for(i=0;i<strlen(a);i++){
    			if(a[i]!=b[i]){
    				puts(a[i]>b[i]?"GREATER":"LESS");
    				break;
    			}
    		}if(i==strlen(a)puts("EQUAL");

    	}
    	return 0;
    }

Compiler output:
main.c: In function 'main':
main.c:44:33: error: expected ')' before 'puts'
   44 |                 }if(i==strlen(a)puts("EQUAL");
      |                    ~            ^~~~
      |                                 )
main.c:46:9: error: expected expression before '}' token
   46 |         }
      |         ^
Language: C++

//インクルード
#include <cstdlib>
#include <iostream>
#include <string>
#include <vector>
#include <boost/multiprecision/cpp_int.hpp>

//型宣言
typedef long long ll;
typedef unsigned long long ull;
typedef std::string string;
typedef string answerType;

//変数宣言
boost::multiprecision A;
boost::multiprecision B;
std::vector<string> Ai;
std::vector<string> Bi;
answerType answer;

//関数のプロトタイプ宣言
//入力の取得
void getInput();
//答えを求める
answerType calcAnswer();

//メイン関数
int main() {
	//入力の取得
	getInput();

	//答え
	answerType answer = calcAnswer();

	//答えの出力
	std::cout << answer << std::endl;

	//正常終了
	return EXIT_SUCCESS;
}

//入力の取得
void getInput() {
	std::cin >> A >> B;
}

//答えを求める
answerType calcAnswer() {
	if(A > B) {
		return "GREATER";
	}
	if(A < B) {
		return "LESS";
	}
	return "EQUAL";
}


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

#include <bits/stdc>
using namespace std;
 
int main(void){
    string A, B;
    cin >> A >> B;
 
    int a = A.size();
    int b = B.size();
 
    if(a>b){
        cout << "GREATER" << endl;
        return 0;
    }else if(a<b){
        cout << "LESS" << endl;
        return 0;
    }
    for(int i=a-1; i>=0; i--){
        if(A[i]>B[i]){
            cout << "GREATER" << endl;
            return 0;
        }else if(A[i]<B[i]){
            cout << "LESS" << endl;
            return 0;
        }
    }
    cout << "EQUAL" << endl;
    return 0;
}

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

#include <bits/stdc
using namespace std;

int main(void){
    string A, B;
    cin >> A >> B;

    int a = A.size();
    int b = B.size();

    if(a>b){
        cout << "GREATER" << endl;
        return 0;
    }else if(a<b){
        cout << "LESS" << endl;
        return 0;
    }
    for(int i=a-1; i>=0; i--){
        if(A[i]>B[i]){
            cout << "GREATER" << endl;
            return 0;
        }else if(A[i]<B[i]){
            cout << "LESS" << endl;
            return 0;
        }
    }
    cout << "EQUAL" << endl;
    return 0;
}


Compiler output:
a.cc:1:20: error: missing terminating > character
    1 | #include <bits/stdc
      |                    ^
a.cc:1:10: fatal error: bits/stdc: No such file or directory
    1 | #include <bits/stdc
      |          ^
compilation terminated.
Language: Java

import java.util.Scanner;

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

		String s1 = in.next();
		String s2 = in.next();
		in.close();

		if(s1.length() > s2.length()) {
			System.out.println("Greater");
		} else if(s1.length() < s2.length()) {
			System.out.println("LESS");
		}

		else if(s1.compareTo(s2) > 0) {
			System.out.println("Greater");
		} else if(s1.compareTo(s2) < 0) {
			System.out.println("LESS");
		} else {
			System.out.println("EQUAL");
		}
	}
}

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

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

int main(void)
{
	string A, B;
	cin >> A >> B;

	if (A.length() > B.length()) {
		while (B.length() < A.length()) {
			B = "0" + B;
		}
	} else {
		while (A.length() < B.length()) {
			A = "0" + A;
		}
	}

	if (strcmp(A.c_str(), B.c_str()) > 0) {
		cout << "GREATER" << endl;
	} else if (strcmp(A.c_str(), B.c_str()) < 0) {
		cout << "LESS" << endl;
	} else {
		cout << "EQUAL" << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:13: error: 'strcmp' was not declared in this scope
   20 |         if (strcmp(A.c_str(), B.c_str()) > 0) {
      |             ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

int main() {
  int A, B;
  cin >> A >> B;
  if (A - B > 0) {
    cout << "GREATER" << endl;
  } else if (A - B == 0) {
    cout << "EQUAL" << endl;
  } else {
    cout << "LESS" << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin >> A >> B;
      |   ^~~
a.cc:5:5: error: 'cout' was not declared in this scope
    5 |     cout << "GREATER" << endl;
      |     ^~~~
a.cc:5:26: error: 'endl' was not declared in this scope
    5 |     cout << "GREATER" << endl;
      |                          ^~~~
a.cc:7:5: error: 'cout' was not declared in this scope
    7 |     cout << "EQUAL" << endl;
      |     ^~~~
a.cc:7:24: error: 'endl' was not declared in this scope
    7 |     cout << "EQUAL" << endl;
      |                        ^~~~
a.cc:9:5: error: 'cout' was not declared in this scope
    9 |     cout << "LESS" << endl;
      |     ^~~~
a.cc:9:23: error: 'endl' was not declared in this scope
    9 |     cout << "LESS" << endl;
      |                       ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

 int main(int argc, char const *argv[])
{
	string s1, s2,s3;

	cin>>s1>>s2;

	bool f = false;

	if(s1 == s2) {
		cout<<"EQUAL"<<endl;

		return 0;
	}

	if(s1.size()>s2.size()) f = true;
	else if(s1.size() == s2.size() && (s1>s2) f = true;

	if(f)
	{
		cout<<"GREATER";
		return 0;
	}
	else
	{
		cout<<"LESS";
		return 0;
	}



}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:20:50: error: expected ';' before 'f'
   20 |         else if(s1.size() == s2.size() && (s1>s2) f = true;
      |                                                  ^~
      |                                                  ;
a.cc:22:9: error: expected primary-expression before 'if'
   22 |         if(f)
      |         ^~
a.cc:20:60: error: expected ')' before 'if'
   20 |         else if(s1.size() == s2.size() && (s1>s2) f = true;
      |                ~                                           ^
      |                                                            )
   21 | 
   22 |         if(f)
      |         ~~                                                  
a.cc:35:1: error: expected primary-expression before '}' token
   35 | }
      | ^
Language: C++

#include <iostream>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <vector>
#include <string>
#include <set>
#include <map>

using namespace std;

typedef long long ll;

int main()
{
    //freopen("/Users/qianjay/Documents/apac/in", "r", stdin);
    char s1[1024],s2[1024];
    scanf("%s%s",s1,s2);
    if(strcmp(s1, s2)<0)
    {
        cout<<"LESS"<<endl;
    }
    else if(strcmp(s1, s2)==0)cout<<"EQUAL"<<endl;
    else cout<<"GREATER"<<endll;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:27: error: 'endll' was not declared in this scope
   27 |     else cout<<"GREATER"<<endll;
      |                           ^~~~~
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;

public class ProblemB {
    public static void main(String[] args) throws IOException {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        String line = input.readLine();
        BigInteger A = new BigInteger(line);
        line = input.readLine();
        BigInteger B = new BigInteger(line);

        if (A.compareTo(B)==1) {
            System.out.println("GREATER");
        } else if (A.compareTo(B)==-1) {
            System.out.println("LESS");
        } else {
            System.out.println("EQUAL");
        }
    }
}


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

#include<bits/stdc++.h>
using namespace std;
#include<atcoder/all>
using namespace atcoder;
using ll = long long;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define VIEW(x) do {cerr << #x << ": "; for(auto i : x) cerr << i << " "; cerr << endl;} while(0)
#define ALL(x) (x).begin(),(x).end()
template<class T>bool umax(T &a, const T &b) {if(a<b){a=b;return 1;}return 0;}
template<class T>bool umin(T &a, const T &b) {if(b<a){a=b;return 1;}return 0;}

template<typename A,size_t N,typename T> void FILL(A (&array)[N],const T &val){fill((T*)array,(T*)(array+N),val);}
template<typename T> void FILL(vector<T> &v, const T &x) {fill(v.begin(), v.end(), x);}
template<typename T> void FILL(vector<vector<T>> &v, const T &x) {for(auto &i:v)fill(i.begin(), i.end(), x);}

int main() {
  int n; cin >> n;
  vector<int> a(n);
  rep(i,n) cin >> a[i];

  ll ans_p = 0;
  ll sum_p = 0;
  rep(i, n) {
    if(i%2) { // -
      if(sum_p + a[i] < 0) {
        sum_p += a[i];
      }
      else {
        ans_p += (sum_p+a[i]) + 1;
        sum_p = -1;
      }
    }
    else { // +
      if(sum_p + a[i] > 0) {
        sum_p += a[i];
      }
      else {
        ans_p += abs(sum_p+a[i]) + 1;
        sum_p = 1;
      }
    }
  }

  ll ans_m = 0;
  ll sum_m = 0;
  rep(i, n) {
    if(!(i%2)) { // +
      if(sum_m + a[i] < 0) {
        sum_m += a[i];
      }
      else {
        ans_m += (sum_m+a[i]) + 1;
        sum_m = -1;
      }
    }
    else { // -
      if(sum_m + a[i] > 0) {
        sum_m += a[i];
      }
      else {
        ans_m += abs(sum_m+a[i]) + 1;
        sum_m = 1;
      }
    }
  }
  cout << min(ans_m, ans_p) << endl;
}


Compiler output:
a.cc:3:9: fatal error: atcoder/all: No such file or directory
    3 | #include<atcoder/all>
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
using namespace std;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
long long main(void){
   long long n;
   cin >> n;
   long long a[n];
   rep(i,n){
       cin >> a[i];
   }
   long long ans = 1000000000;
   for(long long p=0;p<=1;p++){
       long long tmpans = 0;
       long long sum = 0;
       rep(i,n){
            if(i % 2 == p){
                if(a[i] + sum <= 0){
                    tmpans += 1 - (a[i] + sum);
                    sum = 1;
                }
                else{
                    sum = a[i] + sum;
                }
            }
            else{
                if(a[i] + sum >= 0){
                    tmpans += 1 + a[i] + sum;
                    sum = -1;
                }
                else{
                    sum = a[i] + sum;
                }
           }
       }
       ans = min(ans,tmpans);
   }
   cout << ans << endl;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#includ<bits/stdc++.h>
using namespace std;
int main()
{  int n;
   cin>>n;
  int arr[n];
  for(int i=0;i<n;i++)
      cin>>arr[i];
 int sum=arr[0];
 int sum1,sum2;
 int ans1=0,ans2=0;
 // case 1
    if(sum>0)
    { sum1=sum;
       sum2=-1;
      ans1=0;
     ans2=sum+1;
    }
   else if(sum<0)
   {   sum2=sum;
        sum1=1;
       ans2=0;
     ans1=abs(sum)+1;
   }
  else
  {  sum1=1;
     sum2=1;
    ans2=1;
     ans1=1;
    
  }
 
 for(int i=1;i<n;i++)
      {  if(sum1>0)
      {  sum1=sum1+arr[i]; 
         if(sum1<0)
             continue;
         else
         {  ans1+=sum1+1;
            sum1=-1;
         }
      }
       else
       { sum1=sum1+arr[i];
          if(sum1>0)
             continue;
         else
         {  ans1+=abs(sum1)+1;
            sum1=1;
         }
       }  
    }
 // case 2;
for(int i=1;i<n;i++)
{ if(sum2>0)
      {  sum2=sum2+arr[i]; 
         if(sum2<0)
             continue;
         else
         {  ans2+=sum2+1;
            sum2=-1;
         }
      }
       else
       { sum2=sum2+arr[i];
          if(sum2>0)
             continue;
         else
         {  ans2+=abs(sum2)+1;
            sum2=1;
         }
       }
  
}
 if(ans1<ans2)
    cout<<ans1;
else
   cout<<ans2;
 cout<<endl;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #includ; did you mean #include?
    1 | #includ<bits/stdc++.h>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:5:4: error: 'cin' was not declared in this scope
    5 |    cin>>n;
      |    ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #includ<bits/stdc++.h>
a.cc:23:11: error: 'abs' was not declared in this scope
   23 |      ans1=abs(sum)+1;
      |           ^~~
a.cc:48:19: error: 'abs' was not declared in this scope
   48 |          {  ans1+=abs(sum1)+1;
      |                   ^~~
a.cc:69:19: error: 'abs' was not declared in this scope
   69 |          {  ans2+=abs(sum2)+1;
      |                   ^~~
a.cc:76:5: error: 'cout' was not declared in this scope
   76 |     cout<<ans1;
      |     ^~~~
a.cc:76:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:78:4: error: 'cout' was not declared in this scope
   78 |    cout<<ans2;
      |    ^~~~
a.cc:78:4: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:79:2: error: 'cout' was not declared in this scope
   79 |  cout<<endl;
      |  ^~~~
a.cc:79:2: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:79:8: error: 'endl' was not declared in this scope
   79 |  cout<<endl;
      |        ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #includ<bits/stdc++.h>
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{  int n;
 cin>>n;
 long int arr[n];
 for(int i=0;i<n;i++)
     cin>>arr[i];
 long int sum=arr[0];
 long int ans=0;
 if(sum==0)
 {  if(arr[i]>=0)
 {  ans++;
    sum=-1;
   }
  else
  {  ans++;
     sum=1;
  }
   
 }
 for(int i=1;i<n;i++)
     {  if(sum<0) 
        {
            sum=sum+arr[i];
           if(sum>0)
              continue;
           else
             {  ans+=abs(sum)+1;
           sum=1;
             }  
         }
      else
      {
        sum+=arr[i];
         if(sum<0)
             continue;
         else
         {   ans+=sum+1;
            sum=-1;
         }
      }
     }
     cout<<ans;
}

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

#include<bits/stdc++.h>
using namespace std;
int main()
{  int n;
 cin>>n;
 long int arr[n];
 for(int i=0;i<n;i++)
     cin>>arr[i];
 long int sum=arr[0];
 long int ans=0;
 for(int i=1;i<n;i++)
     {  if(sum<0) 
        {
       sum=sum+arr[i];
        if(sum>0)
            continue;
        else
        {  ans+=abs(sum)+1;
           sum=1;
        } 
        }
      else if
      {
        sum+=arr[i];
         if(sum<0)
             continue;
         else
         {   ans+=sum+1;
            sum=-1;
         }
      }
     }
     cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:7: error: expected '(' before '{' token
   23 |       {
      |       ^
      |       (
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{  int n;
 cin>>n;
 long int arr[n];
 for(int i=0;i<n;i++)
     cin>>arr[i];
 long int sum=arr[0];
 long int ans=0;
 for(int i=1;i<n;i++0
     {  if(sum<0) 
        {
       sum=sum+arr[i];
        if(sum>0)
            continue;
        else
        {  ans+=abs(sum)+1;
           sum=1;
        } 
        }
      else if
      {
        sum+=arr[i];
         if(sum<0)
             continue;
         else
         {   ans+=sum+1;
            sum=-1;
         }
      }
     }
     cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: expected ')' before numeric constant
   11 |  for(int i=1;i<n;i++0
      |     ~               ^
      |                     )
a.cc:11:22: error: expected ';' before '{' token
   11 |  for(int i=1;i<n;i++0
      |                      ^
      |                      ;
   12 |      {  if(sum<0)
      |      ~
Language: C++

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

void input(vector<int>& rvnNum)
{
  int nSize;
  cin >> nSize;
  rvnNum.resize(nSize);

  for (int& rnElm : rvnNum)
    cin >> rnElm;
}

llong calcMinOpeTimes(const vector<int>& cnrvnNum)
{ 
  vector<llong> vnOpeTimes(2);

  for (int nEvnOdd = 0; nEvnOdd < vnOpeTimes.size(); nEvnOdd++)
  {
    llong nOpeTimes = 0;
    llong nCumlSum   = 0;
    for (int n = 0; n < cnrvnNum.size(); n++)
    {
      nCumlSum += cnrvnNum[n];
      if ( n % 2 == nEvnOdd )
        if ( nCumlSum > 0 );
        else
        {
          nOpeTimes += 1 - nCumlSum;
          nCumlSum = 1;
        }
      else
        if ( nCumlSum < 0 );
        else
        {
          nOpeTimes += nCumlSum - (-1);
          nCumlSum = -1;
        }
        else;
    }
    vnOpeTimes[nEvnOdd] = nOpeTimes;
  }
  auto itElm = min_element(begin(vnOpeTimes), end(vnOpeTimes));
  return *itElm;
}

int main()
{
  vector<int> vnNum;

  input(vnNum);
  cout << calcMinOpeTimes(vnNum) << endl;

  return 0;
}

Compiler output:
a.cc: In function 'llong calcMinOpeTimes(const std::vector<int>&)':
a.cc:40:9: error: 'else' without a previous 'if'
   40 |         else;
      |         ^~~~