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

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		long[]a = new long[n];
		
		for(int i = 0; i < n; i++) {
			a[i] = stdIn.nextLong();
		}
		
		long[]s = new long[n+1];
		Arrays.fill(s, 0);
		
		for(int i = 1; i < n+1; i++) {
			s[i] = s[i-1] + a[i-1];
			
		}
		
		Map<Long,Integer> map = new HashMap<>();
		for(int i = 0; i < n+1; i++) {
			if(!map.containsKey(s[i])) {
				map.put(s[i], 1);
			}else {
				map.put(s[i],map.get(s[i])+1);
			}
		}
		
		
		int cnt = 0;
		boolean [] bool = new boolean[n];
		Arrays.fill(bool, false);
		
		
		
		
		for(Long mapkey: map.keySet()) {
			if(map.get(s[mapkey])>1 && !bool[mapkey]) {
				cnt += map.get(s[mapkey])*(map.get(mapkey)-1)/2;
				bool[map.get(s[mapkey])] = true;
			}
		}
		
		
		System.out.println(cnt);
	}

}


Compiler output:
Main.java:42: error: incompatible types: Long cannot be converted to int
			if(map.get(s[mapkey])>1 && !bool[mapkey]) {
			             ^
Main.java:42: error: incompatible types: Long cannot be converted to int
			if(map.get(s[mapkey])>1 && !bool[mapkey]) {
			                                 ^
Main.java:43: error: incompatible types: Long cannot be converted to int
				cnt += map.get(s[mapkey])*(map.get(mapkey)-1)/2;
				                 ^
Main.java:44: error: incompatible types: Long cannot be converted to int
				bool[map.get(s[mapkey])] = true;
				               ^
4 errors
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<list>
#include<cstdint>
//#include<bits/stdc++.h>
#include"stdc++.h"
#include<queue>
#include<set>

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep_r(i, n) for(int i = n-1; i >= 0; i--)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i++)
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((ll)(x).size())
#define bit(n) (1LL<<(n))
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

#define INF bit(60)
#define pb push_back
#define mod 1000000007

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 (b<a) { a=b; return 1; } return 0; }

using namespace std;
using uif=uint_fast64_t;
using ll=long long int;

int qp(int a,ll b){int ans=1;do{if(b&1)ans=1ll*ans*a%mod;a=1ll*a*a%mod;}while(b>>=1);return ans;}
int qp(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}

