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

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

long long n;
string s;
vector<long long> cnt, sum;

long long solve();

int main() {
  cin >> s;
  n = s.size();
  cout << solve() << endl;
  return 0;
}

long long solve() {
  reverse(s.begin(), s.end());
  cnt.assign(2019, 0);
  sum.assign(n + 1, 0);
  cnt[0] = 1;
  long long res = 0, ten = 1;
  for (int i = 0; i < n; ++i, (ten *= 10) %= 2019) {
    sum[i + 1] = sum[i];
    sum[i + 1] += (s[i] - '0') * ten;
    sum[i + 1] %= 2019;
    res += cnt[sum[i + 1]];
    ++cnt[sum[i + 1]];
  }
  return 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

function main()
    s=readline()
    l=length(s)
    x=0
    for i=1:l-3,j=i+3:l
        
        y=parse(Int,s[i:j])
        x+=y%2019==0 ? 1 : 0
    end

    print(x)
end

main()

Compiler output:
main.c:1:1: error: unknown type name 'function'; did you mean 'union'?
    1 | function main()
      | ^~~~~~~~
      | union
main.c: In function 'main':
main.c:2:5: error: expected declaration specifiers before 's'
    2 |     s=readline()
      |     ^
Language: C

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
/******************************************
* AUTHOR : PANDRAVISAM SHIVA SANTHOSH *
* Handle : santhosh_80 *
* INSTITUTION : IIT Palakkad *
******************************************/
typedef tree<int,null_type,less<int>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;
#define ll long long int 
#define mod 1000000007
#define rep(i,a,b) for(int i=a;i<b;i++)
#define pii pair<int,int>
#define all(v) (v).begin(),(v).end()
#define S(x) scanf("%d",&(x))
#define P(x) printf("%d\n",(x))
#define Sl(x) scanf("%lld",&(x))
#define Pl(x) printf("%lld\n",(x))
#define pb push_back
#define f first
#define s second

//can be used for all values of p which are not co-prime with 10 

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	//int n;cin >> n ;
	int p = 2019 ;
	unordered_map<int ,ll> m ;
	ll pow_10 = 1;
	ll ans = 0;
	ll rem = 0;
	string str;cin >> str;
	int n = str.size();
	m[0]++;

	for(int i = n-1; i >= 0; i--){

		int x = str[i]-'0';
		rem = (rem + pow_10*x)%p ;
		m[rem]++;
		pow_10 = (pow_10*10)%p;
		rem=rem%p;
	}

	for(auto x : m){
		//if(x.f == 0)continue;
		ans = ans + (x.s)*(x.s-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 <bits/stdc++.h>
#define REP(i, n) for (ll i = 0; i < (ll)n; i++)
#define REPvec(itr, mp) for (auto itr = mp.begin(); itr != mp.end(); itr++)
#define all(x) x.begin(), x.end()
#define MOD 1000000007  // 1e9+7
using namespace std;
typedef long long int ll;
typedef vector<int> vecint;
typedef vector<ll> vecll;
typedef vector<double> vecd;
typedef vector<string> vecstr;
typedef vector<char> vecchar;
typedef vector<bool> vecbool;
typedef vector<vector<bool> > vec2bool;
typedef vector<vector<int> > vec2int;
typedef vector<vector<double> > vec2d;
////////////////////////////////////////////////
void init() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}
////////////////////////////////////////////////
int main() {
  init();
  string s;
  cin >> s;
  int n = s.size();
  vecint pow10(n, 1);
  REP(i, n - 1) { pow10[i + 1] = (pow10[i] * 10) % 2019; }
  vecint mod(n, 0);
  mod[n - 1] = s[n - 1] - '0';
  vecint dp(2019, 0);
  dp[0] = 1;
  for (int i = n - 2; i >= 0; i--) {
    mod[i] = mod[i + 1] + (s[i] - '0') * pow10[n - i - 1];
    mod[i] %= 2019;
    dp[mod[i]]++;
  }

  // REP(i, n) { cout << pow10[i] << endl; }
  // REP(i, n) { cout << mod[i] << endl; }
  int ans = 0;

  REP(i, 2019) ans += dp[i] * (dp[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 <iostream>
#include <string>
#include <vector>
 
using namespace std;
using ll = long long;
using vi = vector<int>;
#define rloop(i, n) for (int i = (int)n - 1; i >= 0; i--)
 
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
 
int main() {
    string s; cin >> s;
	vi a(2019, 0);
	a[0] = 1;
	int t = 0;
	rloop(i, s.size()) {
		t = (modpow(10, s.size() - i - 1, 2019) * (s[i] - 48) + t) % 2019;
		a[t]++;
	}
	ll sum = 0;
	loop(i, 2019) {
		sum += a[i] * (a[i] - 1) / 2;
	}
	cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:14: error: 'i' was not declared in this scope
   30 |         loop(i, 2019) {
      |              ^
a.cc:30:9: error: 'loop' was not declared in this scope; did you mean 'rloop'?
   30 |         loop(i, 2019) {
      |         ^~~~
      |         rloop
Language: C

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

using namespace std;
using ll = long long;
using vi = vector<int>;
#define rloop(i, n) for (int i = (int)n - 1; i >= 0; i--)

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

int main() {
    string s; cin >> s;
	vi a(2019, 0);
	a[0] = 1;
	int t = 0;
	rloop(i, s.size()) {
		t = (modpow(10, s.size() - i - 1, 2019) * (s[i] - 48) + t) % 2019;
		a[t]++;
	}
	ll sum = 0;
	loop(i, 2019) {
		sum += a[i] * (a[i] - 1) / 2;
	}
	cout << sum << endl;
}


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

#include <iostream>
#include <cstdlib>
#include <utility>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <numeric>

using namespace std;

using ll = long long;
using vi = vector<int>; using vi2 = vector<vi>; using vi3 = vector<vi2>;
using vll = vector<ll>; using vll2 = vector<vll>; using vll3 = vector<vll2>;
using pi = pair<int, int>; using pll = pair<ll, ll>;
using vpi = vector<pi>; using vpll = vector<pll>;

#define loopi(i, a, b) for(int i = (int)a; i < (int)b; i++)
#define loop(i, n) for (int i = 0; i < (int)n; i++)
#define loopeq(i, n) for (int i = 0; i <= (int)n; i++)
#define rloopi(i, a, b) for(int i = (int)a - 1; i >= (int)b; i--)
#define rloop(i, n) for (int i = (int)n - 1; i >= 0; i--)
#define rloopeq(i, n) for (int i = (int)n - 1; i >= 1; i--)
#define all(a) (a).begin(), (a).end()

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

int main() {
    string s; cin >> s;
	vi a(2019, 0);
	a[0] = 1;
	int t = 0;
	rloop(i, s.size()) {
		t = (modpow(10, s.size() - i - 1, 2019) * (s[i] - 48) + t) % 2019;
		a[t]++;
	}
	ll sum = 0;
	loop(i, 2019) {
		sum += a[i] * (a[i] - 1) / 2;
	}
	cout << sum << endl;
}


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

#include <iostream>
#include <cstdlib>
#include <utility>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <numeric>

using namespace std;

using ll = long long;
using vi = vector<int>; using vi2 = vector<vi>; using vi3 = vector<vi2>;
using vll = vector<ll>; using vll2 = vector<vll>; using vll3 = vector<vll2>;
using pi = pair<int, int>; using pll = pair<ll, ll>;
using vpi = vector<pi>; using vpll = vector<pll>;

#define loopi(i, a, b) for(int i = (int)a; i < (int)b; i++)
#define loop(i, n) for (int i = 0; i < (int)n; i++)
#define loopeq(i, n) for (int i = 0; i <= (int)n; i++)
#define rloopi(i, a, b) for(int i = (int)a - 1; i >= (int)b; i--)
#define rloop(i, n) for (int i = (int)n - 1; i >= 0; i--)
#define rloopeq(i, n) for (int i = (int)n - 1; i >= 1; i--)
#define all(a) (a).begin(), (a).end()

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

int main() {
    string s; cin >> s;
	vi a(2019, 0);
	a[0] = 1;
	int t = 0;
	rloop(i, s.size()) {
		t = (modpow(10, s.size() - i - 1, 2019) * (s[i] - 48) + t) % 2019;
		a[t]++;
	}
	ll sum = 0;
	loop(i, 2019) {
		sum += a[i] * (a[i] - 1) / 2;
	}
	cout << sum << 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;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rept(i,k,n) for(int i = (k); i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define Sort(v) sort(v.begin(),v.end())
#define Reverse(v) reverse(v.begin(),v.end())
typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<long long,long long> Pll;

template <typename T>
ostream& operator<<(ostream& s, const vector<T> &vec){
    for(int i=0;i<vec.size();i++){
        if(i) s << ',';
        else s << '{';
        s <<setw(2)<< vec[i];
    }
    s << '}' << endl;
    return s;
}
int ctoi(const char c){
    if('0' <= c && c <= '9') return (c-'0');
    return -1;
}

int main(){
    string s;
    cin>>s;
    int n=s.size();
    map<int,int> dp;
    int k=0,l=1;
    dp[0]=1;
    rep(i,n){
        k = (k+l*ctoi(s[n-1-i]))%2019;
        dp[k]++;
        l = l*10%2019;
    }
    ll ans =0;
    for(auto p:dp){
        ans += p.second*(p.second-1)/2;
    }
    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>
using namespace std;

#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep1(i, n) for (ll i = 1; i <= (ll)(n); i++)
#define INF 1000000000000
#define MOD 1000000007
using ll = long long;

int main(){
  string S;cin>>S;
  ll L = S.size();
  vector<ll> dp(L);
  ll num = 0;
  for(ll i = L-1; i >= 0; i--){
    num += ((int)S.at(i)-'0')*pow(10.0,L-i-1)%2019;
    // cout<<num<<endl;
    num%=2019;
    ll tmp = num;
    dp.at(i) = tmp%2019;
  }
  sort(begin(dp),end(dp));
  map<int,ll> m;
  for(auto i: dp){
    if(m.count(i))m[i]++;
    else m[i]=1;
  }
  ll res = 0;
  for(auto p: m){
    int num = p.first;
    ll cnt = p.second;
    //cout<<num<<" "<<cnt<<endl;
    if(num==0)res += (cnt-1)*cnt/2;
    else if(cnt!=1) res += (cnt-1)*cnt/2;
  }
  cout<<res<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:46: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
   16 |     num += ((int)S.at(i)-'0')*pow(10.0,L-i-1)%2019;
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
      |                              |                |
      |                              |                int
      |                              __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

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

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


int sum=0;
for(int i=0;i<n;i++){
    for(int j=i+1;j<n;j++){
        string num=s.substr(i,j-i+1);
         long x=stol(num);
         if(x%2019==0){
             sum+=1;
             }
  
    }
}

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

s=input()
N=len(s)
kyonen=2019
modlist=[int(s[-1])%kyonen]
t=0
for i in range(2,N+1):
    modlist.append((modlist[-1]+int(s[(-1)*i])*10**(i-1))%kyonen)
modlist.sort()
now=modlist[0]
nowc=1
ans=0
if modlist[0]==0:
    ans+=1
for i in range(1,N):
    if modlist[i]==0:
        ans+=1
    if modlist[i]==now:
        nowc+=1
    else:
        if nowc>=2:
            ans+=int(nowc*(nowc-1)/2)
        nowc=1
        now=modlist[i]

if nowc>=2:
    ans+=int(nowc*(nowc-1)/2)

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:3: error: implicit declaration of function 'input' [-Wimplicit-function-declaration]
    1 | s=input()
      |   ^~~~~
main.c:1:3: error: initializer element is not constant
main.c:2:1: error: expected ',' or ';' before 'N'
    2 | N=len(s)
      | ^
Language: C

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <utility>
#include <algorithm>
#include <cmath>
#include <climits>
#include <iomanip>
#include <queue>
#include <stack>

using namespace std;

typedef long long ll;

int main() {
    string s;
    cin >> s;
    ll l = s.length();
    ll *dp = new ll[l+1];
    dp[l] = 0;
    ll p = 1;
    for (int i = l-1; i >= 0; i--) {
        dp[i] = dp[i+1] + (s[i]-'0')*p;
        dp[i] %= 2019;
        p*=10;
        p%=2019;
    }

    map<ll, ll> m;
    for (int i = 0; i <= l; i++)
        m[dp[i]]++;

    ll ans = 0;
    for (auto ite = m.begin(); ite != m.end(); ite++)
        ans += (*ite).second * ((*ite).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<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define F first
#define S second
#define pi acos(-1)
using ll = long long;
using namespace std;
using namespace __gnu_pbds;
using vl = vector<ll>;
using pll =  pair<ll,ll>;
const ll mod = 1000000007;
const ll infi = 1000000000000000;
const ll md = 998244353;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;


ll power(ll x,ll y){
	x = x%mod;
    ll res = 1;
    while(y){
        if(y&1)
            res = (res*x)%mod;
        x = (x*x)%mod;
        y = y/2;
    }
    return res;
}



void solve(){
	string s;
	cin>>s;
	reverse(s.begin(),s.end());
	ll ans = 0,remainder = 0,power_ten = 1;;
	map<ll,ll> mp;
	mp[0]++;
	for(int i=0;i<s.size();i++){
		remainder = ( remainder + power_ten*(s[i] - '0'))%2019;
		mp[remainder]++;
		power_ten = power_ten *10%2019;
	}
	
	for(int i=0;i<2019;i++)
		ans += (mp[i]*(mp[i] - 1))/2;
	
	cout<<ans;
}	


 
int main()
{
    
    #ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
    #endif

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    //int n; cin>>n; for (int i = 0; i < n; ++i)
    solve();
    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;

int main(){

  string S;
  cin >> S;
  vector<string> num(100);

  int count = 0;

  /*for(int i=0;i<S.length();i++){
    for(int j=i+1;j<=S.length();j++){
      string nowStr = S.substr(i,j-i);
      int num = atoi(nowStr.c_str());
      if(num%2019==0) count++;
    }
  }

  cout << count << endl;*/

  for(int i=1;i<200000;i++){
    int num = 2019*i;
    if(num > 200000){
      cout << i << endl;
      break;
    }
    cin << num[i];
  }

  for(int i=0;i<100;i++){
    if(S.find(num[i])!= -1) count++;
  }

  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:15: error: invalid types 'int[int]' for array subscript
   28 |     cin << num[i];
      |               ^
Language: C

#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include<math.h>
#include<iomanip>
#include<functional>
using namespace std;

#define ll long long
using vt = ll; //ここで数値の型を変えられる
#define rep(i, n) for (vt i = 0; i < (vt)(n); i++)
#define reps(i, s, n) for(vt i = (vt) (s); i < (vt) (n); i++) 
#define all(v) v.begin(), v.end()
#define P pair<ll, ll>
const ll  MOD = 1000000007;

vt pow_mod_rep_square(vt n, vt p, vt mod) { //mod付き
	if (p == 0) return 1;
	else if (p % 2 == 0) {
		vt t = pow_mod_rep_square(n, p / 2, mod);
		return t * t % mod;
	}
	else return n * pow_mod_rep_square(n, p - 1, mod) % mod;
}

vt inv_Felmat(vt a, vt mod) {
	return pow_mod_rep_square(a, mod - 2, mod);
}

int main() {
	string s;
	cin >> s;
	if (s.size() < 5) {
		cout << 0;
		return 0;
	}
	reverse(all(s));
	vector<int> v(s.size());
	rep(i, s.size()) {
		int x = s.at(i) - '0';
		v.at(i) = (x * pow_mod_rep_square(10, i, 2019)) % 2019;
	}
	reps(i, 1, s.size()) {
		v.at(i) += v.at(i - 1);
		v.at(i) %= 2019;
	}	
	int ans = 0;
	reps(i, 4, s.size()) if (v.at(i) == 0) ans++;
	set<int> u;
	rep(i, v.size()) {
		u.insert(v.at(i));
	}
	ans += v.size() - u.size();
	cout << ans;
	return 0;
}

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

n = input()
count = 0
li = [0 for i in range(2019)]
for i in range(len(n)):
    a = int(n[i:])%2019
    if a == 0:
        count += 1
    else:
        li[a] += 1
aa = list(map(lambda x:x*(x-1)/2,li))
print(int(sum(aa)+count))

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

n = input()
count = 0
li = [0 for i in range(2019)]
for i in range(len(n)):
    a = int(n[i:])%2019
    if a == 0:
        count += 1;
    else:
        li[a] += 1
aa = list(map(lambda x:x*(x-1)/2,li))
print(int(sum(aa)+count))

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = input()
      | ^
a.cc:8:5: error: expected unqualified-id before 'else'
    8 |     else:
      |     ^~~~
Language: C

#include <stdio.h>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <queue>

//#include <bits/stdc++.h>
using namespace std;
#define print(x) cout<<(x)<<endl
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define ll long long int
#define pb push_back

long long N;
string S;
int P = 2019;

long long solve() {
    if (P == 2 || P == 5) {
        long long res = 0;
        for (int i = 0; i < N; ++i) if ((S[N-i-1]-'0') % P == 0) res += N-i;
        return res;
    }
    vector<long long> val(P, 0);
    long long tenfactor = 1;
    long long cur = 0;
    val[cur]++;
    for (int i = 0; i < N; ++i) {
        cur = (cur + (S[N-i-1]-'0') * tenfactor) % P;
        tenfactor = (tenfactor * 10) % P;
        val[cur]++;
    }
    long long res = 0;
    for (int p = 0; p < P; ++p) res += val[p] * (val[p] - 1) / 2;
    return res;
}

int main() {
    cin >> S;
    N = S.size();
    cout << solve() << endl;
}


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

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define debug(a) cout << #a << ": " << a << endl
#define sz(a) int(a.size())
#define rep(i,n) for(int i=0;i<n;i++)
#define forr(i, st, en) for(int i = st; i <= en; i++)
#define all(v) (v).begin(),(v).end()

#define fast cin.tie(0); ios::sync_with_stdio(false)

int32_t main(){ fast;
	
	string s; cin>>s;
	vector<ll> dp(2019);
	ll answer = 0;
	for(char c: s){
		vector<ll> new_dp(2019);
		rep(i, 2019){
			new_dp[(i * 10 + (c - '0')) % 2019] += dp[i];
		}
		new_dp[c - '0']++;
		answer += new_dp[0];
		dp = new_dp;
	}
	cout<<answer<<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 <cstdio>
#include <cstring>
#include <climits>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <sstream>
#include <numeric>
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>

///////////////////////////////////////////////////////////////
// namespace
///////////////////////////////////////////////////////////////
using namespace std;
namespace mp = boost::multiprecision;

///////////////////////////////////////////////////////////////
// types
///////////////////////////////////////////////////////////////
using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using mpi = mp::cpp_int;
using mpf = mp::number<mp::cpp_dec_float<1024>>;

///////////////////////////////////////////////////////////////
// mod https://qiita.com/drken/items/3b4fdf0a78e7a138cd9a
///////////////////////////////////////////////////////////////
// ll MOD = 1000000007;
//
// ll mod(long long val) {
//     long long res = val % MOD;
//     if (res < 0) res += MOD;
//     return res;
// }
//
// ll modinv(ll a) {
//     ll b = MOD, u = 1, v = 0;
//     while (b) {
//         ll t = a / b;
//         a -= t * b; swap(a, b);
//         u -= t * v; swap(u, v);
//     }
//     u %= MOD;
//     if (u < 0) u += MOD;
//     return u;
// }
//
// const int MAX = -1;
// ll fac[MAX], finv[MAX], inv[MAX];
// void com_init() {  // initialize nCk table with O(N)
//     fac[0] = fac[1] = 1;
//     finv[0] = finv[1] = 1;
//     inv[1] = 1;
//     for (int i = 2; i < MAX; i++){
//         fac[i] = fac[i - 1] * i % MOD;
//         inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
//         finv[i] = finv[i - 1] * inv[i] % MOD;
//     }
// }
// ll com(int n, int k){  // nCk
//     if (n < k) return 0;
//     if (n < 0 || k < 0) return 0;
//     return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
// }

int main() {
    string s;
    cin >> s;
    string t = "";
    map<int, int> m;
    m[0]++;
    int n = s.size();
    for (int l = 0; l < ; ++l) {
        t += s[n-l-1];
        mpi u(t);
        m[(int)(u % 2019)]++;
    }
    int ans = 0;
    for (const auto &kv: m) {
        int k = kv.second;
        if (k == 0) continue;
        ans += k * (k - 1) / 2;
    }
    cout << ans << endl;
    return 0;
}


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

S = input()
a = []
b = [0]*2019
c = 0
d = 0
for n in range(len(S)):
    c += 10*n*int(S[-n-1])
    a.append(c%2019)
for n in range(len(S)):
    b[a[n]] += 1
for n in range(2019):
    d += int(b[n]*(b[n]-1)/2)
print(d)

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:2:1: error: expected ',' or ';' before 'a'
    2 | a = []
      | ^
Language: C

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

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

  string S;
  cin >> S;
  int count = 0;
  for(int i = 0; i < S.size() ; ++i){
    for(int j = i + 1; j < S.size() + 1; ++j){
      string x;
      for(int t = 0; t < j - i; ++t){
        x += S[i + t]; 
      }
      long long num = stoll(x);
      if(num % 2019 == 0){
        count++;
      }
    }
  }
  cout << count <<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

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }

    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        String S = scan.next();
        char[] t = S.toCharArray();
        int N = t.length;
        int[] d = new int[N];
        for (int i = 0; i < N; i++) {
            d[i] = t[i] - '0';
        }
        int[] sum_mod = new int[N+1];
        int ten_pow = 1;
        for (int i = 1; i <= N; i++) {
            int temp = d[N - i] * ten_pow;
            temp %= 2019;
            sum_mod[i] = sum_mod[i-1] + temp;
            sum_mod[i] %= 2019;
            ten_pow *= 10;
            ten_pow %= 2019;
        }
        int[] summary = new int[2019];
        for (int i = 0; i <= N; i++) {
            summary[sum_mod[i]] += 1;
        }
        long ans = 0;
        for (int i = 0; i < 2019; i++) {
            if (summary[i] < 2) {
                continue;
            }
            ans += summary[i] * (summary[i] - 1) / 2;
        }
        System.out.println(ans);
    }
}


Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.io.BufferedReader;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.io.BufferedReader;
      |            ^
main.c:2:1: error: unknown type name 'import'
    2 | import java.io.InputStreamReader;
      | ^~~~~~
main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | import java.io.InputStreamReader;
      |            ^
main.c:3:1: error: unknown type name 'import'
    3 | import java.util.Scanner;
      | ^~~~~~
main.c:3:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    3 | import java.util.Scanner;
      |            ^
main.c:5:1: error: unknown type name 'public'
    5 | public class Main {
      | ^~~~~~
main.c:5:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    5 | public class Main {
      |              ^~~~
Language: C

#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include<math.h>
#include<iomanip>
#include<functional>
using namespace std;

#define ll long long
using vt = ll; //ここで数値の型を変えられる
#define rep(i, n) for (vt i = 0; i < (vt)(n); i++)
#define reps(i, s, n) for(vt i = (vt) (s); i < (vt) (n); i++) 
#define all(v) v.begin(), v.end()
#define P pair<ll, ll>
const ll  MOD = 1000000007;

vt pow_mod_rep_square(vt n, vt p, vt mod) { //mod付き
	if (p == 0) return 1;
	else if (p % 2 == 0) {
		vt t = pow_mod_rep_square(n, p / 2, mod);
		return t * t % mod;
	}
	else return n * pow_mod_rep_square(n, p - 1, mod) % mod;
}

vt inv_Felmat(vt a, vt mod) {
	return pow_mod_rep_square(a, mod - 2, mod);
}

int main() {
	string s;
	cin >> s;
	if (s.size() < 5) {
		cout << 0;
		return 0;
	}
	reverse(all(s));
	vector<int> v(s.size());
	rep(i, s.size()) {
		int x = s.at(i) - '0';
		v.at(i) = (x * pow_mod_rep_square(10, i, 2019)) % 2019;
	}
	reps(i, 1, s.size()) {
		v.at(i) += v.at(i - 1);
		v.at(i) %= 2019;
	}	
	int ans = 0;
	reps(i, 4, s.size()) if (v.at(i) == 0) ans++;
	rep(i, s.size() - 4) {
		reps(j, i + 4, s.size()){
			if (((v.at(j) - v.at(i)) * inv_Felmat(pow_mod_rep_square(10, j - i, 2019), 2019) % 2019)== 0) {
				ans++;
			}
		}
	}
	cout << ans;
	return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}
const ll INF = 1LL<<60;
const ll M = 1000000007;
ll mpow(ll a,ll b){ll res=1;while(b!=0){if(b&1)res=res*a%M;a=a*a%M;b=b>>1;}return res;}
ll mcomb(ll n,ll k){if(k>n/2)return mcomb(n,n-k);ll res=1;for(ll i=0;i<k;i++){res=res*(n-i)%M;res=res*mpow(k-i,M-2)%M;}return res;}
/*template*/
 
ll hpow(ll a,ll b){
  ll res=1;
  while(b!=0){
    if(b&1)res=res*a%2019;
    a=a*a%2019;
    b=b>>1;
  }
  return res;
}
 
int main()
{
  string s;cin>>s;
  ll n=s.length();
  ll a[2019]={0};
  ll hoge=0;
  for(ll i=0;i<n;i++){
    hoge=(hoge+(s[n-1-i]-'0')*hpow(10,i))%2019;
    a[hoge]++;
  }
  ll ans=0;
  for(ll i=0;i<2019;i++){
    ans+=a[i]*(a[i]-1)/2;
  }
  cout<<ans+a[0]<<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 ll long long
#define ull unsigned long long

using namespace std;

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

	ll N = S.size();
	ll MOD = 2019;

	ll ans = 0;
	map<int, int> m;
	ll base = 1;
	ll sum = 0;
	for (int ii = N-1; ii >= 0; --ii){
		ll v = ((S[ii] - '0') * base) % MOD;
		sum = (sum + v) % MOD;
		m[sum]++;
		ans += m[sum] - 1;
		if (sum == 0) ans++;
		base = (base * 10) % MOD;
	}

	cout << ans << "\n";

	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>

using namespace std;

int main()
{
    cin.tie(0);
    cin.sync_with_stdio(0);

    string s;
    cin >>s;
    if(s.size()<4) {cout<<0;return 0;}
    long long c=0; string a[100]={};
    for(int i=1;i<100;i++)
    {
        a[i]=to_string(i*2019);
    }
    for(int j=1;j<100;j++){
    for(int i=0;i<s.size()-3;i++)
    {
        if(s.substr(i,4)==a[j]) c++;
        if(s.size()-i>=5&&s.substr(i,5)==a[j]) c++;
        if(s.size()-i>=6&&s.substr(i,6)==a[j]) c++;
    }
    }
    cout<<c;
    return 0;
}
#include <bits/stdc++.h>

using namespace std;

int main()
{
    cin.tie(0);
    cin.sync_with_stdio(0);

    string s;
    cin >>s;
    if(s.size()<4) {cout<<0;return 0;}
    long long c=0; string a[100]={};
    for(int i=1;i<100;i++)
    {
        a[i]=to_string(i*2019);
    }
    for(int j=1;j<100;j++){
    for(int i=0;i<s.size()-3;i++)
    {
        if(s.substr(i,4)==a[j]) c++;
        if(s.size()-i>=5&&s.substr(i,5)==a[j]) c++;
        if(s.size()-i>=6&&s.substr(i,6)==a[j]) c++;
    }
    }
    cout<<c;
    return 0;
}


Compiler output:
a.cc:33:5: error: redefinition of 'int main()'
   33 | int main()
      |     ^~~~
a.cc:5:5: note: 'int main()' previously defined here
    5 | int main()
      |     ^~~~
Language: C

#include<stdio.h>
#include<math.h>
int main()
{
    int i, j, length = 0, sum = 0;
    unsigned long long int s,num;
    scanf_s("%d", &s);
    unsigned long long int s2 = s;
    while (s2 > 0)
    {
        s2 /= 10;
        length++;
    }
    for (i = 1;i <= length - 3;i++)
    {
        for (j = length;j >= i + 3;j--)
        {
            num = (s % (unsigned long long int)pow(10,length - i+1)) / (unsigned long long int)pow(10,length - j);
            if (num % 2019 == 0) sum++;
        }
    }
    printf("%d", sum);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:5: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    7 |     scanf_s("%d", &s);
      |     ^~~~~~~
      |     scanf
Language: C

#include <bits/stdc++.h>
using namespace std;
using ll=long long int;
using ld=long double;
using VI=vector<ll>;
using VD=vector<ld>;
using VVI=vector<VI>;
using VC=vector<char>;
using VVC=vector<VC>;
using VS=vector<string>;
using PLL =pair<ll,ll>;
using PLD=pair<ld,ld>;
using VPLL=vector<PLL>;
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element((x).begin(),(x).end())
#define MIN(x) *min_element((x).begin(),(x).end())
#define SORTR(x) sort((x).rbegin(),(x).rend())
#define SORT(x) sort((x).begin(),(x).end())
#define SUM(x) accumulate((x).begin(),(x).end(), 0)
#define FILL(x,a) fill(x.begin(),x.end(),a)
#define EACH(i,x) for(typeof((x).begin()) i=(x).begin(); i!=(x).end(); ++i)

const int INF  = 1<<30;
const ld EPS   = 1e-10;
const int MOD  = int(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; }
template <class BidirectionalIterator>
bool next_partial_permutation(BidirectionalIterator first, BidirectionalIterator middle,BidirectionalIterator last){reverse(middle, last); return next_permutation(first , last);}
#define COUT(x) cout<<x<<"\n"


void Main()
{
	ll result=0;
	string S;
	cin>>S;
	VI ten(SIZE(S),1);
	const int DIV=2019;
	FOR(i,1,SIZE(S)){
		ten[i]=10*ten[i-1];	//10の倍数？？
		ten[i]%=DIV;		//2019で割ったあまり
	}
	ll tmp=0;
	ll appear[3000];
	appear[0]=1;
	FORD (i,SIZE(S)-1,0) {
		tmp+=ten[SIZE(S)-i-1]*(S[i]-'0');	//
		tmp%=DIV;							//
		result+=appear[tmp];				//2019で割り切れる数だけ加える？
		appear[tmp]++;						//
	}
	cout << result << "\n";
	return;
}

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


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;

using ll = long long;

int nums(char s){
  return s - '0';
}

int main()
{
  string s;
  cin >> s;
  int leng = s.length();
  ll sn = 0;
  vector<int> v(2019, 0);

  v.at(0) = 1;
  int amari = 0;
  int ten = 1;
  for(int i = leng-1; i>=0; i--){
    amari = amari + nums(s[i]) * ten;
    ten *= 10;
    ten %= 2019;
    amari %= 2019;
    // cout << amari << endl;
    v.at(amari) += 1;
  }

  int ans = 0;
  for(int i = 0; i<2019; i++){
    ans += v.at(i) * (v.at(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 <iostream>
//#include <algorithm>
// #include <iomanip>
#define ll long long
#define map unordered_map
#define set unordered_set

using namespace std;

const ll MOD = 1000000007;
const ll INF = (1LL << 62);

vector<ll> num_list;

ll dp[200005];

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

int main() {
  // std::cout << std::fixed << std::setprecision(10);
  string s;
  cin >> s;

  for (auto a : s) {
    num_list.push_back(a - '0');
  }

  ll current_num = 0;
  for (ll i = num_list.size() - 1; i >= 0; i--) {
    ll n = num_list[i];
    ll dg = s.length() - i;

    ll num = fastpow(10, dg - 1, 2019) * n;

    ll total = current_num + num;

    ll am = total % 2019;

    current_num = (current_num + num) % 2019;
    // cout << n << ":" << num << ":" << am << endl;

    ll j = num_list.size() - i;
    dp[j] = am;
  }

  // cout << "--------" << endl;

  map<ll, ll> m;

  ll ans = 0;
  for (ll i = 0; i < num_list.size() + 1; i++) {
    ll am = dp[i];

    // cout << "am:" << am << endl;
    ans += m[am];

    m[am] += 1;
  }
  cout << ans << endl;
}

// 1817181712114
// 18171
//     18171
//         12114
//
//
//

//
//
//
// 2019
//
// 2019 = 673 * 3
//
// 12
//
// 2019
// 4038
// 6057
// 8076
// 10095
// 12114
// 14133
// 16152
// 18171
// 20190
// 22209
// 24228
// 26247
// 28266
// 30285
// 32304
// 34323
// 36342
// 38361
// 40380
// 42399
// 44418
// 46437
// 48456
// 50475
// 52494
// 54513
// 56532
// 58551
// 60570
// 62589
// 64608
// 66627
// 68646
// 70665
// 72684
// 74703
// 76722
// 78741
// 80760
// 82779
// 84798
// 86817
// 88836
// 90855
// 92874
// 94893
// 96912
// 98931


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>
#include<string>
#include<math.h>
using namespace std;

int main(){
  string s;
  cin >> s;
  int sum = 0;
  int count = 0;
  for(int i = s.size()-1; i >= 0; i--){
    for(int j = i-3; j >= 0; j--){
      for(int k = i; k >= j; k--){
        sum = 0;
        sum += （s[k]-48） * pow(10, i-k);
      }
      if(sum % 2019 == 0){
        count++;
      }
    }
  }
  cout << count << endl;
  return 0;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: '\U0000ff08s' was not declared in this scope
   15 |         sum += （s[k]-48） * pow(10, i-k);
      |                ^~~
a.cc:15:23: error: unable to find numeric literal operator 'operator""\U0000ff09'
   15 |         sum += （s[k]-48） * pow(10, i-k);
      |                       ^~~~
Language: C

#include <bits/stdc++.h>
using namespace std;
#define forn(i, n) for(int i = 0; i < int(n); i++)
#define fore(i, l, r) for(int i = int(l); i < int(r); i++)
#define pb push_back
#define deb(x) cout<<#x<<" "<<x<<endl;
#define deb2(x, y) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<endl;
#define deb3(x, y, z) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<" "<<#z<<" "<<z<<endl;
#define all(x) x.begin(), x.end()
#define sz(a) int((a).size())
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef pair<int, int> pii;
const int mod = 1e9 + 7;
template<class T, class U> inline void add_self(T &a, U b){a += b;if (a >= mod) a -= mod;if (a < 0) a += mod;}
template<class T, class U> inline void min_self(T &x, U y) { if (y < x) x = y; }
template<class T, class U> inline void max_self(T &x, U y) { if (y > x) x = y; }

template <typename T>void print(T v, bool show_index = false){int w = 2;if(show_index){for(int i=0; i<v.size(); i++)cout<<setw(w)<<i<<" ";cout<<endl;}for(auto i= v.begin(); i!=v.end(); i++)cout<<setw(w)<<*i<<" ";cout<<endl;}
template <typename T>void print_vv(T v){if(v.size()==0) {cout<<"Empty"<<endl; return;} int w = 3;cout<<setw(w)<<" ";for(int j=0; j<v[0].size(); j++)cout<<setw(w)<<j<<" ";cout<<endl;for(auto i= 0; i<v.size(); i++){cout<<i<<" {";for(auto j = 0; j!=v[i].size(); j++){cout<<setw(w)<<v[i][j]<<",";}cout<<"},"<<endl;}cout<<endl;}
template <class T, class U> void print_m(map<T,U> m, int w=3){if(m.empty()){cout<<"Empty"<<endl; return;}for(auto x: m)cout<<"("<<x.first<<": "<<x.second<<"),"<<endl;cout<<endl;}

int dp[2][2020];
int rem[100000];

// At each position find the count of numbers%2019

int main(){
    string s;
    while(cin>>s){
        memset(dp,0,sizeof(dp));

        int n = s.size();
        forn(i,100000)
            rem[i] = i%2019;
        
        ll ans = 0;
        dp[0][s[0]-'0'] = 1;
        fore(i,1,n){
            forn(j,2019){
                int nxt = rem[(10*j + s[i]-'0')%mod];
                dp[1][nxt] += dp[0][j];
            }

            ans+=dp[1][0];
            memcpy(dp[0], dp[1], sizeof(dp[1]));
            dp[0][s[i]-'0']++;
            memset(dp[1], 0, sizeof(dp[1]));
        }

        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<iostream>
#include<cstdlib>
#include<cstdio>
#include<string>
#include<iomanip>
#include<algorithm>
#include<vector>
using namespace std;
 
int N, M;
 
 
int main(){
 
    string S;
    cin >> S;
    int length = (int)S.length();
    vector<int> mod(length);
    int T = 0;
    int res = 0;

    T[length-1] = 0;


    for(int i=0;i<length;i++){
        mod[i] = 0;
    }

    for(int i=length-1;i>=0;i--){
        T = 10*T + (int)S[i];
        mod[T%2019]++;
    }

    for(int i=0;i<length;i++){
        res += mod[i]*(mod[i]-1)/2;
    }

    cout << res;
}   

Compiler output:
a.cc: In function 'int main()':
a.cc:22:6: error: invalid types 'int[int]' for array subscript
   22 |     T[length-1] = 0;
      |      ^
Language: C

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

using namespace __gnu_pbds; 
using namespace std;

using   ll=long long;
using   ld=long double;

#define fast        	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ordered_set1 	tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define endl        	"\n"
#define pb          	push_back
#define mp          	make_pair
#define F           	first
#define S           	second
#define pll         	pair<ll,ll>
#define vec     		vector<ll>
#define ALL(v)      	v.begin(),v.end()
#define ALLR(v)     	v.rbegin(),v.rend()
#define pii         	3.14159265358979323
#define linf     		LLONG_MAX
#define ones(x)     	__builtin_popcount(x)
#define fill(a,b)   	memset(a,b,sizeof(a))
#define mod 			1000000007

ll mod_pow(ll a,ll b)
{
    ll res = 1;
    while(b)
    {
        if(b&1) res=(res*a)%mod;
        a=(a*a)%mod;
        b>>=1;
    }
    return res;
}

ll mod_inverse(ll a)
{
	return mod_pow(a,mod-2);
}

void solve()
{
	string s;
	
	int n;
	
	cin>>s;
	
	n = s.size();
	
	map<int,int> rem;
	
	int remm = 0;
	
	rem[0] = 1;
	
	ll res = 0;
	
	int ten = 1;
	
	for(int i=n-1;i>=0;i--)
	{
		remm = (remm + (s[i]-'0')*ten)%2019;
		
		res += rem[remm];
		
		rem[remm]++;
		
		ten *= 10;
		
		ten %= 2019;
	}
	
	cout<<res;
}

signed main()
{
 
    fast;
 
    ll t;
    
    t=1;
    
    //cin>>t;
    
    while(t--)
    {
        solve();
    }
 
    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: Java

import java.util.Scanner;


public class Main {

	public static void main(String[] args)  {

		Scanner sc = new Scanner(System.in);
		String[] s = sc.next().split("");
		final int REKI = 2019;
		long[][] ans = new long[2][REKI];

		if(s.length < 4) {System.out.println(0); return;}
		int a = 0;
		for(int i = 3 ; i < s.length ; i++ ) {
			int temp =Integer.parseInt(s[i]);
			for(int j = 0 ; j < REKI ; j++ ) {
				if(ans[0][j] > 0) {
					ans[1][(temp + j*10) %REKI] += ans[0][j];
				}
			}
			ans[1][Integer.parseInt(s[i-3]+s[i-2]+s[i-1]+s[i]) % REKI]++;
			
			a+= ans[1][0];
			
			ans[0] = ans[1];
			ans[1] = new long[REKI];
		}

		System.out.println(a);
	}

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

#include<bits/stdc++.h> 
using namespace std;
typedef long long ll;
template<typename T1,typename T2> bool chmin(T1 &a,T2 b){if(a<=b)return 0; a=b; return 1;}
template<typename T1,typename T2> bool chmax(T1 &a,T2 b){if(a>=b)return 0; a=b; return 1;}


ll dp[n+1][2020];

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);
 
    string s;
    cin>>s;
    int n = s.size();
    // reverse(s.begin(),s.end());
    
    // dp[0][0] = 1;
    ll ans = 0;
    for(int i=0;i<n;i++){
        dp[i+1][s[i]-'0']++;
        for(int j=0;j<2019;j++){
            dp[i+1][(j*10+(s[i]-'0')) % 2019] += dp[i][j];
        }
        ans += dp[i+1][0];
    }
    cout << ans << endl;
}


Compiler output:
a.cc:8:7: error: 'n' was not declared in this scope; did you mean 'yn'?
    8 | ll dp[n+1][2020];
      |       ^
      |       yn
a.cc: In function 'int main()':
a.cc:23:9: error: 'dp' was not declared in this scope; did you mean 'dup'?
   23 |         dp[i+1][s[i]-'0']++;
      |         ^~
      |         dup
Language: C++

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

int main()
{
	string s;
  	cin >> s;
  	reverse(s.begin(),s.end());
  	vector<int> t(s.size());
  	int ruizyou = 1;
  	for(int i = 0; i < s.size(); i++)
    {
    	if(i == 0)
        {
          	t.at(i) = s.at(i);
        } 
      	else
        {
        	t.at(i) = t.at(i-1) + s.at(i) * ruizyou;
        }
      	ruizyou *= 10; 
    }
  	for(int i = 0; i < s.size(); i++)
    {
    	t.at(i) %= 2019;
    }
  	int cnt = 0;
  	for(int i = 0; i < t.size(); i++)
    {
    	for(int j = i + 1; j < t.size(); j++;)
        {
        	if(t.at(j) == t.at(i))
            {
            	cnt++;
            }
        }
    }
  	cout << cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:45: error: expected ')' before ';' token
   30 |         for(int j = i + 1; j < t.size(); j++;)
      |            ~                                ^
      |                                             )
a.cc:30:46: error: expected primary-expression before ')' token
   30 |         for(int j = i + 1; j < t.size(); j++;)
      |                                              ^
Language: C

#include <stdio.h>
#include <algorithm>
#include <assert.h>
#include <cmath>
#include <deque>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define ll long long
#define rep2(i,a,b) for(ll i=a;i<=b;++i)
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep3(i,a,b) for(ll i=a;i>=b;i--)
#define REP(e,v) for(auto e:v)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mp make_pair
#define mt make_tuple
#define pq priority_queue<ll>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define vec vector<int>
#define vecll vector<ll>
#define vecpii vector<pii>
#define vecpll vector<pll>
#define vecbl vector<bool>
#define endl "\n"
#define ALL(c) (c).begin(),(c).end()
using namespace std;
int in() {int x;scanf("%d",&x);return x;}
ll lin() {ll x;scanf("%lld",&x);return x;}
string stin(){string s;cin>>s;return s;}
ll modpow(ll a,ll b){
    if(b==0)return 1;
    else if(b%2==0){
        ll d=modpow(a,b/2);
        return d*d%2019;
    }
    else return modpow(a,b-1)*a%2019;
}
int main(){
    string s=stin();
    ll n=(int)s.size();
    vecll a(n);
    rep(i,n)a[i]=s[i]-'0';
    vecll dp(n+1);
    dp[n]=0;
    dp[n-1]=a[n-1];
    rep3(i,n-2,0)dp[i]=(dp[i+1]+a[i]*modpow(10,n-i-1))%2019;
    vec num(2019,0);
    rep(i,n+1)num[dp[i]]++;
    int ans=0;
    rep(i,2019) ans+=num[i]*(num[i]-1)/2;
    cout<<ans<<endl;
}

Compiler output:
main.c:2:10: fatal error: algorithm: No such file or directory
    2 | #include <algorithm>
      |          ^~~~~~~~~~~
compilation terminated.