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

    #include <stdio.h>
    #include <stdlib.h>
     
    int main(void){
    	int num,i,j;
    	int sum =0;
    	int ans = 0;
    	int *A;
    	
    	scanf("%d",&num);
    	A = (int *)malloc(sizeof(int)*num);
    	
    	for(i = 0;i <num ; i++){
    		scanf("%d",&A[i]);
    	}
    	
    	for(i =0 ;i<num ; i++){
    		sum = A[i];
    		for( j = i+1 ; j <num; j++){
    			sum +=A[j];
    			if(sum == 0){
    				ans++;
    			}
    		}
    	}
    	
    	printf("%d\n",ans);
    	
    	free(A);
    	return 0;
    }

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

int main(void){
	int num,i,j;
	int sum =0;
	int ans = 0;
	int *A;
	
	scanf("%d",&num);
	A = (int *)malloc(sizeof(int)*num);
	
	for(i = 0;i <num ; i++){
		scanf("%d",&A[i]);
	}
	
	for(i =0 ;i<num ; i++){
		sum = A[i];
		for( j = i+1 ; j <num; j++){
			sum +=A[j];
			if(sum == 0){
				ans++;
			}
		}
	}
	
	printf("%d\n",ans);
	
	free(A);
	return 0;
}

Submission
問題

