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

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main() {
	string s;
	cin >> s;
	reverse(all(s));
	ll ans = 0;
	int n = s.size();
	const int mod = 2019;
	vector<int> tot(n+1), cnt(mod);
	int x = 1;
	rep(i, n) {
		if(i == 0) tot[i+1] = (int) (s[i] - '0');
		else tot[i+1] = (tot[i] + (int) (s[i] - '0')* x) % mod;
		x *= 10;
		x %= mod;
	}
	rep(i, n+1) cnt[tot[i]]++;
	rep(i, mod) ans += cnt[i]*(cnt[i]-1)/2;
	// rep(i, n+1) cout << tot[i] << " ";
	cout << ans << endl;
	return 0;
}

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

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

using ll = long long;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define ddrep(i, n) for (int i = n; i > 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define ssrep(i, s, t) for (int i = s; i <= t; ++i)

#define rng(a) a.begin(), a.end()
#define rrng(a) a.rbegin(), a.rend()
#define pb push_back
#define eb emplace_back
#define fi first
#define se second

#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))

using pi = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using ld = long double;

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}

template <class T> ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "{";
  rep(i, (int)v.size()) {
    if (i)
      os << ",";
    os << v[i];
  }
  os << "}";
  return os;
}

template <typename T, size_t S> void printArray(const T (&array)[S]) {
  for (auto val : array)
    std::cout << val << ", ";
  std::cout << "\n";
}

const int mod = 2019;
const int inf = 1e9 + 5;

struct mint {
  ll x;
  mint(ll x=0) : x(x%mod) {}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x -= a.x) < 0) x += mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) {
    mint res(*this);
    return res*=a;
  }
};

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << std::setprecision(10);

  string s; std::cin >> s;
  reverse(rng(s));
  int n = s.size();
  mint base = 1;
  vector<mint> a(n); rep(i, n) a[i] = mint(s[i]-'0') * base, base *= 10;
  vector<mint> tot(n+1);
  rep(i, n) tot[i+1] = tot[i] + a[i];
  int ans = 0;
  map<ll, int> cnt;
  rep(i, n+1) {
    if (cnt.count(tot[i].x)) ans += cnt[tot[i].x];
    cnt[tot[i].x]++;
  }
  std::cout << ans << "\n";
}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
    string S;
    cin>>S;
    long long N=S.size();
    vector<int>TEN(N+1);
    TEN.at(0)=1;
    for(int i=1;i<N+1;i++){
        TEN.at(i)=(TEN.at(i-1)*10)%2019;
    }
    vector<int>A(N);
    A.at(0)=S.at(N-1)-'0';
    for(int i=1;i<N;i++){
        int B=S.at(N-1-i)-'0';
        A.at(i)=(A.at(i-1)+(B*TEN.at(i)))%2019;
    }
    vector<long long>list(2019);
    for(int i=0;i<N;i++){
        list.at(A.at(i))=list.at(A.at(i))+1;
    }
    long long sum=0;
    for(int i=0;i<N;i++){
        sum=sum+list.at(i)+(list.at(i)*(list.at(i)-1))/2;
    }
    cout<<sum<<endl;
}

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

S = input()

map_ = [-1] * 2019
map_[0] = 0
ans = 0

for i in range(1, len(S) + 1):
    temp = int(S[len(S) - i:])
    map_[temp % 2019] += 1
    ans += map_[temp % 2019]

print(ans)


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | S = input()
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'S' [-Wimplicit-int]
main.c:1:5: error: implicit declaration of function 'input' [-Wimplicit-function-declaration]
    1 | S = input()
      |     ^~~~~
main.c:1:5: error: initializer element is not constant
main.c:3:1: error: expected ',' or ';' before 'map_'
    3 | map_ = [-1] * 2019
      | ^~~~
Language: C

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


int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	string S;
  cin>>S;
	ll n=S.size();
	vector<ll>s(n);
	rep(i,n){
		s[i]=S[i]-'0';
	}
	//あまりの数
	vector<ll> p(n+1,0);
	map<ll,ll>mp;
	p[n-1]=s[n-1]%2019;
	//cout<<p[n-1]<<endl;
	rep(i,n-1){
		p[n-2-i]=s[n-2-i];
		rep(j,i+1){
		//	cout<<j<<endl;
			p[n-2-i]*=10;
			p[n-2-i]%2019;
		}

	//	p[n-2-i]+s[n-1-i]);
	p[n-2-i]+=p[n-1-i];
		p[n-2-i]=p[n-2-i]%2019;
	//	cout<<p[n-2-i]<<endl;

		mp[p[n-2-i]]++;
	}
	mp[0]++;
	int ans=0;
//cout<<mp[44]<<'m'<<endl;
	rep(i,2019){
		int temp=mp[i];
		ans+=temp*(temp-1)/2;
	//	cout<<temp<<endl;
	}

	cout<<ans;





}


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

#include <bits/stdc++.h>
using namespace std;
#define rep0(i, n) for (long long i = 0; i < (long long)(n); i++)
#define rep1(i,n) for(long long i=1;i<=(long long)(n);i++)
#define all(v) v.begin(),v.end()
#define Sort(v) sort(all(v))
#define Reverse(v) reverse(all(v))
#define Rsort(v) sort(all(v),greater)
#define pub(v) push_back(v)
#define pob(v) pop_back(v)
typedef long long ll;
typedef vector<ll> vel;
typedef vector<vector<ll>> vel2d;
typedef string str;
typedef pair<ll,ll> pal;
typedef vector<str> ves;