int gcd(int a,int b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

#define FACSIZE 2002

ll invfac[FACSIZE];
ll fac[FACSIZE];

ll mod_pow(ll ,ll );
ll mod_add(ll ,ll );
ll mod_mul(ll ,ll );
ll mod_div(ll ,ll );
void make_fact(ll );
void make_invfact(ll );



int main(void){

  ll n;
  cin>>n;
  vector<ll> A(n);
  rep(i,n) cin>>A[i];

  vector<ll> total(n);
  total[0]=A[0];
  for(ll i=1;i<n;i++) total[i]=total[i-1]+A[i];
  ll ans=0;
  //for(auto x:total) if(x==0) ans++;
  map<ll,ll> m;
  for(auto x:total) m[x]++;

  for(auto p:m){

    if(p.first==0){
      ans+= (p.second)*(p.second+1)/2;
    }
    else{
      ans+= (p.second)*(p.second-1)/2;
    }

  }

  cout << ans << endl;

  return 0;

}

ll mod_pow(ll x,ll r){
  if(r==0) return 1;
  else if(r==1) return x%mod;
  else if(r%2==0){
    ll t=mod_pow(x,r/2)%mod;
    return t*t %mod;
  } 
  else{
    ll t=mod_pow(x,r/2)%mod;
    ll k= t*t %mod;
    return k*x%mod;
  } 
}
ll mod_add(ll a,ll b){
  return (a+b)%mod;
}

ll mod_mul(ll a,ll b){
  return (a*b)%mod;
}

ll mod_div(ll a,ll b){
  return mod_mul(a,mod_pow(b,mod-2));
}

void make_fact(ll n){
  fac[0]=1;
  rep(i,n){
    fac[i+1]=mod_mul(fac[i],i+1);
  }  
}

void make_invfact(ll n){
  invfac[n]= mod_pow( fac[n] ,mod-2);
  for(int i=n-1;i>=0;i--){
    invfac[i]=mod_mul(invfac[i+1],i+1);
  }

}

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

/*raghav0307 - Raghav Gupta*/

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

#define ff first
#define ss second
#define pb push_back
#define fast_io() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define int ll

typedef long long ll;
typedef pair<int, int> pii;
typedef long double ld;

signed main(){
	fast_io();
	map<int, int> mp;
  	int s = 0;
  	mp[s]++;
  	int n;
  	cin >> n;
  	for(int i = 0; i < n; i++){
      int x;
      cin >> x;
   	  s += x;
      mp[s]++;
    }
  	int ans = 0;
  	for(auto x : ans){
      ans += (x.ss*(x.ss-1))/2;
    }
  	cout << ans << "\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:22: error: 'begin' was not declared in this scope
   30 |         for(auto x : ans){
      |                      ^~~
a.cc:30:22: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
                 from a.cc:3:
/usr/include/c++/14/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
In file included from /usr/include/c++/14/filesystem:53,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_dir.h:608:3: note:   'std::filesystem::__cxx11::begin'
  608 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
a.cc:30:22: error: 'end' was not declared in this scope
   30 |         for(auto x : ans){
      |                      ^~~
a.cc:30:22: note: suggested alternatives:
/usr/include/c++/14/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note:   'std::filesystem::__cxx11::end'
  613 |   end(recursive_directory_iterator) noexcept
      |   ^~~
Language: C++

#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10

#solve
def solve():
    n = II()
    a = [0]+LI()
    a = list(itertools.accumulate(a))
    d = defaultdict(int)
    for i in a:
        d[i] += 1
    ans = 0
    for value in d.values():
        ans += value * (value - 1) // 2
    print(ans)
    return


#main
if __name__ == '__main__':
    solve()


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #!
    1 | #!/usr/bin/env python3
      |  ^
a.cc:26:2: error: invalid preprocessing directive #solve
   26 | #solve
      |  ^~~~~
a.cc:41:2: error: invalid preprocessing directive #main
   41 | #main
      |  ^~~~
a.cc:42:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   42 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:2:1: error: 'from' does not name a type
    2 | from collections import defaultdict,deque
      | ^~~~
Language: C++

fun main(args: Array<String>) {
    agc023a()
}

fun agc023a() {
    val n = readLine()!!.toInt()
    val aList = readLine()!!.split(' ').map { it.toLong() }.toLongArray()

    val cumulativeSum = LongArray(n + 1)
    for (i in aList.indices) cumulativeSum[i + 1] = cumulativeSum[i] + aList[i]

    var answer = 0L
    for (left in 0..aList.lastIndex + 1) {
        for (right in left + 1..aList.lastIndex + 1) {
            if (cumulativeSum[right] - cumulativeSum[left] == 0L) answer++
        }
    }

    println(answer)
}


Compiler output:
a.cc:13:18: error: too many decimal points in number
   13 |     for (left in 0..aList.lastIndex + 1) {
      |                  ^~~~~~~~~~~~~~~~~~
a.cc:14:30: error: too many decimal points in number
   14 |         for (right in left + 1..aList.lastIndex + 1) {
      |                              ^~~~~~~~~~~~~~~~~~
a.cc:1:1: error: 'fun' does not name a type
    1 | fun main(args: Array<String>) {
      | ^~~
a.cc:5:1: error: 'fun' does not name a type
    5 | fun agc023a() {
      | ^~~
Language: Java

#include<iostream>
#include<vector>
using namespace std;
int main(){
  int n;
  int count = 0;
  cin >> n;
  vector<int>a(n);
  vector<int>b(n+1);

  for (size_t i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (size_t i = 0; i < n+1; i++) {
    if(b[i]==0){
      b[0] = 0;
    }else{
      b[i] = b[i-1] + a[i-1];
    }
  }
  for (size_t i = 0; i < n+1; i++) {
    for (size_t j = n; j > i; j--) {
      if(b[i] == b[j]){
        count++;
      }
    }
  }
  cout << count <<endl;
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include<iostream>
^
Main.java:2: error: illegal character: '#'
#include<vector>
^
Main.java:7: error: not a statement
  cin >> n;
      ^
Main.java:8: error: not a statement
  vector<int>a(n);
               ^
Main.java:9: error: not a statement
  vector<int>b(n+1);
                ^
Main.java:12: error: not a statement
    cin >> a[i];
        ^
Main.java:28: error: not a statement
  cout << count <<endl;
                ^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
int main(){
^
  (use --enable-preview to enable unnamed classes)
Main.java:8: error: ';' expected
  vector<int>a(n);
              ^
Main.java:8: error: ';' expected
  vector<int>a(n);
                ^
Main.java:9: error: ';' expected
  vector<int>b(n+1);
              ^
Main.java:9: error: ';' expected
  vector<int>b(n+1);
                  ^
12 errors
Language: Java

import java.util.*;
public class SumRange{
  public static void main(String[] args) {
    Scanner sc = new Scanner (System.in);
    int n = sc.nextInt();
    int a[] = new int[n];
    int b[] = new int[n+1];
    int count = 0;
    for(int i=0 ; i<n ; i++){
      a[i] = sc.nextInt();
    }
    for(int i=0 ; i<n+1 ; i++){
      if(i==0){
        b[0] = 0;
        System.out.print(b[i]+" ");
      }else{
        b[i] = b[i-1] + a[i-1];
        System.out.print(b[i]+" ");
      }
    }
    System.out.println();
    
    for(int i=0 ; i<n+1 ; i++){
      for(int j=n ; j>i ; j--){
        if(b[i] == b[j]){
          count++;
        }
      }
    }
    System.out.println(count);
  }
}


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

#include<bits/stdc++.h>
using namespace std;
long s,r,x;
main(n) {
  cin>>n;
  map<long,int> c;
  c[0]=1;
  while(n--)cin>>x,r+=c[s+=x]++;
  cout<<r<<endl;
}


Compiler output:
a.cc:4:5: error: expected constructor, destructor, or type conversion before '(' token
    4 | main(n) {
      |     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
long s,r,x;
int main(int n) {
  cin>>n;
  map<long,int> cnt;
  ll sum=0,res=0;
  cnt[0]=1;
  while(n--)cin>>x,res+=cnt[sum+=x]++;
  cout<<res<<endl;
}


Compiler output:
a.cc:4:5: warning: 'int main(int)' takes only zero or two arguments [-Wmain]
    4 | int main(int n) {
      |     ^~~~
a.cc: In function 'int main(int)':
a.cc:7:3: error: 'll' was not declared in this scope
    7 |   ll sum=0,res=0;
      |   ^~
a.cc:9:20: error: 'res' was not declared in this scope
    9 |   while(n--)cin>>x,res+=cnt[sum+=x]++;
      |                    ^~~
a.cc:9:29: error: 'sum' was not declared in this scope
    9 |   while(n--)cin>>x,res+=cnt[sum+=x]++;
      |                             ^~~
a.cc:10:9: error: 'res' was not declared in this scope
   10 |   cout<<res<<endl;
      |         ^~~
Language: C++

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

int main() {
  int n; cin >> n;
  map<ll, int> cnt;
  ll sum = 0, res = 0;
  cnt[0] = 1;
  while (n--) {
    int x; cin >> x;
    res += cnt[s+=x]++;
  }
  cout << res << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: 's' was not declared in this scope
   12 |     res += cnt[s+=x]++;
      |                ^
Language: C++

##include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
  int n; cin>>n;
  vector<ll> sum(n,0),calc(n+1,0);
  cin>>sum[0];
  calc[0]=calc[1]=0;
  for(int i=1;i<n;i++){
    ll a; cin>>a;
    sum[i]=sum[i-1]+a;
    calc[i+1]=calc[i]+i;
  }
  ll ans=0;
  sort(sum.begin(),sum.end());
  if(sum[0]==0) ans++;
  for(int i=0;i<n;i++){
    int c=1,log=i+1;
    while(log<n){
      if(sum[log]==0) ans++;
      if(sum[i]==sum[log]){
        c++; log++;
      }else break;
    }
    ans+=calc[c];
    i=log-1;
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc:1:1: error: stray '##' in program
    1 | ##include <bits/stdc++.h>
      | ^~
a.cc:1:3: error: 'include' does not name a type
    1 | ##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:6:3: error: 'vector' was not declared in this scope
    6 |   vector<ll> sum(n,0),calc(n+1,0);
      |   ^~~~~~
a.cc:6:12: error: expected primary-expression before '>' token
    6 |   vector<ll> sum(n,0),calc(n+1,0);
      |            ^
a.cc:6:14: error: 'sum' was not declared in this scope
    6 |   vector<ll> sum(n,0),calc(n+1,0);
      |              ^~~
a.cc:6:23: error: 'calc' was not declared in this scope
    6 |   vector<ll> sum(n,0),calc(n+1,0);
      |                       ^~~~
a.cc:15:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   15 |   sort(sum.begin(),sum.end());
      |   ^~~~
      |   short
a.cc:28:3: error: 'cout' was not declared in this scope
   28 |   cout<<ans<<endl;
      |   ^~~~
a.cc:28:14: error: 'endl' was not declared in this scope
   28 |   cout<<ans<<endl;
      |              ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    int N;
    cin >> N;
    vector<ll> a(N);
    for(int i=0; i<N; i++) cin >> a.at(i);

    vector<ll> s(N+1,0);
    map<ll,ll> nums;
    for(int i=0; i<N; i++) s.at(i+1)=s.at(i)+a.at(i);
    for(int i=0; i<N; i++) nums.at(s.at(i)).second++;

    ll res=0;
    for(auto it : nums) {
        long long num=it.second;
        res+=num*(num-1)/2;
    }
    cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:45: error: request for member 'second' in 'nums.std::map<long long int, long long int>::at((*(const std::map<long long int, long long int>::key_type*)(& s.std::vector<long long int>::at(((std::vector<long long int>::size_type)i)))))', which is of non-class type 'std::map<long long int, long long int>::mapped_type' {aka 'long long int'}
   14 |     for(int i=0; i<N; i++) nums.at(s.at(i)).second++;
      |                                             ^~~~~~
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) 
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 1000000007
#define NIL -1
#define FI first
#define SE second
#define MP make_pair
#define PB push_back
#define SZ(x)  (int)x.size()
#define SP(x)  setprecision((int)x)


using namespace std ;
typedef long long ll;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<string> vstr;
typedef pair<int, int> pii;
const int INF = 1e9;
const ll LINF = 1e18;
const double EPS = 1e-9;
ll gcd(ll a, ll b) {return b ? gcd(b, a % b) : a;} //最大公約数
ll lcm(ll a, ll b) {return a / gcd(a, b) * b;} //最小公倍数

//-------------------------------------------------
//コピペするとこ



//-------------------------------------------------


int main()
{
  int n ;
  cin >> n ;
  int ans = 0 ;
  vector<ll> vec(n) ;
  REP(i,n){
    cin >>vec.at(i) ;
  }
  vector<ll> diff(n+1) ;
  diff.at(i) = 0 ;
  REP(i,n){
    diff.at(i+1) = vec.at(i)+diff.at(i) ;
  }
  sort(ALL(diff)) ;
  REP(i,n){
    if(diff.at(i)==diff.at(i+1)){
      ans++ ;
    }
  }
  cout <<ans <<endl;
  
  
  return 0 ;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:47:11: error: 'i' was not declared in this scope
   47 |   diff.at(i) = 0 ;
      |           ^
Language: C++

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

int main(){
    int N;
    cin >> N;
    vector<long long> A(N);
    vector<long long> s(N+1, 0);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
        s[i+1] = s[i]+A[i];
    }

    sort(s.begin(), s.end());
    s.push_back(s[n]-1);

    int cnt = 0;
    long long now = s[0], ans = 0;
    for (int i = 0; i < s.size(); i++) {
        if (s[i] == now) {
            cnt++;
        } else {
            ans += cnt*(cnt-1)/2;
            cnt = 1;
            now = s[i];
        }
    }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:19: error: 'n' was not declared in this scope
   15 |     s.push_back(s[n]-1);
      |                   ^
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef long double ld;

int table[20001][20001]

int comb(int n, int k)
{
  for (int i = 0; i <= n; i++)
    table[i][0] = 1;
  for (int i = 1; i <= k; i++)
    table[i][i] = 1;

  for (int i = 2; i <= n; i++)
  {
    for (int j = 1; j < min(i, k + 1); j++)
    {
      table[i][j] = table[i - 1][j - 1] + table[i - 1][j];
    }
  }
  return table[n][k];
}

int main()
{
  int n;
  cin >> n;
  vector<ll> s(n+1);
  s[0] = 0;
  REP(i,n){
    ll a;
    cin >> a;
    s[i+1] = s[i] + a;
  }
  unordered_map<ll, int> mp;
  ll ans = 0;
  REP(i,n+1) mp[s[i]]++;
  for(auto itr=mp.begin(); itr!=mp.end(); itr++){
    if(itr->second>1){
      ans += comb(itr->second, 2);
    }
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc:12:1: error: expected initializer before 'int'
   12 | int comb(int n, int k)
      | ^~~
a.cc: In function 'int main()':
a.cc:45:14: error: 'comb' was not declared in this scope; did you mean 'wctomb'?
   45 |       ans += comb(itr->second, 2);
      |              ^~~~
      |              wctomb
Language: C++

#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
int main() {
  long long int a,b,c[200100],d[210000],e,f,g[110],h[110];
  cin >>a;
  e=0,f =0;
  for(int i=0;i<a;i++)
    cin >> c[i];
 for(int j=0;j<a;j++){
   d[j] = 0;
 }
     
  
  for(int i =0;i<a;i++){
   
    d[i+1] =d[i]+c[i];
  }
    
  sort(d,d+a);
  
  for(int i=f;i<a;i++){
    
    if(d[i] == d[i+1]){
      for(int j =i;i<a;i++){
      if(d[i] != d[i+j]){
        e +=(j-1)*j/2;
         f = i+j;
      }
      }
    }
  }
  cout << e << endl;
        
        
      
      }
      }
    }
    cout << "0" << endl;
  }
        
  


Compiler output:
a.cc:38:7: error: expected declaration before '}' token
   38 |       }
      |       ^
a.cc:39:5: error: expected declaration before '}' token
   39 |     }
      |     ^
a.cc:40:5: error: 'cout' does not name a type
   40 |     cout << "0" << endl;
      |     ^~~~
a.cc:41:3: error: expected declaration before '}' token
   41 |   }
      |   ^
Language: C

#include <stdio.h>

int main(void) {
  int n;
  scanf("%d", &n);

  int a[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }

  int zero_sum = 0;
  for (int start = 0; start < n; start++) {
    for (int end = start+1; end < n; end++) {
      int sum = 0;
      for (int i = start; i <= end; i++) {
        sum += a[i];
      }
      if (sum == 0) {
        zero_sum++;
      }
    }
  }

  printf("%d", zero_zum);

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:25:16: error: 'zero_zum' undeclared (first use in this function); did you mean 'zero_sum'?
   25 |   printf("%d", zero_zum);
      |                ^~~~~~~~
      |                zero_sum
main.c:25:16: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define all(a)  (a).begin(),(a).end()
typedef long long ll;
const ll mod=1000000007;
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)

int main() {
  int n;cin>>n;
  map<ll, LL> mp;
  mp[0] = 1LL;
  ll sum = 0LL;
  repi(i,0,n){
    ll tmp; cin>> tmp;
    sum += tmp;
    if(mp.find(sum) == mp.end()){
      mp[sum] = 1LL;
    } else {
      mp[sum] += 1LL;
    }
  }
  ll cnt = 0LL;
  for (auto const& ele: mp) {
    if(ele.second > 1LL) cnt += ele.second*(ele.second - 1LL)/2LL;
  }
  cout << cnt << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: 'LL' was not declared in this scope; did you mean 'll'?
   10 |   map<ll, LL> mp;
      |           ^~
      |           ll
a.cc:10:13: error: template argument 2 is invalid
   10 |   map<ll, LL> mp;
      |             ^
a.cc:10:13: error: template argument 4 is invalid
a.cc:11:5: error: invalid types 'int[int]' for array subscript
   11 |   mp[0] = 1LL;
      |     ^
a.cc:16:11: error: request for member 'find' in 'mp', which is of non-class type 'int'
   16 |     if(mp.find(sum) == mp.end()){
      |           ^~~~
a.cc:16:27: error: request for member 'end' in 'mp', which is of non-class type 'int'
   16 |     if(mp.find(sum) == mp.end()){
      |                           ^~~
a.cc:17:9: error: invalid types 'int[ll {aka long long int}]' for array subscript
   17 |       mp[sum] = 1LL;
      |         ^
a.cc:19:9: error: invalid types 'int[ll {aka long long int}]' for array subscript
   19 |       mp[sum] += 1LL;
      |         ^
a.cc:23:25: error: 'begin' was not declared in this scope
   23 |   for (auto const& ele: mp) {
      |                         ^~
a.cc:23:25: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
                 from a.cc:1:
/usr/include/c++/14/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
In file included from /usr/include/c++/14/filesystem:53,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_dir.h:608:3: note:   'std::filesystem::__cxx11::begin'
  608 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
a.cc:23:25: error: 'end' was not declared in this scope
   23 |   for (auto const& ele: mp) {
      |                         ^~
a.cc:23:25: note: suggested alternatives:
/usr/include/c++/14/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note:   'std::filesystem::__cxx11::end'
  613 |   end(recursive_directory_iterator) noexcept
      |   ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define all(a)  (a).begin(),(a).end()
typedef long long ll;
const ll mod=1000000007;
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)

int main() {
  int n;cin>>n;
  map<ll, LL> mp;
  mp[0LL] = 1LL;
  ll sum = 0LL;
  repi(i,0,n){
    ll tmp; cin>> tmp;
    sum += tmp;
    if(mp.find(sum) == mp.end()){
      mp[sum] = 1LL;
    } else {
      mp[sum] += 1LL;
    }
  }
  ll cnt = 0LL;
  for (auto const& ele: mp) {
    if(ele.second > 1LL) cnt += ele.second*(ele.second - 1LL)/2LL;
  }
  cout << cnt << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: 'LL' was not declared in this scope; did you mean 'll'?
   10 |   map<ll, LL> mp;
      |           ^~
      |           ll
a.cc:10:13: error: template argument 2 is invalid
   10 |   map<ll, LL> mp;
      |             ^
a.cc:10:13: error: template argument 4 is invalid
a.cc:11:5: error: invalid types 'int[long long int]' for array subscript
   11 |   mp[0LL] = 1LL;
      |     ^
a.cc:16:11: error: request for member 'find' in 'mp', which is of non-class type 'int'
   16 |     if(mp.find(sum) == mp.end()){
      |           ^~~~
a.cc:16:27: error: request for member 'end' in 'mp', which is of non-class type 'int'
   16 |     if(mp.find(sum) == mp.end()){
      |                           ^~~
a.cc:17:9: error: invalid types 'int[ll {aka long long int}]' for array subscript
   17 |       mp[sum] = 1LL;
      |         ^
a.cc:19:9: error: invalid types 'int[ll {aka long long int}]' for array subscript
   19 |       mp[sum] += 1LL;
      |         ^
a.cc:23:25: error: 'begin' was not declared in this scope
   23 |   for (auto const& ele: mp) {
      |                         ^~
a.cc:23:25: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
                 from a.cc:1:
/usr/include/c++/14/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
In file included from /usr/include/c++/14/filesystem:53,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_dir.h:608:3: note:   'std::filesystem::__cxx11::begin'
  608 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
a.cc:23:25: error: 'end' was not declared in this scope
   23 |   for (auto const& ele: mp) {
      |                         ^~
a.cc:23:25: note: suggested alternatives:
/usr/include/c++/14/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note:   'std::filesystem::__cxx11::end'
  613 |   end(recursive_directory_iterator) noexcept
      |   ^~~
Language: C++

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

int main(){
  int n; cin>>n;
  vector<long long> a(n),s(n+1,0);
  for(int i=0;i<n;i++){
    cin>>a[i];
    s[i+1]=s[i]+a[i];
  }
  
  sort(s.begin(),s.end());
  
  for(int i=0;i<=n;i++){
    long long cp = s[i];
    int res=1;
    while(cp==s[i+1]&&i<=n){
      i++;
      res++;
    }
    ans+=res*(res-1)/2;
  }
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   21 |     ans+=res*(res-1)/2;
      |     ^~~
      |     abs
a.cc:23:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod=1e9+7;
#define int long long
int main() {
    int N;
	cin >> N;
	vector<int> vec(N);
	for(int i = 0;i < N;i++) {
		cin >> vec.at(i);
	}
	vector<int> count(N + 1);
	map<int,int> ma;
	count.at(0) = 0;
	for(int i = 0;i < N;i++) {
		count.at(i + 1) = count.at(i) + vec.at(i);
	}
	for(int i = 0;i < N + 1;i++) {
		ma[count.at(i)]++;
	}
	int answer = 0;
	for(auto x : ma) {
		auto value = x.second;
		answer += value * (value - 1) / 2;
	}
	cout << answer << endl;
}

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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,a=0;cin>>n;
  vector<int>p(n);
  for(int i=0;i<n;i++)cin>>p.at(i);
  for(int i=1;i<=n;i++){
    for(int j=0;j<=n-i;j++){
      long int s=0;
      for(int k=j;k<j+i;k++)s+=p.at(k);
      if(s==0)a++;
    }
  }
  cout<<a<<endl;

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

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(a,b) for (int (a) = 0; (a) < (b); (a)++)
int main() {
    int n; cin >> n;
    int a[n]; for (int i = 0; i< n; i++) {cin >> a[i];}
    int b[n]; b[0] = a[0]; for (int i = 1; i< n; i++) b[i] = b[i-1] + a[i];
    map<int,int> cnt;
    cnt[0]++;
    for (int i = 0; i < n; i++) {
        cnt[b[i]]++;
    }
    int ans = 0;
    for (auto&& A : cnt) {
        ans += A.second * (A.second - 1) / 2;
    }
    cout << ans << endl;
}


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

#include <stdio.h>
#include <stdlib.h>
int cmp(const int *a,const int *b){
  return *a-*b;
}
int main(){
  int i,n,a[200001]={0},b,c=0;
  scanf("%d",&n);
  for(i=1;i<=n;i++){
    scanf("%d",&b);
    a[i]=a[i-1]+b;
  }
  qsort(a,n,sizeof(int),cmp);
  for(i=1;i<n;i++)for(j=i+1;j<=n;j++)if(a[i]==a[j])c++;
  printf("%d",c);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:25: error: passing argument 4 of 'qsort' from incompatible pointer type [-Wincompatible-pointer-types]
   13 |   qsort(a,n,sizeof(int),cmp);
      |                         ^~~
      |                         |
      |                         int (*)(const int *, const int *)
In file included from main.c:2:
/usr/include/stdlib.h:971:34: note: expected '__compar_fn_t' {aka 'int (*)(const void *, const void *)'} but argument is of type 'int (*)(const int *, const int *)'
  971 |                    __compar_fn_t __compar) __nonnull ((1, 4));
      |                    ~~~~~~~~~~~~~~^~~~~~~~
main.c:14:23: error: 'j' undeclared (first use in this function)
   14 |   for(i=1;i<n;i++)for(j=i+1;j<=n;j++)if(a[i]==a[j])c++;
      |                       ^
main.c:14:23: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <stdlib.h>
int cmp(const int *a,const int *b){
  return *a-*b;
}
int main(){
  int i,n,a[200001]={0},b,c=0;
  scanf("%d",&n);
  for(i=1;i<=n;i++){
    scanf("%d",&b);
    a[i]=a[i-1]+b;
  }
  qsort(a,n,sizeof(int),cmp);
  for(i=1;i<=n;i++)if(s[i]==s[i-1])c++;
  printf("%d",c);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:25: error: passing argument 4 of 'qsort' from incompatible pointer type [-Wincompatible-pointer-types]
   13 |   qsort(a,n,sizeof(int),cmp);
      |                         ^~~
      |                         |
      |                         int (*)(const int *, const int *)
In file included from main.c:2:
/usr/include/stdlib.h:971:34: note: expected '__compar_fn_t' {aka 'int (*)(const void *, const void *)'} but argument is of type 'int (*)(const int *, const int *)'
  971 |                    __compar_fn_t __compar) __nonnull ((1, 4));
      |                    ~~~~~~~~~~~~~~^~~~~~~~
main.c:14:23: error: 's' undeclared (first use in this function)
   14 |   for(i=1;i<=n;i++)if(s[i]==s[i-1])c++;
      |                       ^
main.c:14:23: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(i=0;i<n;i++)
int main(){
  int i,N,bf=1,cnt=0,ans=0;
  cin>>N;
  vector<int> a(N),s(N+1,0);
  rep(i,n){
    cin>>a[i];
    s[i+1]=s[i]+a[i];
  }
  sort(s.begin(),s.end());
  rep(i,N+1){
    if(bf==s[i]){
      cnt++;
    }else{
      ans+=cnt*(cnt+1)/2;
      cnt=0;
      bf=s[i];
    }
  }
  ans+=cnt*(cnt+1)/2;
  cout <<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'n' was not declared in this scope
    8 |   rep(i,n){
      |         ^
a.cc:3:28: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(i=0;i<n;i++)
      |                            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(i=0;i<n;i++)
int main(){
  int i,N,bf=1,cnt=0,ans=0;
  cin>>N;
  vector<int> a(N),s(N+1,0);
  rep(i,n){
    cin>>a[i];
    s[i+1]=s[i]+a[i];
  }
  sort(s[i].begin(),s[i].end());
  rep(i,N+1){
    if(bf==s[i]){
      cnt++;
    }else{
      ans+=cnt*(cnt+1)/2;
      cnt=0;
      bf=s[i];
    }
  }
  cout <<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'n' was not declared in this scope
    8 |   rep(i,n){
      |         ^
a.cc:3:28: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(i=0;i<n;i++)
      |                            ^
a.cc:12:13: error: request for member 'begin' in 's.std::vector<int>::operator[](((std::vector<int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   12 |   sort(s[i].begin(),s[i].end());
      |             ^~~~~
a.cc:12:26: error: request for member 'end' in 's.std::vector<int>::operator[](((std::vector<int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   12 |   sort(s[i].begin(),s[i].end());
      |                          ^~~
Language: C++

#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

l comb(ll x,ll y){
	ll tmp=1;
	for(int i=0;i<y;i++) tmp=tmp*(x-i)/(i+1); 
	return tmp;
}

int main(){
	ll N; cin>>N;
  vector<ll> a(N+1,0);
  vector<ll> s(N+1,0);
  for(int i=1;i<=N;i++){
    cin>>a[i];
    s[i]=s[i-1]+a[i];
  }
  sort(s.begin(),s.end());
  ll mem=0,cnt=1;
  ll ans=0;
  for(int i=1;i<=N;i++){
  	if(s[i]==mem) cnt++;
    else{
      	if(cnt>=2) ans+=comb(cnt,2);
    	cnt=1;
      	mem=s[i];
    }
  }
  if(cnt>=2) ans+=comb(cnt,2);
	printf("%lld",ans);
}

Compiler output:
a.cc:6:1: error: 'l' does not name a type; did you mean 'll'?
    6 | l comb(ll x,ll y){
      | ^
      | ll
a.cc: In function 'int main()':
a.cc:26:25: error: 'comb' was not declared in this scope; did you mean 'wctomb'?
   26 |         if(cnt>=2) ans+=comb(cnt,2);
      |                         ^~~~
      |                         wctomb
a.cc:31:19: error: 'comb' was not declared in this scope; did you mean 'wctomb'?
   31 |   if(cnt>=2) ans+=comb(cnt,2);
      |                   ^~~~
      |                   wctomb
Language: C++

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

int main()
{
  int n;
  cin >> n;
  map<long> t;
  long s = 0, count = 0;
  count += t[s];
  for (int i = 0; i < n; i++) {
    int cache;
    cin >> cache;
    s += cache;
    count += t[s];
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: wrong number of template arguments (1, should be at least 2)
    8 |   map<long> t;
      |           ^
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:102:11: note: provided for 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:10:13: error: invalid types 'int[long int]' for array subscript
   10 |   count += t[s];
      |             ^
a.cc:15:15: error: invalid types 'int[long int]' for array subscript
   15 |     count += t[s];
      |               ^
Language: Java

import collections
s = int(input())
a = list(map(int,input().split()))
res = 0
sums = [0]
for i in range(n):
    sums.append(sums[i]+a[i])
counts = collections.Counter(sums)
def comb2(n):
    return (n * (n-1))//2
for i in counts:
    res += comb2(counts[i])
print(res)

Compiler output:
Main.java:1: error: '.' expected
import collections
                  ^
Main.java:2: error: ';' expected
s = int(input())
 ^
2 errors
Language: C++

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

int main() {
    int N;
    cin >> N;
    int A[N], s[N+1];
    rep(i, N) {
        cin >> A[i];
    }
    s[0] = 0;
    rep(i, N) {
        s[i+1] = s[i] + A[i];
    }
    sort(s, s+N+1); 

    int t = s[0];
    int k = 0;
    int c[N+1];
    rep(i, N+1) {
        c[i] = 0;
    }   
a
    rep(i, N+1) {
        if(t < s[i]) {
            t = s[i];
            k++;
            c[k]++;
        } 
        else {
            c[k]++;
        }
    }

    rep(i, N+1) {
        cout << c[i] << "\n";
    }

    ll ans = 0;

    rep(i, N+1) {
        if(c[i] == 0) {
            break;
        }
        ans += (ll)c[i]*(c[i]-1)/2;
    }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:30:1: error: 'a' was not declared in this scope
   30 | a
      | ^
a.cc:31:9: error: 'i' was not declared in this scope
   31 |     rep(i, N+1) {
      |         ^
a.cc:7:34: note: in definition of macro 'rep'
    7 | #define rep(i, n) for(int i = 0; i < n; i++)
      |                                  ^
Language: C++

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

int main() {
    int N;
    cin >> N;
    int A[N], s[N+1];
    rep(i, N) {
        cin >> A[i];
    }
    s[0] = 0;
    rep(i, N) {
        s[i+1] = s[i] + a[i];
    }
    sort(s, s+N+1);

    int t = s[0];
    int k = 0;
    int c[N+1];
    rep(i, N+1) {
        c[i] = 0;
    }

    rep(i, N+1) {
        if(t < s[i]) {
            t = s[i];
            k++;
            c[k]++;
        }
        c[k]++;
    }

    ll ans = 0;

    rep(i, N+1) {
        if(c[i] == 0) {
            break;
        }
        ans += (ll)c[i]*(c[i]-1)/2;
    }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:20:25: error: 'a' was not declared in this scope
   20 |         s[i+1] = s[i] + a[i];
      |                         ^
Language: C++

#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <utility>
#include <cstdio>
#include <vector>
#include <string>
#include <string.h>
#include <queue>
#include <stack>
#include <cmath>
#include <set>
#include <map>
int GCD(int a, int b) {
	return b ? GCD(b, a%b) : a;
}
//sort(a, a + N, greater<int>())   // descend
//sort(a, a+N)                    //  ascend

using ll = long long;
using namespace std;

int main() {
	int n;
	long long a[210000] = {};
	cin >> n;
	vector<ll> b = (0, 0);
	int p = 1;
	int ans = 0;
	for (int i = 0; i < n; i++) cin >> a[i];

	for (int i = 1; i <= n; i++) b.push_back(b[i - 1] + a[i - 1]);

	sort(b.begin(), b.end());

	for (int i = 0; i < n; i++) {
		while (b[i] == b[i + 1]) {
			p++;
			i++;
		}
		ans += p * (p - 1) / 2;
		p = 1;

	}
	cout << ans << endl;
	for (int i = 0; i < n; i++) cout << b[i];
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:28: error: conversion from 'int' to non-scalar type 'std::vector<long long int>' requested
   29 |         vector<ll> b = (0, 0);
      |                            ^
Language: C++

#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <utility>
#include <cstdio>
#include <vector>
#include <string>
#include <string.h>
#include <queue>
#include <stack>
#include <cmath>
#include <set>
#include <map>
int GCD(int a, int b) {
	return b ? GCD(b, a%b) : a;
}
//sort(a, a + N, greater<int>())   // descend
//sort(a, a+N)                    //  ascend

using ll = long long;
using namespace std;

int main() {
	int n;
	long long a[21000]=0;
	cin >> n;
	long long b[21000]=0;
	b[0] = 0;
	int p = 1;
	int ans = 0;
	for (int i = 0; i < n; i++) cin >> a[i];

	for (int i = 1; i <= n; i++) b[i] = b[i - 1] + a[i-1];

	sort(b, b + n+1);

	for (int i = 0; i < n; i++) {
		while (b[i] == b[i + 1]) {
			p++;
			i++;
		}
		ans += p * (p - 1) / 2;
		p = 1;
		
	}
	cout << ans << endl;
	for (int i = 0; i < n; i++) cout << b[i];
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:28: error: array must be initialized with a brace-enclosed initializer
   27 |         long long a[21000]=0;
      |                            ^
a.cc:29:28: error: array must be initialized with a brace-enclosed initializer
   29 |         long long b[21000]=0;
      |                            ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:14:29: error: expected ';' before 'ans'
   14 |     if(a[i] == abs(a[i + 1]) ans++;
      |                             ^~~~
      |                             ;
a.cc:15:3: error: expected primary-expression before '}' token
   15 |   }
      |   ^
a.cc:14:36: error: expected ')' before '}' token
   14 |     if(a[i] == abs(a[i + 1]) ans++;
      |       ~                            ^
      |                                    )
   15 |   }
      |   ~                                 
a.cc:15:3: error: expected primary-expression before '}' token
   15 |   }
      |   ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

signed main(){
	int n;
	cin >> n;
	vector<int> A(n);
	for(int i = 0; i < n; ++i)
		cin >> A[i];
	
	// 10^9が10^5個続いた時とかにintだとオーバーフローする
	vector<long> S(n + 1, 0);
	for(int i = 0; i < n; ++i)
		S[i + 1] = S[i] + A[i];

	long ans = 0;

	for(int i = 0; i <= n; ++i)
		for(int j = i + 1; j <= n; ++j)
			if(s[i] == s[j])
				++ans;
	
	cout << ans << endl;
}


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

#include"stdc++.h"
using namespace std;

#define LL long long
#define VLL vector<long long>
	string strnum = "0123456789";
	string alpS = "abcdefghijklmnopqrstuvwxyz";
	string alpL = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	int sizealp = (int)(alpS.size());
	int mod = 1e9 + 7;
#define SORT(x) sort(x.begin(),x.end())
#define REVE(x) reverse(x.begin(),x.end())
#define rep(i,n) for(int i=0;i<n;i++)
#define COUT(x) cout<<x<<endl
	double pai = 3.1415926535;
	string atc = "atcoder";
	typedef pair<long long, long long> data_t;

	int yuukuriddo(int a, int b) {
		if (b > a) {
			swap(a, b);
		}
		int tmp = a % b;
		if (tmp == 0) {
			return b;
		}
		else {
			yuukuriddo(tmp, b);
		}
	}

int main() {
	LL N;
	cin >> N;
	string s = to_string(N);
	if (s.size() < 3) {
		COUT(0);
		return 0;
	}
	int count = 0;
	int tmp = 0;
	vector<int> ternery(s.size());
	for (int i = 1; i <= pow(3,(int)(s.size())); i++) {
		tmp = 0;
		ternery[0] = i % 3;
		for (int j = 1; j < s.size(); j++) {
			ternery[j] = (i*(int)pow(3, j)) % 3;
		}
		int flag1[3] = { 0,0,0 };
		for (int j = 0; j < s.size(); j++) {
			if (ternery[j] == 0)
				ternery[j] = 3;

			else if (ternery[j] == 1)
				ternery[j] = 5;
			else
				ternery[j] = 7;
		}
		for (int j = 0; j < s.size(); j++) {
			tmp += ternery[j] * (int)pow(10, j);
		}
	}
}

Compiler output:
a.cc:1:9: fatal error: stdc++.h: No such file or directory
    1 | #include"stdc++.h"
      |         ^~~~~~~~~~
compilation terminated.
Language: Java

import java.util.Arrays;
import java.util.Scanner;
public class Main {

	public static void main(String[] args){
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan=new Scanner(System.in);
		long N=scan.nextLong();
		Long A[]=new Long[(int)(N+1)];
		A[0]=(long) 0;
		A[1]=scan.nextLong();
		for(long i=2;i<N+1;i++) {
			long c=scan.nextLong();
			A[(int)i]=A[(int)(i-1)]+c;
		}
		long ans=0;
		Arrays.sort(A);
		long count=0;
		for(long i=1;i<N+1;i++) {
			if(A[(int)i]!=A[(int)(i-1)]) {
				if(co!=0) {
				ans+=(count+1)*count/2;
				count=0;
				}
			}
			else {
				count++;
			}
		}
		ans+=(count+1)*count/2;
		System.out.println(ans);
	}
}


Compiler output:
Main.java:21: error: cannot find symbol
				if(co!=0) {
				   ^
  symbol:   variable co
  location: class Main
1 error
Language: Java

import java.util.Arrays;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		int A[]=new int[N];
		int z=0;
		long sum=0,x=1,ans=0;
		while(z<N){
			A[z]=stdIn.nextInt();
			sum+=A[z];
			A[z]=sum;
			if(A[z]==0)
				ans++;
			z++;
		}z=1;sum=1;
		Arrays.sort(A);
		while(z<N){
			if(A[z]!=A[z-1]){
				ans+=x-sum;
				x=0;sum=0;
			}
			sum++;x+=sum;
			z++;
		}
		ans+=x-sum;
		System.out.println(ans);
	}
}

Compiler output:
Main.java:13: error: incompatible types: possible lossy conversion from long to int
			A[z]=sum;
			     ^
1 error
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <stack>
#include <math.h>
#define rep(i, n) for(int i = 0; i < (n); ++i)
using namespace std;

template<class T> inline bool chmax(T& a, T b){ if(a < b) { a=b; return 1; }return 0;}
template<class T> inline bool chmin(T& a, T b){ if(a > b) { a=b; return 1; }return 0;}

int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
const long long INF = 1LL << 60;
// spring s; cin >> s;
// cout << res << endl;
// --------write my code!!!!!----------//

int main(){
  int N; cin >> N;
  vector<long long> a(N);
  rep(i,N) cin >> a[i];
  
  vector<long long> s(N+1, 0);
  map<long long, long long> nums;
  rep(i,N) s[i+1] = s[i] + a[i];
  rep(i,N+1) nums[s[i]]++;
  
  long long res = 0;
  for(auto it : nums) {
    long long num = it.second;
    res += num * (num-1) / 2;
  }
  cout << res << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:3: error: 'map' was not declared in this scope
   28 |   map<long long, long long> nums;
      |   ^~~
a.cc:10:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
    9 | #include <math.h>
  +++ |+#include <map>
   10 | #define rep(i, n) for(int i = 0; i < (n); ++i)
a.cc:28:7: error: expected primary-expression before 'long'
   28 |   map<long long, long long> nums;
      |       ^~~~
a.cc:30:14: error: 'nums' was not declared in this scope
   30 |   rep(i,N+1) nums[s[i]]++;
      |              ^~~~
a.cc:33:17: error: 'nums' was not declared in this scope
   33 |   for(auto it : nums) {
      |                 ^~~~
Language: C++

#include<bits/stdc++.h>
 
#define endl '\n'
 
using namespace std;
 
int main(){
 
  cin.tie(0); // cout と cin の同期を切る
  ios::sync_with_stdio(false); /* cの stdioストリーム (printfとか)と*/

  long longN;
  
  long long sum[200001];

  cin>>N;

  sum[0]=0;

  long long a[200001];
 
  long long cnt=0;

  for(int i=1;i<=N;i++){
    cin>>a[i];
    sum[i]=(sum[i-1]+a[i]);
    if(sum[i]==0){
      cnt++;
    }
  }
  sort(sum+1,sum+N+1);
 
  long long temp=1;
 
  for(int i=1;i<N;i++){
    if(sum[i]!=sum[i+1]){
      if(temp>=2){
	cnt+=((temp-1)*(1+temp-1)/2);
 
      }
      temp=1;
    }else{
 
      temp++;
 
    }
  }
  if(temp>=2){
    cnt+=((temp-1)*(1+temp-1)/2);
  }
 
  cout<<cnt<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:8: error: 'N' was not declared in this scope
   16 |   cin>>N;
      |        ^
Language: Java

import java.util.Arrays;
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int N=stdIn.nextInt();
		long A[]=new long[N];
		long z=0,y=0,x=1,ans=0;
		while(z<N){
			A[z]=stdIn.nextLong();
			y+=A[z];
			A[z]=y;
			if(A[z]==0)
				ans++;
			z++;
		}z=1;y=1;
		Arrays.sort(A);
		while(z<N){
			if(A[z-1]!=A[z]){
				if(y!=1)
					ans+=x-y;
				y=1;x=1;
			}
			else{
				y++;
				x+=y;
			}
			z++;
		}
		if(y!=1)
			ans+=x-y;
		System.out.println(ans);
	}

}


Compiler output:
Main.java:11: error: incompatible types: possible lossy conversion from long to int
			A[z]=stdIn.nextLong();
			  ^
Main.java:12: error: incompatible types: possible lossy conversion from long to int
			y+=A[z];
			     ^
Main.java:13: error: incompatible types: possible lossy conversion from long to int
			A[z]=y;
			  ^
Main.java:14: error: incompatible types: possible lossy conversion from long to int
			if(A[z]==0)
			     ^
Main.java:20: error: incompatible types: possible lossy conversion from long to int
			if(A[z-1]!=A[z]){
			      ^
Main.java:20: error: incompatible types: possible lossy conversion from long to int
			if(A[z-1]!=A[z]){
			             ^
6 errors