Compiler output:
main.c:36:5: error: redefinition of 'main'
   36 | int main(void){
      |     ^~~~
main.c:4:9: note: previous definition of 'main' with type 'int(void)'
    4 |     int main(void){
      |         ^~~~
main.c:65:1: error: unknown type name 'Submission'
   65 | Submission
      | ^~~~~~~~~~
main.c:66:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
   66 | 問題
      | ^~~~
Language: C++

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

int main(void){
	int i,j;
	int num;
	int sum =0;
	int ans = 0;
	double *A;
	
	scanf("%d",&num);
	A = (double *)malloc(sizeof(double)*num);
	
	for(i = 0;i <num ; i++){
		scanf("%lf",&A[i]);
		if(A[i] == ""){
			 return -1;
		}
	}
	
	for(i =0 ;i<num ; i++){
		sum = A[i];
		for( j = i+1 ; j <num; j++){
			sum +=A[j];
			if(sum == 0){
				ans++;
			}
		}
	}
	
	printf("%d\n",ans);
	
	free(A);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:25: error: invalid operands of types 'double' and 'const char [1]' to binary 'operator=='
   16 |                 if(A[i] == ""){
      |                    ~~~~ ^~ ~~
      |                       |    |
      |                       |    const char [1]
      |                       double
Language: C++

#include<iostream>
using namespace std;

#define ll long long
ll n,m,a[500000],b[800000000000000],ans;

int main(){
cin>>n;

for(ll i=0;i<n;i++){
cin>>a[i];
m+=a[i];
b[m+400000000000000]++;
}

for(ll i=0;i<=800000000000000;i++){
ans+=b[i]*(b[i]-1)/2;
}

cout<<ans;
return 0;
}

Compiler output:
/tmp/ccnyrg1e.o: in function `main':
a.cc:(.text+0x125): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccnyrg1e.o
a.cc:(.text+0x12f): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccnyrg1e.o
a.cc:(.text+0x14b): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccnyrg1e.o
collect2: error: ld returned 1 exit status
Language: C

# -*- coding: utf-8 -*-

# 入力を変数に格納
count = int(input())
num_list = [int(i) for i in input().split()]

result = 0
for i in range(count):
    # 合計初期化
    num_sum = 0
    # 前から順番に足していって0になるやつを探す
    for num in num_list:
        num_sum += num
        
        if num_sum == 0:
            result += 1
    # 最初の要素を削除
    num_list.pop(0)

print(result)

Compiler output:
main.c:1:3: error: invalid preprocessing directive #-
    1 | # -*- coding: utf-8 -*-
      |   ^
main.c:3:3: error: invalid preprocessing directive #\U00005165\U0000529b\U00003092\U00005909\U00006570\U0000306b\U0000683c\U00007d0d
    3 | # 入力を変数に格納
      |   ^~~~~~~~~~~~~~~~
main.c:4:1: warning: data definition has no type or storage class
    4 | count = int(input())
      | ^~~~~
main.c:4:1: error: type defaults to 'int' in declaration of 'count' [-Wimplicit-int]
main.c:4:9: error: expected expression before 'int'
    4 | count = int(input())
      |         ^~~
main.c:9:7: error: invalid preprocessing directive #\U00005408\U00008a08\U0000521d\U0000671f\U00005316
    9 |     # 合計初期化
      |       ^~~~~~~~~~
main.c:11:7: error: invalid preprocessing directive #\U0000524d\U0000304b\U00003089\U00009806\U0000756a\U0000306b\U00008db3\U00003057\U00003066\U00003044\U00003063\U000030660\U0000306b\U0000306a\U0000308b\U00003084\U00003064\U00003092\U000063a2\U00003059
   11 |     # 前から順番に足していって0になるやつを探す
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:17:7: error: invalid preprocessing directive #\U00006700\U0000521d\U0000306e\U00008981\U00007d20\U00003092\U0000524a\U00009664
   17 |     # 最初の要素を削除
      |       ^~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <cassert>

int main() {
	int N, c = 0, D = 0, V;
	std::vector<int> A;
	std::cin >> N;
	for (int i = 0; i < N; i++) {
		std::cin >> A[i];
	}
		for (int j = 0; j < N; j++) {
			V = j;
			while (V < N) {
				bool b = A[j].empty();
				if (b == false) {
				D = A[j];
				if (D == 0) {
					c++;
					D = 0;
				}
				V++;
			}
			}
		}
	std::cout << c << std::endl;
	
	
	
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:47: error: request for member 'empty' in 'A.std::vector<int>::operator[](((std::vector<int>::size_type)j))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   15 |                                 bool b = A[j].empty();
      |                                               ^~~~~
Language: C++

#include <iostream>
#include <vector>
#include <cassert>

int main() {
	int N, c = 0, D = 0, V;
	std::vector<int> A;
	std::cin >> N;
	for (int i = 0; i < N; i++) {
		std::cin >> A[i];
	}
		for (int j = 0; j < N; j++) {
			V = j;
			while (V < N) {
				bool b = A.empty();
				if (b == "false") {
				D = A[j];
				if (D == 0) {
					c++;
					D = 0;
				}
				V++;
			}
			}
		}
	std::cout << c << std::endl;
	
	
	
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:39: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |                                 if (b == "false") {
      |                                     ~~^~~~~~~~~~
Language: C++

// AGC.cpp : アプリケーションのエントリ ポイントを定義します。
//

#include "stdafx.h"
#include <iostream>
#include <queue>

using namespace std;

int main()
{
	int n;
	cin >> n;
	auto a = new int[n];
	for (size_t i = 0; i < n; i++)
	{
		cin >> a[i];
	}
	int count = 0;
	auto q = queue<int>();
	for (size_t i = 0; i < n; i++)
	{
		int f = q.size();
		for (size_t j = 0; j < f; j++)
		{
			long e = q.front();
			q.pop();
			if (e == 0)
			{
				++count;
			}
			q.emplace(e + a[i]);
		}
		q.push(a[i]);
		
	}
	int c = q.size();
	for (size_t i = 0; i < c; ++i)
	{
		long long e = q.front();
		q.pop();
		if (e == 0)
		{
			++count;
		}
	}
	cout << count << endl;

	return 0;
}



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

#include<iostream>
using namespace std;

#define ll long long
ll n,m,M,a[500000],b[800000000000000],ans;

int main(){
cin>>n;

for(ll i=0;i<n;i++){
cin>>a[i];
m+=a[i];
if(m>M)M=m;
ifb[m+400000000000000]++;
}

for(ll i=0;i<=800000000000000;i++){
ans+=b[i]*(b[i]-1)/2;
}

cout<<ans;
return 0;
}

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

#include <iostream>
#include <vector>
#include <cassert>

int main() {
	int N, c = 0, D = 0, V;
	std::vector<int> A;
	std::cin >> N;
	for (int i = 0; i < N; i++) {
		std::cin >> A[i];
	}
		for (int j = 0; j < N; j++) {
			V = j;
			while (V < N) {
				//bool b = A[j].empty();
				if (A[j].empty() == "false") {
				D = A[j];
				if (D == 0) {
					c++;
					D = 0;
				}
				V++;
			}
			}
		}
	std::cout << c << std::endl;
	
	
	
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:42: error: request for member 'empty' in 'A.std::vector<int>::operator[](((std::vector<int>::size_type)j))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   16 |                                 if (A[j].empty() == "false") {
      |                                          ^~~~~
Language: C++

#include <iostream>
#include <vector>
#include <cassert>

int main() {
	int N, c = 0, D = 0, V;
	std::vector<int> A;
	std::cin >> N;
	for (int i = 0; i < N; i++) {
		std::cin >> A[i];
	}
		for (int j = 0; j < N; j++) {
			V = j;
			while (V < N) {
				//bool b = A[j].empty();
				if (A[j].empty() == "false") {
				D = A[j];
				if (D == 0) {
					c++;
					D = 0;
				}
				V++;
			}
			}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:42: error: request for member 'empty' in 'A.std::vector<int>::operator[](((std::vector<int>::size_type)j))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   16 |                                 if (A[j].empty() == "false") {
      |                                          ^~~~~
a.cc:32:2: error: expected '}' at end of input
   32 | }
      |  ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <vector>
#include <cassert>

int main() {
	int N, c = 0, D = 0, V;
	std::vector<int> A;
	std::cin >> N;
	for (int i = 0; i < N; i++) {
		std::cin >> A[i];
	}
		for (int j = 0; j < N; j++) {
			V = j;
			while (V < N) {
				std::bool b = A[j].empty();
				if (b == "false") {
				D = A[j];
				if (D == 0) {
					c++;
					D = 0;
				}
				V++;
			}
			}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:38: error: expected unqualified-id before 'bool'
   15 |                                 std::bool b = A[j].empty();
      |                                      ^~~~
a.cc:16:37: error: 'b' was not declared in this scope
   16 |                                 if (b == "false") {
      |                                     ^
a.cc:32:2: error: expected '}' at end of input
   32 | }
      |  ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <vector>
#include <cassert>

int main() {
	int N, c = 0, D = 0, V;
	std::vector<int> A;
	std::cin >> N;
	for (int i = 0; i < N; i++) {
		std::cin >> A[i];
	}
		for (int j = 0; j < N; j++) {
			V = j;
			while (V < N) {
				bool b = A[j].empty();
				if (b == "false") {
				D = A[j];
				if (D == 0) {
					c++;
					D = 0;
				}
				V++;
			}
			}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:47: error: request for member 'empty' in 'A.std::vector<int>::operator[](((std::vector<int>::size_type)j))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   15 |                                 bool b = A[j].empty();
      |                                               ^~~~~
a.cc:16:39: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |                                 if (b == "false") {
      |                                     ~~^~~~~~~~~~
a.cc:32:2: error: expected '}' at end of input
   32 | }
      |  ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <vector>
#include <cassert>

int main() {
	int N, c = 0, D = 0, V;
	std::vector<int> A;
	std::cin >> N;
	for (int i = 0; i < N; i++) {
		std::cin >> A[i];
	}
		for (int j = 0; j < N; j++) {
			V = j;
			while (V < N) {
				if (A[j].empty == "false") {
				D = A[j];
				if (D == 0) {
					c++;
					D = 0;
				}
				V++;
			}
			}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:42: error: request for member 'empty' in 'A.std::vector<int>::operator[](((std::vector<int>::size_type)j))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   15 |                                 if (A[j].empty == "false") {
      |                                          ^~~~~
a.cc:31:2: error: expected '}' at end of input
   31 | }
      |  ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

#include <iostream>
using namespace std;
 
int main() {
    int N;
    cin >> N;
    int array[N];
    for (int i = 0; i < N; i++)
    {
        cin >> array[i];
    }
    long long int presum[N+1];
    presum[0] = 0;
    for (int i = 0; i < N; i++)
    {
        presum[i+1] = presum[i] + array[i];
    }
    //cout << presum[0] << presum[1] << presum [2] << presum[3] << endl;
    /*
    int8_t bingo[2000000];
    int count = 0;
    for (int i = 0; i <= N; i++)
    {
        //cout << bingo[presum[i] + 100000];
        count += bingo[presum[i] + 1000000];
        bingo[presum[i]+1000000] += 1;
    }
    */

    sort(presum, presum + N + 1);
    int now = presum[0], count = 0, sum = 0;
    for (int i = 1; i < N + 1; i++)
    {
        if (presum[i] == now) {
            count += 1;
        } else {
            count = 0;
            now = presum[i];
        }
        sum += count;
    }
    cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   30 |     sort(presum, presum + N + 1);
      |     ^~~~
      |     short
Language: C++

#include <iostream>
#include <vector>
#include <cassert>

int main() {
	int N, c = 0, D = 0, V;
	std::vector<int> A;
	std::cin >> N;
	for (int i = 0; i < N; i++) {
		std::cin >> A[i];
	}
		for (int j = 0; j < N; j++) {
			V = j;
			while (V < N) {
				if (A.empty == "false") {
				D = A[j];
				if (D == 0) {
					c++;
					D = 0;
				}
				V++;
			}
			}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:39: error: invalid use of member function 'bool std::vector<_Tp, _Alloc>::empty() const [with _Tp = int; _Alloc = std::allocator<int>]' (did you forget the '()' ?)
   15 |                                 if (A.empty == "false") {
      |                                     ~~^~~~~
      |                                            ()
a.cc:31:2: error: expected '}' at end of input
   31 | }
      |  ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

#include <iostream>
using namespace std;
int main(){
	int N;
	int count = 0;
	cin >> N;
	int A[N];
	for(int i = 0 ;i < N ; i++){
		cin >> A[i];
	}
/* 	for(int i =0 ;i < N ; i++){
		cout << A[i];
	}*/

	for(int i = 0; i < N ;i++){
		//A縺ｮ蟋狗せ繧呈欠螳・		int total = A[i]; 
		for(int j = i+1	; j < N ;j++){
			//A縺ｮ邨らせ繧呈欠螳・			total += A[j];
			if(total == 0){
				count++;
			}	
		}
	}
	cout << count << endl;

}	


Compiler output:
a.cc: In function 'int main()':
a.cc:19:28: error: 'total' was not declared in this scope
   19 |                         if(total == 0){
      |                            ^~~~~
Language: C++

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


int count(int N, int A[]) {
	int result = 0;
	int i, j;
	long long sum = 0;
	for (i = 0;i < N;i++) {
		for (j = i;j < N;j++) {
			sum += A[j];
			if (sum == 0)result++;
		}
		sum = 0;
	}
	return result;
}


int main() {
	int N,t;
	int A[200000];
	scanf_s("%d\n",&N);
	int i;
	for (i= 0;i < N;i++) {
		scanf_s("%d ",&t);
		A[i] = t;
	}
	int r = count(N, A);
	cout << r << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   24 |         scanf_s("%d\n",&N);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <iostream>
using namespace std;

int main() {
    // データ読み込み
    int N; //配列長
    cin >> N;
    int a[N+10];  // 最大 2*10**5 個ですが余裕をもたせます
    int res = 0;  // 答えを格納
    for (int i = 0; i < N; ++i) cin >> a[i];

    for (int all = 0; all < (1<<N); all++) // ビットを使ったforループ 0:2**N-1
    {
        int sum = 0;
        for (int size = 0; size < N; size++) // 部分配列のサイズ 0:7-1
        {
            for (int i = 0; i < N; ++i)
            {
                if( all & (1<<i) ) // i番目の要素が部分配列に含まれるか
                {
                    sum += a[i];
                }
            }
        }
        if(sum==0)
        {
            res++;
        }
    cout << res << endl;
    }

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

#include<stdio.h>
#define MAX 200000

int main(void){

int N;
int A[MAX]={0};
int i;

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

int m, n;
int sum, score;

for(m = 0; m < N; m++){
	for(n = m; n < N; n++){
		sum = 0;
		for(i = m; i <= n; i++){
			sum += A[i];
		}
		//printf("%d ", sum);
		if(sum == 0){
			score++;
		}
	}
}

//printf("\nscore=%d\n", score);
pritf("%d\n", score);

return 0;
}

Compiler output:
main.c: In function 'main':
main.c:32:1: error: implicit declaration of function 'pritf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   32 | pritf("%d\n", score);
      | ^~~~~
      | printf
Language: C++

#include <iostream>
using namespace std;

int main() {
    // データ読み込み
    int N; //配列長
    cin >> N;
    int a[N+10];  // 最大 2*10**5 個ですが余裕をもたせます
	int res = 0;  // 答えを格納
    for (int i = 0; i < N; ++i) cin >> a[i];

　　for (int all = 0; all < (1<<N); all++)
	{
		int sum = 0;
		for (int size = 0; size < N; size++)
		{
			for (int i = 0; i < N; ++i)
			{
				if( all & (1<<i) )
				{
					sum += a[i];
				}
			}
		}
		if(sum==0)
		{
			res++;
		}
	cout << res << endl;
	}

Compiler output:
a.cc:12:1: error: extended character 　 is not valid in an identifier
   12 | 　　for (int all = 0; all < (1<<N); all++)
      | ^
a.cc:12:1: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:12:10: error: expected primary-expression before 'int'
   12 | 　　for (int all = 0; all < (1<<N); all++)
      |          ^~~
a.cc:12:23: error: 'all' was not declared in this scope
   12 | 　　for (int all = 0; all < (1<<N); all++)
      |                       ^~~
a.cc:30:10: error: expected '}' at end of input
   30 |         }
      |          ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <iostream>
using namespace std;

int main() {
    // データ読み込み
    int N; //配列長
    cin >> N;
    int a[N+10];  // 最大 2*10**5 個ですが余裕をもたせます
	int res = 0;  // 答えを格納
    for (int i = 0; i < N; ++i) cin >> a[i];

　　for (int all = 0; all < (1<<N); all++) // ビットを使ったforループ 0:2**N-1
	{
		int sum = 0;
		for (int size = 0; size < N; size++) // 部分配列のサイズ 0:7-1
		{
			for (int i = 0; i < N; ++i)
			{
				if( all & (1<<i) ) // i番目の要素が部分配列に含まれるか
				{
					sum += a[i];
				}
			}
		}
		if(sum==0)
		{
			res++;
		}
	cout << res << endl;
	}

Compiler output:
a.cc:12:1: error: extended character 　 is not valid in an identifier
   12 | 　　for (int all = 0; all < (1<<N); all++) // ビットを使ったforループ 0:2**N-1
      | ^
a.cc:12:1: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:12:10: error: expected primary-expression before 'int'
   12 | 　　for (int all = 0; all < (1<<N); all++) // ビットを使ったforループ 0:2**N-1
      |          ^~~
a.cc:12:23: error: 'all' was not declared in this scope
   12 | 　　for (int all = 0; all < (1<<N); all++) // ビットを使ったforループ 0:2**N-1
      |                       ^~~
a.cc:30:10: error: expected '}' at end of input
   30 |         }
      |          ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int A[200000];
int minians;



int main(){
  int ans = 0;
  int n;
  int i =0, j = 0, k = 0;
  cin >> n;
  for(i = 0; i <= n -1; i++){
    cin >> A[i];
  }
  for(j = 0; j <= n - 1; j++){
    minians = 0;
    for(k  = 0;k + j <= n -1; k++){
      minians += A[j+k];
      //cout << minians << A[j+k] << endl;
      if( minians == 0){
        ans++;

Compiler output:
a.cc: In function 'int main()':
a.cc:24:15: error: expected '}' at end of input
   24 |         ans++;
      |               ^
a.cc:23:24: note: to match this '{'
   23 |       if( minians == 0){
      |                        ^
a.cc:24:15: error: expected '}' at end of input
   24 |         ans++;
      |               ^
a.cc:20:35: note: to match this '{'
   20 |     for(k  = 0;k + j <= n -1; k++){
      |                                   ^
a.cc:24:15: error: expected '}' at end of input
   24 |         ans++;
      |               ^
a.cc:18:30: note: to match this '{'
   18 |   for(j = 0; j <= n - 1; j++){
      |                              ^
a.cc:24:15: error: expected '}' at end of input
   24 |         ans++;
      |               ^
a.cc:10:11: note: to match this '{'
   10 | int main(){
      |           ^
Language: Java

Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] A = new int[N];

		int m = 0;
		int count = 0;
		int num = 0;
		int j = 0;
		int i = 0;

		for (m = 0; m < N; m++) {
			A[m] = sc.nextInt();
		}

		for (j = 0; j < N; j++) {
			num = 0;
			for (i = 0; i + j < N; i++) {
				num = num + A[i + j];

				if (num == 0) {
					count++;
				}
			}
		}
		System.out.println(count);

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
Scanner sc = new Scanner(System.in);
^
  (use --enable-preview to enable unnamed classes)
Main.java:11: error: class, interface, enum, or record expected
		for (m = 0; m < N; m++) {
		^
Main.java:11: error: class, interface, enum, or record expected
		for (m = 0; m < N; m++) {
		            ^
Main.java:11: error: class, interface, enum, or record expected
		for (m = 0; m < N; m++) {
		                   ^
Main.java:13: error: class, interface, enum, or record expected
		}
		^
Main.java:15: error: class, interface, enum, or record expected
		for (j = 0; j < N; j++) {
		            ^
Main.java:15: error: class, interface, enum, or record expected
		for (j = 0; j < N; j++) {
		                   ^
Main.java:17: error: class, interface, enum, or record expected
			for (i = 0; i + j < N; i++) {
			^
Main.java:17: error: class, interface, enum, or record expected
			for (i = 0; i + j < N; i++) {
			            ^
Main.java:17: error: class, interface, enum, or record expected
			for (i = 0; i + j < N; i++) {
			                       ^
Main.java:20: error: class, interface, enum, or record expected
				if (num == 0) {
				^
Main.java:22: error: class, interface, enum, or record expected
				}
				^
12 errors
Language: C++

#include <cstdio>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <cstdlib>

using namespace std;



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

  unordered_map<long, long> part_sums;
  part_sums[0] = 1;
  long sum = 0;
  long count = 0;
  for(int i=0; i<n; ++i) {
    sum += a[i];
    for(auto& pair : part_sums) {
      if(pair.second == sum) count += plus;
    }
    auto it = part_sums.find(sum);
    if(it == part_sums.end()) {
      part_sums[sum] = 1;
    } else {
      ((*it).second)++;
    }
  }
  printf("%ld\n", count);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:43: error: missing template arguments before ';' token
   27 |       if(pair.second == sum) count += plus;
      |                                           ^
Language: C++

#include <iostream>
using namespace std;
//a.cpp
int main(){
  int n,cnt = 0;
  cin >> n;
  //int a[n][n];
  int** a = new int*[n];
  for(int i = 0; i < n; i++){
    a[i] = new int[n];
  }
  
  for(int i = 0; i < n; i++){
    cin >> a[0][i];
  }

  for(int i = 1; i < n; i++){
    for(int j = 0; j < n-i; j++){
      a[i][j] = a[i-1][j]+a[0][j+i];
      //cout << a[i][j] << endl;
      if(a[i][j] == 0){
	cnt++;
      }
    }
  }

  cout << cnt << endl;

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

#include<bits/stdc++.h>

#define INF 1e9
#define llINF 1e18
#define MOD 1e9+7
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
using namespace std;
map<ll,ll>ma;
int main(){
  int a;
  cin>>a;
  vector<ll>num(a);
  vector<ll>sum(a);
  for(int i=0;i<a;i++){
    cin>>num[i];
    if(i!=0)
      sum[i]=sum[i-1]+num[i];
    else
      sum[i]=num[i];
  }
  sort(sum.begin(),sum.end());
  ll ans=0;
  for(int i=0;i<a-1;i++){
    int cnt=1;
    while(sum[i]==sum[i+1]&&i<a-2){
      cnt++;
      i++;
    }
    if(i==a-2&&sum[i]==sum[i+1])cnt++;
    if(sum[i]==0)
      abs+=cnt*(cnt+1)/2;
    else
      ans+=cnt*(cnt-1)/2;
  }
  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:24: error: overloaded function with no contextual type information
   35 |       abs+=cnt*(cnt+1)/2;
      |                        ^
Language: C++

#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;

const int MOD = 1000000009;

// 入力
int n, A,m;
A=0;
scanf("%d",&n);
int a[n];
for(m=0;m++-n;)scanf("%d",&d[m]);


// DPテーブル
int dp[110][10010];

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

    memset(dp, 0, sizeof(dp));   // 一旦すべて 0 に
    dp[0][0] = 1;                // dp[0][0] だけ 1 に

    for (int i = 0; i < n; ++i) {
        for (int j = 0; j <= A; ++j) {
            (dp[i+1][j] += dp[i][j]) %= MOD;
            if (j >= a[i]) (dp[i+1][j] += dp[i][j-a[i]]) %= MOD;
        }
    }

    cout << dp[n][A] << endl;
}


Compiler output:
a.cc:10:1: error: 'A' does not name a type
   10 | A=0;
      | ^
a.cc:11:6: error: expected constructor, destructor, or type conversion before '(' token
   11 | scanf("%d",&n);
      |      ^
a.cc:12:7: error: size of array 'a' is not an integral constant-expression
   12 | int a[n];
      |       ^
a.cc:13:1: error: expected unqualified-id before 'for'
   13 | for(m=0;m++-n;)scanf("%d",&d[m]);
      | ^~~
a.cc:13:9: error: 'm' does not name a type; did you mean 'tm'?
   13 | for(m=0;m++-n;)scanf("%d",&d[m]);
      |         ^
      |         tm
a.cc:13:15: error: expected unqualified-id before ')' token
   13 | for(m=0;m++-n;)scanf("%d",&d[m]);
      |               ^
Language: C

#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;

const int MOD = 1000000009;

// 入力
int n, A,m;
A=0;
scanf("%d",&n);
int a[n];
for(m=0;m++-n;)scanf("%d",&d[m]);


// DPテーブル
int dp[110][10010];

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

    memset(dp, 0, sizeof(dp));   // 一旦すべて 0 に
    dp[0][0] = 1;                // dp[0][0] だけ 1 に

    for (int i = 0; i < n; ++i) {
        for (int j = 0; j <= A; ++j) {
            (dp[i+1][j] += dp[i][j]) %= MOD;
            if (j >= a[i]) (dp[i+1][j] += dp[i][j-a[i]]) %= MOD;
        }
    }

    cout << dp[n][A] << endl;
}


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

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

int ritz = 0;
int i, j = 0;
for(i = 0;i < N;++i){
	int test = 0;
	for(j = 0;j < N-i;++j){
		test += vec.at(j+i);
		if(test == 0){
			++ritz;
		}
	}
cout << ritz << endl;
}

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

#include <algorithm>
#include <cmath>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
const int INT_INF = 500000000;
const long long LONG_LONG_INF = (long long)pow(10, 18);
const int MOD = pow(10, 9) + 7;
/* contest template */
long long sigma, ans, N;
long long a[200000];
multiset<long long> s;

int main() {
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < N; i++) {
    sigma += a[i];
    if (sigma == 0) {
      ans++;
    }
    s.insert(sigma);
  }
  while (!s.empty()) {
    set<int>::iterator i = s.begin();
    size_t n = s.count(*i);
    if (n >= 2) {
      ans += n * (n - 1) / 2;
    }
    s.erase(*i);
  }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:32:35: error: conversion from '_Rb_tree_const_iterator<long long int>' to non-scalar type '_Rb_tree_const_iterator<int>' requested
   32 |     set<int>::iterator i = s.begin();
      |                            ~~~~~~~^~
Language: C++

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

int ritz = 0;
for(int i = 0;i < N;i++){
	int test = 0;
	for(int j = 0;j < N-i;j++){
		if(vec.at(j+i) > 0){
			test += vec.at(j+i);}
		else{
			test -= vec.at(j+i);}
		}
		if(test == 0){
			ritz++;
		}
	}
}
cout << ritz << endl;
}

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

#include<stdio.h>

int main()
{
    short int input[200000];
    int step;
    int count=0;
    scanf("%d",&step);
    for(int i=0;i<step;i++){
        scanf("%d",&input[i]);
    }
    for(int i=0;i<step;i++){
        int check=0;
        //for(int j=i;j<step;j++){
            check+=input[j];
            if(check==0)
                count++;
        //}
    }
    printf("%d",count);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:26: error: 'j' was not declared in this scope
   15 |             check+=input[j];
      |                          ^
Language: C++

#include <iostream>
using namespace std;
int a[1000000];
map<long long ,int >mp;
int main()
{
	long long n,ans=0;
	long long sum=0;
	cin>>n; 
//	mp[0]++;
	for(int i=1;i<=n;i++)		
	{
		cin>>a[i];
		sum+=a[i];
		ans+=mp[sum];
		mp[sum]++;
	}
	cout<<ans;
	return 0;
}

Compiler output:
a.cc:4:1: error: 'map' does not name a type
    4 | map<long long ,int >mp;
      | ^~~
a.cc: In function 'int main()':
a.cc:15:22: error: 'mp' was not declared in this scope
   15 |                 ans+=mp[sum];
      |                      ^~
Language: C++

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

#define lli long long int

#define FI(i,n) for(int i=0;i<n;i++)
#define FJ(j,n) for(int j=0;j<n;j++)

#define FRI(i,n) for(int i=n;i>n;i--)
#define FRJ(j,n) for(int i=n;i>n;j--)

using namespace std;

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

	int N;
	int x[200000];
	int tmp,y;
	int a=0;

	cin >> N;

	FI(i,N){
		cin>>x[i];
	}
	
	for(int n=1;n<N;n++){
		FI(i,N){
			tmp=x[i];
			//if(tmp==0)a++;
			for(int j=i+1;j<i+n;j++){
				if(i+>N)break;
				tmp+=x[j];
			}
			if(tmp==0){
				a++;
			}
		}
	}
	cout << a ;

	return 0;

}





Compiler output:
a.cc: In function 'int main()':
a.cc:37:38: error: expected primary-expression before '>' token
   37 |                                 if(i+>N)break;
      |                                      ^
Language: C++

#include<iostream>
using namespace std;

#pragma warning(disable:4996)

#define MAX 200000+5
#define ms(a) memset(a,0,sizeof(a))

int val[MAX];
int value[MAX];
int con[MAX];

int do_add(const int& a)
{
	int add = 0;
	for (int i = 1; i <= a; ++i)
	{
		add += i;
	}
	return add;
}

int main()
{
	int i, j, flag;
	int N, all;
	while (scanf("%d", &N) != EOF)
	{
		ms(val);
		ms(con);
		ms(value);
		all = flag = 0;
		for (i = 1; i <= N; ++i)
			scanf("%d", &value[i]);
		for (i = 1; i <= N; ++i)
		{
			if (flag&(1 << (i - 1)))continue;
			val[i - 1] = 0;
			for (j = i; j <= N; ++j)
			{
				val[j] = val[j - 1] + value[j];
				if (val[j] == 0)++con[i], flag = flag|(1 << j);
			}
			all += do_add(con[i]);
		}
		printf("%d\n", all);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: 'memset' was not declared in this scope
    7 | #define ms(a) memset(a,0,sizeof(a))
      |               ^~~~~~
a.cc:29:17: note: in expansion of macro 'ms'
   29 |                 ms(val);
      |                 ^~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#include <iostream>
#include <sstream>
#include <String>


int main() {

	int n;
	int a[200000];
	std::cin >> n;;

	int i,j;
	for (i = 0; i < n; i++) {
		std::cin >> a[i];
	}

	int start = 0;
	int length = 2;
	int count = 0;
	int sum=0;

	while (length <= n) {

		for (start = 0; start <= n - length; start++) {

			for (i = 0; i < length;i++) {
				sum = sum + a[start + i];
			}
			if (sum == 0) {
				count++;
			}
		}
		length++;
		sum = 0;

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

Compiler output:
a.cc:3:10: fatal error: String: No such file or directory
    3 | #include <String>
      |          ^~~~~~~~
compilation terminated.
Language: Java

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


Compiler output:
Main.java:6: error: incompatible types: int[] cannot be converted to long[]
        long[] a = new int[N];
                   ^
Main.java:8: error: cannot find symbol
            a[i] = sc.nextlong();
                     ^
  symbol:   method nextlong()
  location: variable sc of type Scanner
2 errors
Language: C++

N = int(input())
A = [int(x) for x in input().split()]

count = 0

for i in range(N):
    for j in range(i+1,N+1):
        if sum(A[i:j]) == 0:
            count += 1
            
print(count)

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

#include <stdio.h>


int main(int argc, char **argv)
{
  int n,i,j,x;
  int xx = 0;
  scanf("%d",&n);
  printf("\n")
  int a[n];
  for(i = 0 ; i < n ; i++){
    scanf("%d ",&a[i]);
  }
  for(i = 0 ; i < n ; i++){
    x = a[i];
    for(j = 1 ; j < n - i ; j++){
      x = x + a[i + j];
      if(x == 0)
        xx++;
    }
  }

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:9:15: error: expected ';' before 'int'
    9 |   printf("\n")
      |               ^
      |               ;
   10 |   int a[n];
      |   ~~~          
main.c:12:18: error: 'a' undeclared (first use in this function)
   12 |     scanf("%d ",&a[i]);
      |                  ^
main.c:12:18: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

    inputs = gets.split(' ').map(&:to_i)
    count = 0

    inputs.each.with_index do |l, j|
      inputs.each.with_index do |n, i|
        count += 1 if inputs[j..i]
      end
    end

    puts count

Compiler output:
a.cc:1:5: error: 'inputs' does not name a type
    1 |     inputs = gets.split(' ').map(&:to_i)
      |     ^~~~~~
Language: Java

mport java.util.ArrayList;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int number = Integer.parseInt(sc.next());
        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i < number; i++) {
            list.add(Integer.parseInt(sc.next()));
        }
        int count = 0;
        for (int i = 0; i < number; i++) {
            for(int j = i; j < number; j++) {
                int sum = 0;
                sum += list.get(j);
                if(sum == 0) {
                    count++;
                }
            }
        }
        System.out.println(count);
    }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.ArrayList;
^
Main.java:2: error: class, interface, enum, or record expected
import java.util.Scanner;
^
2 errors
Language: C

#include<stdio.h>

int main(void){

int n;int p = 0; int sum;
scanf("%d",&n);

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

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


Compiler output:
main.c: In function 'main':
main.c:11:1: error: expected declaration or statement at end of input
   11 | for(int i = 1; i < n; i++) z[i] += z[i - 1];
      | ^~~
Language: C++

import sequtils, strutils

proc readInt(): int =
  result = stdin.readLine.parseInt

proc readInts(): seq[int] =
  result = stdin.readLine.split.map(parseInt)

var N = readInt()
var A: seq[int]
A = readInts()

var ans = 0
for i in countup(0, N-1):
  var sum = 0
  for j in countup(i, N-1):
    sum = sum + A[j]
    if(sum == 0):
      ans += 1
    
echo ans


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import sequtils, strutils
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

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

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

    vector<long long> a(n);
    for (long long& x : a) cin >> x;

    vector<long long> ac(n + 1, 0);
    map<long long, long long> mp;
    mp[0]++;

    for (long long i = 0; i < n; i++) {
        ac[i + 1] = ac[i] + a[i];
        mp[ac[i + 1]]++;
    }

    long long ans = 0;
    for (long long i = 0; i < n + 1; i++) {
        ans += max(0, --mp[ac[i]]);
    }
    cout << ans << endl;

    return 0;
}


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

import macros, algorithm, tables, sets, lists, queues, intsets, critbits, sequtils, strutils, math, future

proc readInt(): int =
  result = stdin.readLine.parseInt

proc readInts(): seq[int] =
  result = stdin.readLine.split.map(parseInt)

var N = readInt()
var A: seq[int]
A = readInts()

var ans = 0
for i in countup(0, N-1):
  var sum = 0
  for j in countup(i, N-1):
    sum = sum + A[j]
    if(sum == 0):
      ans += 1
    
echo ans


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import macros, algorithm, tables, sets, lists, queues, intsets, critbits, sequtils, strutils, math, future
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<iostream>
#include<algorithm>
#include<string> 
#include<map>
#include<set>
#include<vector>
#include<string.h> 
#include<math.h>
#include<stdio.h>
#include<queue>
#include<utility>
#include<cstdio>
#include<cstring>
#define fo(i,w,n) for(int i=(int) w;i<(int) n;i++)
#define qui queue<int>
#define vit vector<int>
using namespace std;
int main()
{int n;cin>>n;
fo(i,0,n)cin>>a[i];
int i=0,m=0;
while(i<n){
	int s=0;s+=a[i];i++;
	while(i<n&&s!=0){
		i++;s+=a[i];if(s==0)m++;
	}
}
long long er=m*(m-1)/2;
cout<<er;
system("pause");
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:15: error: 'a' was not declared in this scope
   20 | fo(i,0,n)cin>>a[i];
      |               ^
a.cc:23:20: error: 'a' was not declared in this scope
   23 |         int s=0;s+=a[i];i++;
      |                    ^
Language: C++

import macros, algorithm, tables, sets, lists, queues, intsets, critbits, sequtils, strutils, math, future

proc readInt(): int =
  result = stdin.readLine.parseInt

proc readInts(): seq[int] =
  result = stdin.readLine.split.map(parseInt)

var N = readInt()
var A: seq[int]
A = readInts()

var ans = 0
for i in 0..<N:
  var sum = 0
  for j in i..<N:
    sum = sum + A[j]
    if(sum == 0):
      ans += 1
    
echo ans


Compiler output:
a.cc:14:10: error: too many decimal points in number
   14 | for i in 0..<N:
      |          ^~~
a.cc:1:1: error: 'import' does not name a type
    1 | import macros, algorithm, tables, sets, lists, queues, intsets, critbits, sequtils, strutils, math, future
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

include <bits/stdc++.h>

using namespace std;

const int N = 2e5 + 5;

int n;
long long sum[N];
map <long long, int> cnt;

int main()
{
    scanf("%d", &n);
    long long ans = 0;
    cnt[0] = 1;
    for (int i = 1; i <= n; ++i) {
        int x;
        scanf("%d", &x);
        sum[i] = sum[i - 1] + x;
        ans += cnt[sum[i]];
        ++cnt[sum[i]];
    }
    printf("%lld\n", ans);
    return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc:9:1: error: 'map' does not name a type
    9 | map <long long, int> cnt;
      | ^~~
a.cc: In function 'int main()':
a.cc:13:5: error: 'scanf' was not declared in this scope
   13 |     scanf("%d", &n);
      |     ^~~~~
a.cc:15:5: error: 'cnt' was not declared in this scope; did you mean 'int'?
   15 |     cnt[0] = 1;
      |     ^~~
      |     int
a.cc:23:5: error: 'printf' was not declared in this scope
   23 |     printf("%lld\n", ans);
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | include <bits/stdc++.h>
Language: C++

import macros, algorithm, tables, sets, lists, queues, intsets, critbits, sequtils, strutils, math, future

proc readInt(): int =
  result = stdin.readLine.parseInt

proc readInts(): seq[int] =
  result = stdin.readLine.split.map(parseInt)

var N = readInt()
var A: seq[int]
A = readInts()

#var dp = newSeqWith(N, newSeq[int](N))
#var sum = newSeqWith(N, newSeq[int](N))
#
#if (A[0] == 0):
#  dp[0][0] = 1
#else:
#  dp[0][0] = 0
#
#for i in 0..<N:
#  for j in countdown(i, 0):
#    dp[j][i] = 
#
var ans = 0
for i in 0..<N:
  var sum = 0
  for j in i..<N:
    sum = sum + A[j]
    if(sum == 0):
      ans += 1
    
echo ans


Compiler output:
a.cc:13:2: error: invalid preprocessing directive #var
   13 | #var dp = newSeqWith(N, newSeq[int](N))
      |  ^~~
a.cc:14:2: error: invalid preprocessing directive #var
   14 | #var sum = newSeqWith(N, newSeq[int](N))
      |  ^~~
a.cc:16:7: error: token "[" is not valid in preprocessor expressions
   16 | #if (A[0] == 0):
      |       ^
a.cc:18:6: warning: extra tokens at end of #else directive [-Wendif-labels]
   18 | #else:
      |      ^
a.cc:19:4: error: invalid preprocessing directive #dp
   19 | #  dp[0][0] = 0
      |    ^~
a.cc:21:2: error: invalid preprocessing directive #for
   21 | #for i in 0..<N:
      |  ^~~
a.cc:22:4: error: invalid preprocessing directive #for
   22 | #  for j in countdown(i, 0):
      |    ^~~
a.cc:23:6: error: invalid preprocessing directive #dp
   23 | #    dp[j][i] =
      |      ^~
a.cc:26:10: error: too many decimal points in number
   26 | for i in 0..<N:
      |          ^~~
a.cc:16: error: unterminated #else
   16 | #if (A[0] == 0):
a.cc:1:1: error: 'import' does not name a type
    1 | import macros, algorithm, tables, sets, lists, queues, intsets, critbits, sequtils, strutils, math, future
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<string>
using namespace std;
#include <stdio.h>
#include <limits.h>
#include "bits/stdc++.h"
int xx, a[200010], N, ans1,sum;
int main()
{
	cin >> N;
	for (int x = 1; x++; x < N) {
		cin >> xx;
		a[i] = xx;
	}
	for (int y = 1; y++; y < N) {
		sum = 0 + a[y];
		for (int z=y+1;z++;z<N-y+1)
			sum = sum + a[z];
		if (sum == 0) {
			ans1++;
		}
	}
	cout << ans1;
	return 0;

}


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

#include<string>
using namespace std;
#include <stdio.h>
#include <limits.h>
#include "bits/stdc++.h"
int xx, a[200010], N, ans1,sum;
int main()
{
	cin >> N;
	for (int x = 1; x++; x < N) {
		cin >> xx;
		a[i] = xx;
	}
	for (int y = x+1; y++; y < N-x+1) {
		sum = 0 + a[y];
		for (int z = 1;z++;z < )
			sum = sum + a[z];
		if (sum == 0) {
			ans1++;
		}
	}
	cout << ans1;
	return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: 'i' was not declared in this scope
   12 |                 a[i] = xx;
      |                   ^
a.cc:14:22: error: 'x' was not declared in this scope
   14 |         for (int y = x+1; y++; y < N-x+1) {
      |                      ^
a.cc:16:40: error: expected primary-expression before ')' token
   16 |                 for (int z = 1;z++;z < )
      |                                        ^
Language: C++

#include<iostream>
#include<algorithm>
#include<stdint>
using namespace std;

const int MAX = 200000;
int main() {
	static int N, A[MAX];
	cin >> N;
	for (int i = 0;i < N;i ++) cin >> A[i];
	
	static int sum[MAX + 1]; // 累積和
	sum[0] = 0;
	for (int i = 0;i < N;i ++) sum[i + 1] = A[i] + sum[i];
	sort(sum, sum+N+1);
	int64_t ans = 0;
	int num = 1;
	for (int i = 1;i <= N;i ++) {
		if (sum[i] == sum[i - 1]) num ++;
		else {
			ans += (int64_t)num * (num - 1) / 2;
			num = 1;
		}
	}
	ans += (int64_t)num * (num - 1) / 2;
	cout << ans;
	return 0;
}
/*
31536000のコメント解説欄
ここテンプレで用意してるから、A問題とかだとこの先空欄の危険あり

後で説明するね
*/

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

#include <stdio.h>


int main(int argc, char **argv)
{
  int n,i,j,x;
  int xx = 0;
  scanf("%d",&n);
  int a[n];
  for(i = 0 ; i < n ; i++){
    scanf("%d",&a[i]);
  }
  for(i = 0 ; i < n ; i++){
    x = a[i];
    for(j = 0 ; j < n - i - 1){
      x = x + a[i + j + 1];
      if(x == 0)
        xx++;
    }
  }

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:15:30: error: expected ';' before ')' token
   15 |     for(j = 0 ; j < n - i - 1){
      |                              ^
      |                              ;