int main() {
    str S;
    cin>>S;
    ll n=S.size();
    reverse(all(S));
    vel data(2019);
    ll ans=0,tot=0,x=1;
    rep0(i,n){
       tot+=(S[i]-'0')*x;
       tot%=2019;
       if(data[tot]==0&&tot==0){data[tot]++;}
       if((S[i]-'0')!=0){data[tot]++;}
       x*=10;
       x%=2019;
    }
    rep0(i,2019){
        ll q=data[i];
        if(data[i]!=0){cout<<i<<" "<<data[i]<<endl;}
        ans+=q*(q-1)/2;
    }
    cout<<ans<<endl;
}

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

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

#define digitNum  200001

typedef struct Values {

	int i;

	//i<=j
	int j;

}values;

char str[digitNum];

char tempDigits[digitNum];

int theMultiple = 2019;

int chosenValue(values*);

bool multipleIs(int*, int*);


int main(void) {

	fgets(str,sizeof(str),stdin);

	sscanf_s(str,"%s", str, sizeof(str));

	values tupple = { 0, 0 };

	int length = strlen(str);

	int multipleCount = 0;

	int temp = 0;

	for (int s = 0; s < length; s++) {

		tupple.i = s;

		for (int t = s; t < length; t++) {

			///2019の倍数となる前提
			//4桁
			if (t - s + 1 < 4)continue;

			tupple.j = t;

			temp = chosenValue(&tupple);

			if (multipleIs(&temp, &theMultiple) == true)multipleCount++;

		}

	}

	printf("%d\n", multipleCount);

	return 0;
}

int chosenValue(values* tupple) {

	//tempDigitsの初期化は、メモリ使用量の面で断念

	int count = 0;

	for (int k = tupple->i; k <= tupple->j; k++) {

		tempDigits[count] = str[k];

		count++;

	}

	int ans = 0;

	sscanf(tempDigits, "%d", &ans);

	//初期化
	for (int k = tupple->i; k <= tupple->j; k++) {

		tempDigits[count-1] = '\0';

		count--;

	}

	return ans;

}

bool multipleIs(int* value, int* multiple) {

	return (*value % *multiple) == 0 ? true : false;

}

Compiler output:
main.c: In function 'main':
main.c:32:9: error: implicit declaration of function 'sscanf_s'; did you mean 'sscanf'? [-Wimplicit-function-declaration]
   32 |         sscanf_s(str,"%s", str, sizeof(str));
      |         ^~~~~~~~
      |         sscanf
Language: C

#include <stdio.h>
#include<stdlib.h>
#include <string.h>
#include<stdbool.h>
typedef struct Values {

	int i;

	//i<=j
	int j;

}values;

const int digitNum = 200001;

char str[digitNum];

int theMultiple = 2019;


int chosenValue(values*);

bool multipleIs(int*, int*);


int main(void) {

	fgets(str,sizeof(str),stdin);

	sscanf(str,"%s", str);

	values tupple = { 0, 0 };

	int length = strlen(str);

	int multipleCount = 0;

	int temp = 0;

	for (int s = 0; s < length; s++) {

		tupple.i = s;

		for (int t = s; t < length; t++) {

			///2019の倍数となる前提
			//4桁
			if (t - s + 1 < 4)continue;

			tupple.j = t;

			temp = chosenValue(&tupple);

			if (multipleIs(&temp, &theMultiple) == true)multipleCount++;

		}

	}

	printf("%d\n", multipleCount);

	return 0;
}

int chosenValue(values* tupple) {

	char tempDigits[digitNum];

	int count = 0;

	for (int k = tupple->i; k <= tupple->j; k++) {

		tempDigits[count] = str[k];

		count++;

	}

	int ans = 0;

	sscanf(tempDigits, "%d", &ans);

	return ans;

}

bool multipleIs(int* value, int* multiple) {

	return (*value % *multiple) == 0 ? true : false;

}

Compiler output:
main.c:16:6: error: variably modified 'str' at file scope
   16 | char str[digitNum];
      |      ^~~
Language: C

#include <stdio.h>
#include<stdlib.h>
#include <string.h>
#include<stdbool.h>
const int digitNum = 200001;

char str[digitNum];

int theMultiple = 2019;

typedef struct Values {

	int i;

	//i<=j
	int j;

}values;

int chosenValue(values*);

bool multipleIs(int*, int*);


int main(void) {

	fgets(str,sizeof(str),stdin);

	sscanf(str,"%s", str);

	values tupple = { 0, 0 };

	int length = strlen(str);

	int multipleCount = 0;

	int temp = 0;

	for (int s = 0; s < length; s++) {

		tupple.i = s;

		for (int t = s; t < length; t++) {

			///2019の倍数となる前提
			//4桁
			if (t - s + 1 < 4)continue;

			tupple.j = t;

			temp = chosenValue(&tupple);

			if (multipleIs(&temp, &theMultiple) == true)multipleCount++;

		}

	}

	printf("%d\n", multipleCount);

	return 0;
}

int chosenValue(values* tupple) {

	char tempDigits[digitNum];

	int count = 0;

	for (int k = tupple->i; k <= tupple->j; k++) {

		tempDigits[count] = str[k];

		count++;

	}

	int ans = 0;

	sscanf(tempDigits, "%d", &ans);

	return ans;

}

bool multipleIs(int* value, int* multiple) {

	return (*value % *multiple) == 0 ? true : false;

}

Compiler output:
main.c:7:6: error: variably modified 'str' at file scope
    7 | char str[digitNum];
      |      ^~~
Language: C

#include <stdio.h>
#include<stdlib.h>
#include <string.h>
#include<stdbool.h>
const int digitNum = 200001;

char str[digitNum];

int theMultiple = 2019;

typedef struct Values {

	int i;

	//i<=j
	int j;

}values;

int chosenValue(values*);

bool multipleIs(int*, int*);


int main(void) {

	scanf("%s%*c", str, sizeof(str));

	values tupple = { 0, 0 };

	int length = strlen(str);

	int multipleCount = 0;

	int temp = 0;

	for (int s = 0; s < length; s++) {

		tupple.i = s;

		for (int t = s; t < length; t++) {

			///2019の倍数となる前提
			//4桁
			if (t - s + 1 < 4)continue;

			tupple.j = t;

			temp = chosenValue(&tupple);

			if (multipleIs(&temp, &theMultiple) == true)multipleCount++;

		}

	}

	printf("%d\n", multipleCount);

	return 0;
}

int chosenValue(values* tupple) {

	char tempDigits[digitNum] = {NULL};

	int count = 0;

	for (int k = tupple->i; k <= tupple->j; k++) {

		tempDigits[count] = str[k];

		count++;

	}

	int ans = 0;

	sscanf(tempDigits, "%d", &ans);

	return ans;

}

bool multipleIs(int* value, int* multiple) {

	return (*value % *multiple) == 0 ? true : false;

}


Compiler output:
main.c:7:6: error: variably modified 'str' at file scope
    7 | char str[digitNum];
      |      ^~~
main.c: In function 'chosenValue':
main.c:64:37: error: variable-sized object may not be initialized except with an empty initializer
   64 |         char tempDigits[digitNum] = {NULL};
      |                                     ^
Language: C

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

const int digitNum = 200001;

char str[digitNum];

int theMultiple = 2019;

typedef struct Values {

	int i;

	//i<=j
	int j;

}values;

int chosenValue(values*);

bool multipleIs(int*, int*);


int main(void) {

	scanf("%s%*c", str);

	values tupple = { 0, 0 };

	int length = strlen(str);

	int multipleCount = 0;

	int temp = 0;

	for (int s = 0; s < length; s++) {

		tupple.i = s;

		for (int t = s; t < length; t++) {

			///2019の倍数となる前提
			//4桁
			if (t - s + 1 < 4)continue;

			tupple.j = t;

			temp = chosenValue(&tupple);

			if (multipleIs(&temp, &theMultiple) == true)multipleCount++;

		}

	}

	printf("%d\n", multipleCount);

	return 0;
}

int chosenValue(values* tupple) {

	char tempDigits[digitNum] = {NULL};

	int count = 0;

	for (int k = tupple->i; k <= tupple->j; k++) {

		tempDigits[count] = str[k];

		count++;

	}

	int ans = 0;

	sscanf(tempDigits, "%d", &ans);

	return ans;

}

bool multipleIs(int* value, int* multiple) {

	return (*value % *multiple) == 0 ? true : false;

}

Compiler output:
main.c:7:6: error: variably modified 'str' at file scope
    7 | char str[digitNum];
      |      ^~~
main.c:22:1: error: unknown type name 'bool'
   22 | bool multipleIs(int*, int*);
      | ^~~~
main.c:4:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    3 | #include <string.h>
  +++ |+#include <stdbool.h>
    4 | 
main.c: In function 'main':
main.c:51:64: error: 'true' undeclared (first use in this function)
   51 |                         if (multipleIs(&temp, &theMultiple) == true)multipleCount++;
      |                                                                ^~~~
main.c:51:64: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:51:64: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'chosenValue':
main.c:64:37: error: variable-sized object may not be initialized except with an empty initializer
   64 |         char tempDigits[digitNum] = {NULL};
      |                                     ^
main.c: At top level:
main.c:84:1: error: unknown type name 'bool'
   84 | bool multipleIs(int* value, int* multiple) {
      | ^~~~
main.c:84:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c: In function 'multipleIs':
main.c:86:44: error: 'true' undeclared (first use in this function)
   86 |         return (*value % *multiple) == 0 ? true : false;
      |                                            ^~~~
main.c:86:44: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:86:51: error: 'false' undeclared (first use in this function)
   86 |         return (*value % *multiple) == 0 ? true : false;
      |                                                   ^~~~~
main.c:86:51: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C

import collections

def ConZ(i):
    z_num = i+int(i*(i-1)/2)
    return z_num
def ConN(i):
    n_num = int(i*(i-1)/2)
    return n_num

S = input()[::-1]
keta = 1
A_num = 0
x = 0
mod = [0]*len(S) 
modcount=[]
for i in range(len(S)):
    A_num += (int(S[i:i+1])*keta)%2019
    if A_num >= 2019:
        A_num = A_num%2019
    mod[i] = A_num 
    keta*=10
    
c = collections.Counter(mod)
x += ConZ(mod.count(0))
modcount=list(c.values())
#print(mod)
#print(modcount)
k = 0

for j in range(len(modcount)):
    if modcount[j] >=2:
        x+=ConN(modcount[j])
print(x)

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import collections
      | ^~~~~~
main.c:3:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'def'
    3 | def ConZ(i):
      | ^~~
main.c:3:1: error: unknown type name 'def'
main.c:26:2: error: invalid preprocessing directive #print
   26 | #print(mod)
      |  ^~~~~
main.c:27:2: error: invalid preprocessing directive #print
   27 | #print(modcount)
      |  ^~~~~
Language: C++

#include <vector>
#include <iostream>
#include <string>

using namespace std;

int main(){
    string S;
    cin >> S;
    reverse(S.begin(), S.end());
    int len = S.size();

    vector<long long> digit_MOD_res(len);
    vector<long long> d(len+1);

    long long keta = 1;

    for(int i=0; i<=len; ++i ){
        long long digit = (S[i] - '0');
        digit_MOD_res[i] = (digit * keta) % 2019;
        d[i+1] = (d[i] + digit_MOD_res[i]) % 2019;
        keta *= 10;
        keta %= 2019;
    }

    vector<long long> count(2019);

    for(int i=0; i<=len; ++i){
        count[d[i]]++;
    }

    long long ans =0;
    for(int i=0; i<2019; ++i){
        if(count[i] > 1){
            ans += (count[i] + count[i]-1)/2;
        }
    }

    cout << ans << endl; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'reverse' was not declared in this scope
   10 |     reverse(S.begin(), S.end());
      |     ^~~~~~~
Language: C

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

int main() {
 
  string s;
  cin >> s;
  int n=s.length();
  int p=2019;
  vector<int> d(n+1);
  int ten = 1;
  for (int i = n-1; i >= 0; --i) {
    int a = (s[i]-'0') * ten % p;
    d[i] = (d[i+1]+a) % p;
    ten *= 10; ten %= p;
  }
  vector<int> cnt(p);
  ll ans = 0;
  for (int i = n; i >= 0; --i) {
    ans += cnt[d[i]];
    cnt[d[i]]++;
  }
  cout << ans << endl;
  return 0;
}


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

#include <bits/stdc++.h>
#define rep(i, z, n) for(int i = z; i < n; i++)
#define all(v) v.begin(), v.end()
typedef long long ll;
const int INF = 1<<29;
using namespace std;

int main(){
    string S;
    cin >> S;
    int n = S.size();
    vector<int> a(n + 1);
   
    for (int i = 1; i <= n; i++){
        a.at(i) = S.at(i - 1) - 48;
    }
    vector<int64_t> T(n + 1);
    vector<int64_t> U(n + 1, 1);
    for(int i = n - 1; i > 0; i--){
        U.at(i) = (U.at(i + 1)*10) % 2019;
    }
    
    T.at(n) = a.at(n);
    for(int i = n - 1; i >= 1; i--){
        T.at(i) = (T.at(i + 1) + a.at(i) * U.at(i)) % 2019;
    }
    
    
    vector<int> b(2020, 0);
    for(int i = 1; i <= n; i++){
        b.at(T.at(i))++;
    }
    b.at(0)++;
    int64_t ans = 0;
    for(int i = 0; i<=2018; i++){
        int x = b.at(i);
        ans += x * (x - 1) / 2;
    }
   
    cout << ans << endl;
}

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

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define ll              long long
#define pb              push_back
#define ppb             pop_back
#define endl            '\n'
#define mii             map<ll,ll>
#define pii             pair<ll,ll>
#define vi              vector<ll>
#define vs              vector<string>
#define all(a)          (a).begin(),(a).end()
#define F               first
#define S               second
#define sz(x)           (ll)x.size()
#define hell            2019
#define inf             (ll)1e18 + 5
#define PI              (double)3.14159265358979323844
#define DECIMAL(n)      cout << fixed << setprecision(n);
#define rep(i,a,b)      for (ll i=a;i<b;i++)
#define repr(i,a,b)     for (ll i=a-1;i>=b;i--)
#define bitcount(a)     (ll)__builtin_popcount(a)
#define lbnd            lower_bound
#define ubnd            upper_bound
#define mp              make_pair
#define ios             ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ordered_set     tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define trace(...)      __f(#__VA_ARGS__, __VA_ARGS__)

template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    std::cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');std::cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}

using namespace std;
using namespace __gnu_pbds;

/*----------------------Graph Moves----------------*/
//const int fx[]={+1,-1,+0,+0};
//const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*------------------------------------------------*/

//primes for hashing 937,991,1013,1409,1741


ll expo(ll base, ll exponent) {                     //return base^exponent modulo hell
    ll ans = 1;
    while(exponent !=0 ) {
        if((exponent&1) == 1) {
            ans = ans*base ;
            ans = ans%hell;
        }
        base = base*base;
        base %= hell;
        exponent>>= 1;
    }
    return ans%hell;
}

ll add(ll a,ll b) {
	return ((a%hell)+(b%hell))%hell;
}
ll sub(ll a,ll b) {
	return ((a%hell)-(b%hell)+hell)%hell;
}
ll mul(ll a,ll b) {
	return ((a%hell)*(b%hell))%hell;
}

void solve() {
    string s;
    cin>>s;
    ll n=sz(s);
    mii m;
    ll temp=0;
    repr(i,n,0){
    	temp=add(temp,mul(s[i]-'0',expo(10,n-i-1)));
    	m[temp]++;
    }
    ll ans=0;
    for (auto i:m){
    	if (i.F!=0)ans+=(i.S*(i.S-1))/2;
    }
    cout<<ans+m[0]<<endl;
}

signed main() {
    ios
    ll test=1;
    //cin>>test;
    while (test--) solve();
    return 0;
}

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

import java.util.*;


public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int []cnt= new int[2019];
        int x=1;
        int  tat=0;
        long ans=0;
        long m =2019;
        int n=S.length();

        for(int i=S.length()-1;i>=0;i--)
        {
          int num=S.charAt(i)-'0';

          tat+=num*x%2019;
          cnt[tat%2019]++;
          x*=10;
        }

        for(int i=0;i<2019;i++)
        {if(cnt[i]!=1){


          ans+=(cnt[i]*(cnt[i]+1))/2;
            System.out.println((cnt[i]*(cnt[i]+1))/2);
          }
        }
        System.out.println(ans);
      }
    }

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.util.*;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.util.*;
      |            ^
main.c:4:1: error: unknown type name 'public'
    4 | public class Main {
      | ^~~~~~
main.c:4:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    4 | public class Main {
      |              ^~~~
Language: C

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

long long n,dp[2020],a,ans,jum(1),sum;
string s;
int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin>>s;
	dp[0]++;
	for(int i=s.length()-1;i>=0;i--)
	{
		a=s[i]-'0';
		sum=(sum+jum*a)%2019;
		jum=jum*10%2019;
		dp[sum]++;
	}
	for(int i=0;i<2019;i++)
	{
		ans+=dp[i]*(dp[i]-1)>>1;
	}
	cout<<ans<<'\n';
}

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

#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define COUT(x) cout<<(x)<<endl
#define dump(x)  cout << #x << " = " << (x) << endl;
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;
using M = map<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int, vector<int>, greater<int>>;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

const int m = 2019;

int main() {
  string s; cin >> s;
  int n=s.size();

  reverse(s.begin(), s.end());
  vector<int> cnt(m, 0);
  ll ans=0;
  int x=1, tot=0;
  REP(i,n) {
    tot += (s[i]-'0')*x;
    x = x*10%m;
    tot%=m;
    cnt[tot]++;
  }

  REP(i,m) ans += cnt[i] * (cnt[i]-1) / 2;
  COUT(ans);
  return 0;
}

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

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#define F(i,a,n) for(int i=a; i<n; i++)

int compare(const void *b1, const void *b2){ // 昇順
  if(b1 > b2) return 1;
  else if(b1 < b2) return -1;
  else return 0;
}

int main(){
  char cs[20010];
  scanf("%s",cs);
  int n=strlen(cs);
  int a[n];
  F(i,0,n){
    a[i]=atoi(cs[i]);
  }
  int tmod[n+1];
  tmod[n]=0;
  tmod[n-1]=a[n-1]%2019;
  for(int i=n-1; i>=0; i--){
    tmod[i]=(tmod[i+1]+10*a[i])%2019;
  }
  int count[n+1];
  F(i,0,n+1){
    count[i]=0;
  }
  int iter=0;
  qsort(tmod,n+1,sizeof(int),compare);
  F(i,0,n){
    if(tmod[i]==tmod[i+1]){
      count[iter]++;
    }else{
      iter++;
    }
  }
  int ans=0;
  F(j,0,n+1){
    ans+=(count[j]*(count[j]-1))/2
  }
  printf("%d\n",ans);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:17: error: passing argument 1 of 'atoi' makes pointer from integer without a cast [-Wint-conversion]
   19 |     a[i]=atoi(cs[i]);
      |               ~~^~~
      |                 |
      |                 char
In file included from main.c:2:
/usr/include/stdlib.h:105:30: note: expected 'const char *' but argument is of type 'char'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
main.c:42:35: error: expected ';' before '}' token
   42 |     ans+=(count[j]*(count[j]-1))/2
      |                                   ^
      |                                   ;
   43 |   }
      |   ~
Language: C++

#include <iostream>
#include <math.h>
#include <algorithm>
#include <queue>
#include <map>
#include <list>
//#include <bits/stdc++.h>


using namespace std;

#define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)
typedef long long ll;

const int m = 2019;

int main(){
    string s;
    cin >> s;
    // string searchStr = "";
    // ll ssize = s.size();
    // ll ans = 0;
    // for(int i = 1; i <= 10000; i++) {　
    //     searchStr = to_string(i * 2019);
    //     if(searchStr.size() > ssize) break;
    //     if(searchStr.find("0") != string::npos) continue;

    //     int pos = 0;
    //     while (pos != string::npos) {
            
    //         pos = s.find(searchStr, pos );
    //         if(pos != string::npos)pos++;
    //         ans++;
    //     }
    //     ans--;
    // }
    // cout << ans << endl;

    int n = s.size();
    reverse(s.begin(), s.end());
    int x = 1, tot = 0;
    vector<int> cnt(m);
    ll ans = 0;
    FOR(i, 0, n) {
        cnt[tot]++;
        tot += (s[i] - '0') * x;
        tot %= m;
        ans += cnt[tot];
        x = x : 10 % m;
    }
    cout << and << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:14: error: expected ';' before ':' token
   49 |         x = x : 10 % m;
      |              ^~
      |              ;
a.cc:51:17: error: expected identifier before '<<' token
   51 |     cout << and << endl;
      |                 ^~
Language: C++

#include <iostream>
#include <math.h>
#include <algorithm>
#include <queue>
#include <map>
#include <list>
//#include <bits/stdc++.h>


using namespace std;

#define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)N
typedef long long ll;

const int m = 2019;

int main(){
    string s;
    cin >> s;
    // string searchStr = "";
    // ll ssize = s.size();
    // ll ans = 0;
    // for(int i = 1; i <= 10000; i++) {　
    //     searchStr = to_string(i * 2019);
    //     if(searchStr.size() > ssize) break;
    //     if(searchStr.find("0") != string::npos) continue;

    //     int pos = 0;
    //     while (pos != string::npos) {
            
    //         pos = s.find(searchStr, pos );
    //         if(pos != string::npos)pos++;
    //         ans++;
    //     }
    //     ans--;
    // }
    // cout << ans << endl;

    int n = s.size();
    reverse(s.begin(), s.end());
    int x = 1, tot = 0;
    vector<int> cnt(m);
    ll ans = 0;
    FOR(i, 0, n) {
        cnt[tot]++;
        tot += (s[i] - '0') * x;
        tot %= m;
        ans += cnt[tot];
        x = x : 10 % m;
    }
    cout << and << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:64: error: 'N' was not declared in this scope
   12 | #define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)N
      |                                                                ^
a.cc:44:5: note: in expansion of macro 'FOR'
   44 |     FOR(i, 0, n) {
      |     ^~~
a.cc:51:17: error: expected identifier before '<<' token
   51 |     cout << and << endl;
      |                 ^~
Language: C

#include"bits/stdc++.h"

using namespace std; 

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
typedef long long LL;
typedef priority_queue<int> PQ_DESC;
typedef priority_queue<int, vector<int>, greater<int>> PQ_ASC;
typedef priority_queue<PII> PQ_DESC_PII;
typedef priority_queue<PII, vector<PII>, greater<PII>> PQ_ASC_PII;

#define ALL(c) (c).begin(),(c).end()
#define PB push_back
#define MP make_pair
#define SORT_ASC(c) sort(ALL(c))
#define SORT_DESC(c) sort(ALL(c), greater<typeof(*((c).begin()))>())
#define SIZE(a) int((a).size())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ROF(i,a,b) for(int i=(b-1);i>=(a);--i)
#define REP(i,n) FOR(i,0,n)
#define PER(i,n) ROF(i,0,n)

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int LARGE_INT = 1e9+100;
const int INF = 2e9+100;
const LL INF_LL = (LL)INF * 300 * 300;
const int MOD = 2019;

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

LL modpow(LL a, LL n) {
    LL res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}


void Main()
{
    string s;cin>>s;
    int n = SIZE(s);
    reverse(ALL(s));

    REP(i,n){
        s[i] -= '0';
    }

    vector<LL> a(n);
    a[0] = s[0];
    FOR(i,1,n){
        a[i] = (a[i-1] + modpow(10,i)*s[i])%MOD;
        //dump(s[i]+'0')
    }

    VI c(MOD+1);
    c[0]++;
    REP(i,n){
        c[a[i]]++;
        //dump(a[i])
    }
    
    LL result=0;

    REP(i,MOD+1){
        result += c[i]*(c[i]-1)/2;
    }

    cout<<result<<endl;



	return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
    return 0;
}

Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include"bits/stdc++.h"
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include<bits/stdc++.h>
using namespace std;
 
#define rep(i, a, n) for(int i=a; i<n; i++)
#define ll long long
#define all(x) begin(x), end(x)
#define toInt(x) (x - '0')
#define pll pair<ll, ll>
#define pli pair<ll, int>

const long long INF = 1LL<<60;
const int inf = 1 << 30;
const int mod = 1e9+7;


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; }

int main(){
  string s;
  cin >> s;
  int n = s.size();
  reverse(all(s)); 

  int x = 1;
  int t = 0;
  vector<int> cnts(2019);
  cnts[0]  = 1;
  ll ans = 0;
  rep(i, 0, n){
    int num = (s[i] - '0') * x + t;
    num %= 2019;
    t = num;
    cnts[num]++;
    x = (x * 10) % 2019;
  }

  for (int cnt: cnts){
    ans += cnt * (cnt - 1) / 2;
  }
  cout << ans << endl;
}


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

#include <iostream>
#include <set>
#include <queue>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
#include <numeric>
#include <functional>

using namespace std;
#define ALL(x)              (x).begin(),(x).end()
typedef long long           ll;
#define REP(i, n)           for (ll i = 0 ; i < (ll)n ; ++i)
#define REPN(i, m, n)       for (ll i = m ; i < (ll)n ; ++i)
#define INF                 (ll)2e9
#define MOD                 (1000 * 1000 * 1000 + 7)
#define Ceil(x, n)          (((((x))+((n)-1))/n))
#define CeilN(x, n)         (((((x))+((n)-1))/n)*n)
#define FloorN(x, n)        ((x)-(x)%(n))
#define IsOdd(x)            (((x)&0x01UL) == 0x01UL)
#define IsEven(x)           (!IsOdd((x)))
#define M_PI                3.14159265358979323846
typedef pair<ll, ll>	    P;

/*-----------------------------------------------------------------------------
　処理
 -----------------------------------------------------------------------------*/
int main()
{
	string S;
	cin >> S;
	reverse(ALL(S));

	ll keta = 1;
	ll amari = 0;
	map<ll, ll> mp;
	REP(i, S.size()) {
		amari = (amari + (S[i] - '0') * keta) % 2019;
		keta *= 10;
		keta %= 2019;
		mp[amari]++;
	}

	ll ans = mp[0];
	for (auto one : mp) {
		ans += one.second * (one.second - 1) / 2;
	}

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


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

#include <iostream>
#include <string>
#include <sstream>
#define ll long long

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    int count;
    string S;
    count = 0;
    cin >> S;
    ll v;

    ll sl  = S.length();

    for (int i = 0; i < sl - 3; i++) {
        int j = 4;
        while ( (i+j) <= sl ) {
            istringstream(S.substr(i, j)) >> v;
            cout << i << ", " <<  j << ", " << v << endl;
             if (v%2019 == 0) {
                 count++;
                 j += 3;
             }
             j++;
        }
    }
    cout << sl << ", " << count << endl;
    return 0;
}
~      

Compiler output:
a.cc:33:2: error: expected class-name at end of input
   33 | ~
      |  ^
Language: C

#include <bits/stdc++.h>

#define REP(i, n) for(int (i)=0;(i)<(n);++(i))
#define REPV(iter, v) for(auto (iter)=(v).begin(); (iter)!=(v).end();++(iter))
#define ALL(v) (v).begin(),(v).end()

#define MOD 1000000007

using namespace std;

typedef long long ll;

int main()
{
    string S;
    cin >> S;
    
    ll n = S.size();
    vector<ll> T(n + 1, 0);
    ll m = 2019;
    T[n] = 0;
    ll r = 1;
    vector<ll> countMod(m, 0);
    countMod[T[n]]++;
    REP(i, n)
    {
        T[n - i - 1] = ((S[n - i - 1] - '0') * r + T[n - i]) % m;
        countMod[T[n - i - 1]]++;
        r *= 10;
        r = r % m;
    }
    ll ans = 0;
    REP(i, m) ans += countMod[i] * (countMod[i] - 1) / 2;

    cout << ans << endl;
}


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

#include <bits/stdc++.h>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstring>
#include <chrono>
#include <complex>
#define endl "\n"
#define ll long long int
#define vi vector<int>
#define vll vector<ll>
#define vvi vector < vi >
#define pii pair<int,int>
#define pll pair<long long, long long>
#define mod 1000000007
#define inf 1000000000000000001;
#define all(c) c.begin(),c.end()
#define mp(x,y) make_pair(x,y)
#define mem(a,val) memset(a,val,sizeof(a))
#define eb emplace_back
#define pb push_back

using namespace std;
int main(){
    std::ios::sync_with_stdio(false);
        string s;
        cin >> s;
        int n=s.size();
        reverse(s.begin(), s.end());
        int x=1;
        int tot=0;
        int m=4;
        vector<int> dp(m);
        ll ans=0;
        for (int i = 0; i < n; ++i)
        {
            dp[tot]++;
            tot+=(s[i]-'0')*x;
            x=(x*10)%m;
            tot%=m;
            ans+=dp[tot];
        }
        cout << ans << endl;
    return 0;
}


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

#include <vector>
#include <string>
#include <iostream>
#include <queue>
#include <algorithm>
#include <functional>
#include <map>
#include <array>
#include <cmath>
#include <set>
#include <numeric>

using namespace std;


template <typename T>
using TABLE = vector<vector<T>>;

long long PRIME = 1e9 + 7;
long long PRIME2 = 998244353;


long long kaijo(long long a){
    if(a == 1){
        return 1;
    }

    return a * kaijo(a-1);
}


int main(){
    string S;
    cin >> S;

    vector<long long> mod_count(2019, 0);
    long long factor = 10;
    long long prev = S.back() - '0';
    ++mod_count[prev];

    for(int i = S.size() - 2; i >= 0; --i){
        long long next = (S[i] - '0') * factor;
        next %= 2019;
        next = (next + prev) % 2019;
        ++mod_count[next];

        factor = (factor * 10) % 2019;
        prev = next;
    }

    long long sum = 0;
    if(mod_count[0]){
        sum += kaijo(mod_count[0]);
    }

    for(int i = 1; i < 2019; ++i){
        if(mod_count[i] > 1){
            sum += kaijo(mod_count[i]-1);
        }
    }
    cout << sum;

}


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

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

//#define int long long
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i < b; i++)
#define out(x) cout << x << endl
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<bool> > vvb;
typedef vector<vector<double> > vvd;
typedef vector<vector<string> > vvs;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

signed main()
{   
    gearup;
    string s; cin >> s;
    reverse(all(s));
    int n = s.size();
    map<int,ll> mp;
    mp[0]++;
    ll x = 1,t = 0;
    rep(i,n){
        t = t+(s[i]-'0')*x;
        t %= 2019;
        mp[t]++;
        x = (x*10)%2019;
    }
    ll res = 0;
    for(auto m:mp){
        res += m.second*(m.second-1)/2;
    }
    out(res);
}


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

#include <iostream>
using namespace std;

int main(int argc, char *argv[]){
    char r[200001];
    cin >> r;
    int l=strlen(r);
    int count=0;
    
    //cout << "桁数は" << l << endl;//桁数
    int n[l];
    for(int i=0;i<l;i++){
        n[i]=r[i]-'0';
    }
    int b;
    for(int i=0;i<l-3;i++){
        b=1000*n[i]+100*n[i+1]+10*n[i+2]+n[i+3];
        if(b%2019==0) count++;
        for(int j=i+4;j<l;j++){
            b=b*10+n[j];
            if(b%2019==0) count++;
        }
    }
    cout << count <<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:7:11: error: 'strlen' was not declared in this scope
    7 |     int l=strlen(r);
      |           ^~~~~~
a.cc:2:1: note: 'strlen' 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<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n)for(ll i=0;i<n;i++)

const ll INF = 1001001001;

ll gcd(ll a,ll b){
  if(b==0) return a;
  else return gcd(b,a%b);
}



int main(){
  string s;
  cin>>s;
  ll len=s.size();
  vector<ll>t(len,0);
  vector<ll>dp(len);
  dp[len-1]=s.at(len-1);
  t[len-1]=s.at(len-1);
  ll ans=0;
  for(ll i=len-2;i>=0;i--){
    dp[i]=dp[i+1]+pow(10,len-1-i)*s.at(i-1);
    t[i]=dp[i]%2019;
  }
  sort(t.begin(),t.end());
  
  for(ll i=0;i<len-1;i++){
    if(t[i]==t[i+1]){
      ans++;
    }
  }

  cout<<ans<<endl;
  
  
  
  
}



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

#include <iostream>
using namespace std;

int main(int argc, char *argv[]){
    int s;
    char r[200001];
    cin >> r;
    int l=strlen(r);
    int count=0;
    
    //cout << "桁数は" << l << endl;//桁数
    int n[l];
    for(int i=0;i<l;i++){
        n[i]=r[i]-'0';
    }
    int b;
    for(int i=0;i<l-3;i++){
        b=1000*n[i]+100*n[i+1]+10*n[i+2]+n[i+3];
        if(b%2019==0) count++;
        for(int j=i+4;j<l;j++){
            b=b*10+n[j];
            if(b%2019==0) count++;
        }
    }
    cout << count <<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:8:11: error: 'strlen' was not declared in this scope
    8 |     int l=strlen(r);
      |           ^~~~~~
a.cc:2:1: note: 'strlen' 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 <bits/stdc++.h>
#define rep(i,s,n) for (int i=s;i<n;++i)
#define drep(i,s,n) for (int i=n;i>=s;--i)
#define all(x) (x).begin(),(x).end()
#define rall(a) (a).rbegin(),(a).rend()
#define print(x) cout<<(x)<<endl
using namespace std;
typedef long long ll;
int gcd(int a,int b)
{if (a%b == 0) return(b);
 else          return(gcd(b,a%b));}
int lcm(int a,int b)
{return a*b/gcd(a,b);}
void printv(vector<auto> v) {cout<<'[';rep(i,0,v.size()){cout<<v[i]<<',';}cout<<']'<<endl;}
void printvv(vector<vector<auto>> vv)
{
  cout<<'['<<endl;
  rep(q,0,vv.size()){cout<<'[';rep(p,0,vv.at(q).size())cout<<vv.at(q).at(p)<<',';cout <<']'<<endl;}
  cout<<']'<<endl;
}
void printpair(vector<pair<ll, ll>> vp)
{
  cout<<'['<<endl;
  rep(i,0,vp.size())
  {
    pair<ll, ll> p=vp[i];
    cout<<'{'<<p.first<<','<<p.second<<'}'<<endl;
  }
  cout<<'}'<<endl;
}
void solve(); int main(){cin.tie(0);ios::sync_with_stdio(0);solve();}
int step_x[] = {-1,0,0,1};
int step_y[] = {0,-1,1,0};
const long long INF = 1e12;
//------------------------------------------------------------
ll ans=0,n;
string s;
void solve()
{
    cin >> s;
    n=s.length();
    vector<int> dp(2019,0);

    dp[0]++;

    ll cur=0,coef=1;
    // 2019で割った余りは一巡だけ考えればよい(解説: Ti−1 == Tj (mod2019))←計算したものの再利用
    rep(i,0,n) {
      cur = (cur+coef*(s[n-1-i]-'0')%2019)%2019; // avoid overflow
      dp[cur]++;
      coef = coef*10%2019;
    }

    rep(i,0,2019) ans+=dp[i]*(dp[i]-1)/2; // 2の時だけ1追加する（dp[i]=0,1,2）

    print(ans);

    return;
}



Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: Java

import java.util.Scanner;

public class Main1{

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Scanner in = new Scanner(System.in);
        int a[] = new int[2019];
        a[0] = 1;
        String s = in.next();
        int len = s.length(), x = 0, n = 1, ans = 0;
        for (int i = len - 1; i >= 0; i--) {
            x = (x + (s.charAt(i) - '0') * n) % 2019;
            ans += a[x];
            a[x]++;
            n = (n * 10) % 2019;
        }
        System.out.println(ans);
    }

}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin >> s;
  long ans = 0;
  vector<int> list(200005);
  vector<int> mod(200005);
  lsit[0] = 1;
  mod[0] = (s[s.length - 1] - '0') % 2020;
  for(int i = 1; i < s.length; i++){
    list[i] = (list[i - 1] * 10 ) % 2020;
    mod[i] = ((s[s.length -i - 1] - '0') * list[i] + mod[i - 1]) % 2020;
  }
  for(int i = 0; i < 2020; i++) list[i] = 0;
  for(int i = 0; i < s.length; i++){
    if(mod[i] == 0)
      ans ++;
    ans += list[mod[i]];
    list[mod[i]] ++;
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'lsit' was not declared in this scope; did you mean 'list'?
    9 |   lsit[0] = 1;
      |   ^~~~
      |   list
a.cc:10:17: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   10 |   mod[0] = (s[s.length - 1] - '0') % 2020;
      |               ~~^~~~~~
      |                       ()
a.cc:11:24: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   11 |   for(int i = 1; i < s.length; i++){
      |                      ~~^~~~~~
      |                              ()
a.cc:13:20: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   13 |     mod[i] = ((s[s.length -i - 1] - '0') * list[i] + mod[i - 1]) % 2020;
      |                  ~~^~~~~~
      |                          ()
a.cc:16:24: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   16 |   for(int i = 0; i < s.length; i++){
      |                      ~~^~~~~~
      |                              ()
Language: C

#include<stdio.h>
#include<string.h>


int main(){
   int i=0;
  char s[200001];
   long long a=0,d=1LL,x=0,count[2019]={1LL};
    i=scanf("%s",s);
    i=strlen(s);
   while(i--){
           x=(x+(s[i]-'0')*d)%2019;
            a+=count[x]++;
               d=d*10%2019;
               }
        printf("%lld\n",a)；
               return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:27: error: expected ';' before '\U0000ff1b'
   16 |         printf("%lld\n",a)；
      |                           ^~
      |                           ;