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

/**********************************************************************
File    .cpp
Author  Takahiro Yamazaki
**********************************************************************/
/**********************************************************************
Include Libraries
**********************************************************************/
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, a, b) for (int i = a; i < b; i++)
/**********************************************************************
Declare variables
**********************************************************************/
/**********************************************************************
Declare instance
**********************************************************************/
/**********************************************************************
Proto_type_Declare functions
**********************************************************************/

/**********************************************************************
Main
**********************************************************************/
int main() {
  // string s;
  // cin >> s;
  // int ans = 0;
  // // int n = s.length();
  // // printf("%s\n", s);
  // // int n = stoi(s.c_str()) / 2019;
  // // int n = stol(s.c_str()) / 2019;
  // int n = 110;
  // // printf("%d\n", n);
  // for (int i = 1; i < n+1; i++) {
  //   int tmp = 2019 * i;
  //   if (s.find(std::to_string(tmp)) != s.npos) {
  //     ans++;
  //   }
  // }
  // printf("%d\n", ans);
  string S;
  long long cnt[2020];
  cin >> S;
  int N = S.length();

  ll ans = 0;
  cnt[0] = 1;
  int tot = 0;
  int p = 1;
  rrep(i, N - 1, 0) {
    tot = (tot + (S[i] - '0') * p) % 2019;

    ans += cnt[tot];

    p = (p * 10) % 2019;
    cnt[tot]++;
  }
  cout << ans << endl;

}
/**********************************************************************
Functions
**********************************************************************/


Compiler output:
a.cc: In function 'int main()':
a.cc:51:3: error: 'll' was not declared in this scope
   51 |   ll ans = 0;
      |   ^~
a.cc:55:8: error: 'i' was not declared in this scope
   55 |   rrep(i, N - 1, 0) {
      |        ^
a.cc:55:3: error: 'rrep' was not declared in this scope; did you mean 'rep'?
   55 |   rrep(i, N - 1, 0) {
      |   ^~~~
      |   rep
a.cc:63:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   63 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

/**********************************************************************
File    .cpp
Author  Takahiro Yamazaki
**********************************************************************/
/**********************************************************************
Include Libraries
**********************************************************************/
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, a, b) for (int i = a; i < b; i++)
/**********************************************************************
Declare variables
**********************************************************************/
/**********************************************************************
Declare instance
**********************************************************************/
/**********************************************************************
Proto_type_Declare functions
**********************************************************************/

/**********************************************************************
Main
**********************************************************************/
int main() {
  // string s;
  // cin >> s;
  // int ans = 0;
  // // int n = s.length();
  // // printf("%s\n", s);
  // // int n = stoi(s.c_str()) / 2019;
  // // int n = stol(s.c_str()) / 2019;
  // int n = 110;
  // // printf("%d\n", n);
  // for (int i = 1; i < n+1; i++) {
  //   int tmp = 2019 * i;
  //   if (s.find(std::to_string(tmp)) != s.npos) {
  //     ans++;
  //   }
  // }
  // printf("%d\n", ans);
  string S;
  ll cnt[2020];
  cin >> S;
  int N = S.length();

  ll ans = 0;
  cnt[0] = 1;
  int tot = 0;
  int p = 1;
  rrep(i, N - 1, 0) {
    tot = (tot + (S[i] - '0') * p) % 2019;

    ans += cnt[tot];

    p = (p * 10) % 2019;
    cnt[tot]++;
  }
  cout << ans << endl;

}
/**********************************************************************
Functions
**********************************************************************/


Compiler output:
a.cc: In function 'int main()':
a.cc:46:3: error: 'll' was not declared in this scope
   46 |   ll cnt[2020];
      |   ^~
a.cc:50:5: error: expected ';' before 'ans'
   50 |   ll ans = 0;
      |     ^~~~
      |     ;
a.cc:51:3: error: 'cnt' was not declared in this scope; did you mean 'int'?
   51 |   cnt[0] = 1;
      |   ^~~
      |   int
a.cc:54:8: error: 'i' was not declared in this scope
   54 |   rrep(i, N - 1, 0) {
      |        ^
a.cc:54:3: error: 'rrep' was not declared in this scope; did you mean 'rep'?
   54 |   rrep(i, N - 1, 0) {
      |   ^~~~
      |   rep
a.cc:62:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   62 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C

#include <bits/stdc++.h>

using namespace std;
#define rep(i, n) for(int i=0;i<n;i++)
#define REP(i, n) for(int i=1;i<=n;i++)
typedef long long ll;

ll mod = 2019;

int main() {
	string s;
	cin >> s;
	ll n = s.size();
	vector<ll> ms(n + 1, 0);
	ll ten = 1;
	reverse(s.begin(), s.end());
	ms[1] = s[0] - '0';
	vector<ll> m(2019, 0);
	REP(i, n) {
		ms[i] = ms[i - 1] + ten * (s[i - 1] - '0');
		ms[i] %= mod;
		ten *= 10;
	}
	rep(i, n + 1) {
		m[ms[i]]++;
	}
	ll ans = 0;
	rep(i, 2019) {
		ans += m[i] * (m[i] - 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;

typedef long long ll;

ll power(ll x, ll y, ll M)
{
    ll res = 1;
    x = x%M;
    while (y)
    {
        if (y&1) res = ((res%M)*(x%M))%M;

        y>>=1;
        x = ((x%M)*(x%M))%M;
    }
    return res;
}

int main(){

    ios::sync_with_stdio(false);
    cin.tie(0);

    string s;
    cin >> s;

    int n = s.length();    

    if(n<=3) cout << 0 << "\n";

    else{
        
        ll count=0;

        unordered_map<ll, ll> umap;

        ll x;
        ll y=0;
        string p;
        for(int i=0; i<n; i++){

            p=s[i];
            int d = stoi(p);
            x = (power(10,n-i-1,2019)*(d))%2019;
            y = ((y%2019)+(x%2019))%2019;
            
            if(umap.find(y%2019)!=umap.end()) count+=umap.at(y%2019);
            umap[y%2019]++;
        }

        cout << count << "\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 <iostream>//cout<<right で右揃え
#include <iomanip>//cout<<setw(数字) で空白による桁揃え
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
#include <cstdlib>//abs()で整数絶対値
#include <cmath>//abs()かfabs()で少数絶対値
#include <functional>//sort第三引数greater<型名>()で降順

using namespace std;
using ll = long long int;

ll mod_pow(ll a,ll index,ll divider){
    ll ret = 1;
    for(;index>0;index/=2,a=a*a%divider){
        if(index%2==1){
            ret = ret * a % divider;
        }
    }
    return ret;
}

int main(){
    ll cnt[2020] = {0};
    string S;cin>>S;
    int a;
    vector<int> num(S.length()+1);
    num[S.length()] = 0;
    for(int j=S.length()-1;j>=0;j--){
        a = S[j] - '0';
        num[j] = num[j+1] + a*mod_pow(10,S.length()-j-1,2019);
        num[j] %= 2019;
        cnt[num[j]]++;
    }
    ll ans = cnt[0] * (cnt[0] + 1) / 2;
    for(int i=1;i<2020;i++){
        ans += cnt[i] * (cnt[i] - 1 ) / 2;
    }
    cout << ans << endl;
    return 0;
}

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

#include <iostream>
#include <vector>
#include <numeric>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string>
#include <unordered_map>
#define myfor(i,N) for(i=0;i<N;i++)
#define myforFL(i,f,l) for(i=f;i<l;i++)

using namespace std;

int main(void){
	string S;
	int i,j;
	long num=0,num2,ans;
	cin >> S;
	long dp2[2019]={};
	myfor(i,S.size()){	
		long dp[2019]= {};	
		myfor(j,2019){
			num2 = (j*10 + long(S[i] - '0'))%2019;
			dp[num2] += dp2[j];
		}	
		num = int(S[i] - '0')%2019;
		dp[num]++;
		ans+=dp[0];
		memcpy(dp2,dp,sizeof(dp));
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:17: error: 'memcpy' was not declared in this scope
   29 |                 memcpy(dp2,dp,sizeof(dp));
      |                 ^~~~~~
a.cc:9:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include <unordered_map>
  +++ |+#include <cstring>
    9 | #define myfor(i,N) for(i=0;i<N;i++)
Language: C

#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <limits>
#include <queue>
#include <iomanip>
#include <set>
//#include <bits/stdc++.h>
template<typename T> bool chmax(T &a,T b){if(a<b){a=b;return true;}return false;}
template<typename T> bool chmin(T &a,T b){if(a>b){a=b;return true;}return false;}
using namespace std;
#define ALL(X) X.begin(),X.end()
using ll = long long int;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vvll> vvvll;
const int MOD=1000000007;
//const int MOD=998244353;
const int INTMAX=2147483647;
const ll LLMAX=9223372036854775807;

ll modadd(ll a,ll b,ll mod=MOD){
    return (a%mod+b%mod)%mod;
}

ll modsub(ll a,ll b,ll mod=MOD){
    a%=mod;
    b%=mod;
    if(a>=b) return a-b;
    else return mod-b+a;
}

ll modmul(ll a,ll b,ll mod=MOD){
    return ((a%mod)*(b%mod))%mod;
}

ll modpow(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;
}

ll moddiv(ll a,ll b,ll mod=MOD) {
    return modmul(a, modpow(b, mod-2));
}



int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    string S;
    cin>>S;
    ll N=S.size();
    
    vll T(N+1);
    T[N]=0;
    ll pow10=1;
    for(ll i=N-1;i>=0;i--){
        T[i]=modadd(modmul(S[i]-'0',pow10,2019),T[i+1],2019);
        pow10=modmul(10,pow10,2019);
        //printf("T[%d]=%d\n",i,T[i]);
    }
    
    vll count(2019);
    for(ll i=0;i<N;i++){
        count[T[i]]++;
    }
    
    ll ans=count[0];
    for(ll i=0;i<2019;i++){
        ans+=count[i]*(count[i]-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>
using namespace std;
typedef long long ll;

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

    int n = s.size();
    vector<int> d(n);
    int ten = 1;
    for(int i=n-1;i>=0;i--){
        int a = (s[i] - '0') * ten % 2019;
        d[i] = (d[i+1] + a) % 2019;
        ten *= 10;
        ten %= 2019;
    }

    vector<int> cnt(2019);
    int ans = 0;
    cnt[0]++;
    for(int i=0;i<n;i++){
        ans += cnt[d[i]];
        cnt[d[i]]++;
    }
    
    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>
using namespace std;
int main(){
string n;
int cnt,data[200][200];
cin >> n;
std::istringstream ss,tt;
//ss = std::istringstream(n.substr(0,1));
//cout << n.substr(1,2);
for (int i = 0;i < n.size();i++){
    for (int j = 1;j <= n.size();j++){
            ss = std::istringstream(n.substr(i,j));
            tt = std::istringstream(n.substr(i,j+1));
            long long num,num2;
            ss >> num;
            tt >> num2;
            data[i][j] = num;
            //cout << num << endl;
            if (num % 2019 == 0 ){
                //cout << num << endl;
                cnt++;
            }
            if(num == num2)            
                break;
        }
    }
    cout << cnt << 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<algorithm>
#include<cmath>
#include<vector>
#include<map>
#define cs ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define rep(i,b)  for(int i=0;i<(int)(b);i++)
#define Rep(i,n) for(int i=1;i<(int)(n);i++)
#define repp(i,a,b)  for(int i=a;i<=(int)(b);i++)
#define Repp(i,a,b)  for(int i=a;i>=(int)(b);i--)
typedef long long ll;
typedef long double ld;

using namespace std;

int main(){
    cs
    string s;int n,p=2019;ll t=0;
    cin>>s;
    n=s.size();
    map<int,int> pam;int tt=0,base=1;
    pam[0]++;
    Repp(i,n-1,0) {
        tt+=(s[i]-'0')*base;
        tt%=p;
        t+=pam[tt];
        pam[tt]++;
        base=(base*10)%p;
    }
    cout<<t;
}

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

#include <bits/stdc++.h>
using namespace std;
using int64 = long long;
#define int int64
#define rep(i, n) for(int i=0; i<n; i++)
#define FOR(i, a, b) for(int i=a; i<b; i++)
#define SORT(x) sort(x.begin(), x.end())
#define GSORT(x) sort(x.begin(), x.end(), greater<int>())
#define mk make_pair
#define fi first
#define se second
#define pb push_back
#define ALL(x) x.begin(), x.end()
#define V(T) vector<T>
typedef pair<int, int> P;
typedef pair<P, P> PP;
typedef vector<int> vi;
typedef vector<vi> vvi;
int max(int a, int b) {if(b>a) return b; else return a;}
int min(int a, int b) {if(b<a) return b; else return a;}


signed main() {
    string S;
    cin >> S;
    int l = S.size();

    reverse(ALL(S));
    map<int, int> mp;
    mp[0]++;
    vi dp(l+1, 0);
    int t = 1;
    rep(i, l) {
        dp[i+1] = (dp[i]+int(S[i]-'0')*t)%2019;
        mp[dp[i+1]]++;
        t = (t*10)%2019;
    }


    int res = 0;
    for(auto &p : mp) {
        //cout << p.fi << " " << p.se  << endl;
        res += p.se*(p.se-1)/2;
    }

    cout << res << 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;

using ll = long long;
const int SIZE=2e5;

int ary[SIZE];

const int MOD=2019;
int main(){
    string s; cin>>s;
    for(int i=0;i<s.size();i++){
        ary[i] = s[i]-'0';
    }
    ll res = 0;
    int n = s.size();
    for(int i=0;i<SIZE;i++){
        int sum = 0;
        for(int j=i;j<SIZE;j++){
            sum *= 10;
            sum += ary[j];
            sum %= MOD;
            res += ll(sum==0);
        }
    }
    res -= ll(SIZE-n)*(SIZE-n+1)/2;
    int tmp =1;
    int sum = 0;
    for(int i=n-1;i>=0;i--){
        sum += ary[i]*tmp;
        tmp*=10;
        tmp%=MOD;
        sum%=MOD;
        if(sum==0) res-=SIZE-n;
    }
    cout<<res<<endl;
    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 ll long long
#define lvector vector<ll> 
#define lque queue<ll>
#define lpque priority_queue<ll>
#define dlpque priority_queue<ll,lvector,greater<ll>>
#define P pair<ll,ll>
#define ALL(a) (a).begin(),(a).end()
#define rep(i,n) for(ll (i)=0; (i)<(n); ++(i))
#define print(a) cout << (a) << endl

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;cin>>s;
  ll n=s.length(),ans=0,mod=2019,digit=1,val=0;
  lvector mods(2019,0);
  for(ll pos=n-1;pos>-1;pos--) {
    val=(val+(s[pos]-'0')*digit)%mod;
    digit=(digit*10)%mod;
    mods[val]++;
  }
  ans+=mods[0];
  for(ll i:mods) ans+=i*(i-1)/2;
  print(ans);
  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 int long long
#define pb push_back
#define ff first
#define ss second
#define all(a) a.begin(), a.end()

const int mod = 1e9+7;
const int inf = 2e18;

int modularExponentiation(int base,int exponent,int modulo)
{
	if(exponent==0)
		return 1;
	
	
	if(!(exponent&1))
	{	
		int res = modularExponentiation(base,exponent/2,modulo);
		return (res*res)%modulo;
	}
	else
	return ((base%modulo)*modularExponentiation(base,exponent-1,modulo))%modulo;
}


int32_t main()
{	
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	string s;
	cin>>s;

	int n = s.size();

	int mp[2029]={0};	


	int k = 0;
	int pre[n+1]={0};

	int m = 2019;
	//pre[0]=1;
	for(int i=n-1;i>=0;i--)
	{
		int curr_digit = s[i]-'0';
		int curr_pow = modularExponentiation(10,k,m);

		int t1 = ((curr_pow%m)*(curr_digit%m))%m;
		int t2 = ((i+1)<n)?pre[i+1]:0;

		pre[i] = (t1%m+t2%m)%m;
		k++;
	}
	mp[0]++;
	for(int i=0;i<n;i++)
	{
		mp[pre[i]]++;
		//cout<<pre[i]<<" ";
	}

	int ans = 0;

	for(int i=0;i<2019;i++)
	{
		int val = mp[i];
		ans+=(val*(val-1))/2;
	
	}
	cout<<ans<<'\n';
	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() {
  int n, a, b, c, d, i;
  cin >> n;
  a = 0;
  
  b = 1000;
  d = 10000;
  i = 4;
  while(n > b) {
    b *=10;
    if(n < b) {
      for (int j = 0; j < i - 3; j++) { //切り取る桁の場合分け
        c = n;
        for (int k = 0; k < i - 3 - j; k++) { //切り取る場所の場合分け n桁ならd=10^n+1
          if (c%d%2019 == 0)
            a++;
          c /= 10;
        }
        d *=10;
      }
    }
    i++;
  }

  cout << a << 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"
using namespace std;
int main(){
	char arr[200001];
	cin >> arr;

	long long int len = strlen(arr), nums[2020] = {1}, ans = 0;;
	int mods[len], dp[200005] = {0};

	mods[len - 1] = 1, mods[len - 2] = 10;

	for(int i = len - 3; i >= 0; i--){
		mods[i] = (mods[i + 1] * 10) % 2019;
	}

	for(int i = len - 1; i >= 0; i--){
		dp[i] = (dp[i + 1] + ((arr[i] - '0') * mods[i])) % 2019;
		nums[dp[i]]++;
	}

	for(int i = 0; i < 2020; i++){
		ans += (nums[i] * (nums[i] - 1)) / 2;
	}

	cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:29: error: 'strlen' was not declared in this scope
    7 |         long long int len = strlen(arr), nums[2020] = {1}, ans = 0;;
      |                             ^~~~~~
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;
a.cc:18:17: error: 'nums' was not declared in this scope
   18 |                 nums[dp[i]]++;
      |                 ^~~~
a.cc:22:25: error: 'nums' was not declared in this scope
   22 |                 ans += (nums[i] * (nums[i] - 1)) / 2;
      |                         ^~~~
Language: C++

#include "iostream"
using namespace std;
int main(){
	char arr[200001];
	cin >> arr;

	long long int len = strlen(arr), nums[2020] = {1}, ans = 0;;
	int mods[len], dp[200005] = {0};;

	mods[len - 1] = 1, mods[len - 2] = 10;

	for(int i = len - 3; i >= 0; i--){
		mods[i] = (mods[i + 1] * 10) % 2019;
	}

	for(int i = len - 1; i >= 0; i--){
		dp[i] = (dp[i + 1] + ((arr[i] - '0') * mods[i])) % 2019;
		nums[dp[i]]++;
	}

	for(int i = 0; i < 2020; i++){
		ans += (nums[i] * (nums[i] - 1)) / 2;
	}

	cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:29: error: 'strlen' was not declared in this scope
    7 |         long long int len = strlen(arr), nums[2020] = {1}, ans = 0;;
      |                             ^~~~~~
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;
a.cc:18:17: error: 'nums' was not declared in this scope
   18 |                 nums[dp[i]]++;
      |                 ^~~~
a.cc:22:25: error: 'nums' was not declared in this scope
   22 |                 ans += (nums[i] * (nums[i] - 1)) / 2;
      |                         ^~~~
Language: C

#include <bits/stdc++.h>

using namespace std;

long long ans,p,cur,t,cnt[200010];
string s;

int main()
{
    cin >> s;
    p = 2019;
    cnt[0] = 1,t = 1;
    for(int i = s.size() - 1;i >= 0;i--)
    {
        cur = (cur + t*(s[i] - '0')%p) % p;
        t = t*10 % p;
        ans += cnt[cur]++;
    }
    
    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;
using ll = long long;
#define rep(i,n) for(ll i=0;i<n;i++)


int main(){
	string s;
	cin >> s;
	int s_size = s.size();
	ll count = 0;
	ll test = 0;
	if(s_size-3>0){
 	 rep(i,s_size-3){
			rep(j,s_size-i-3){
			test = stoll(s.substr(i,j+4));
			if(test != 0 && test % 2019 == 0){count++;}
	}
	}
	}
	cout << count << 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;
typedef long long int ll;
typedef pair <ll,ll> P;
#define REP(i, n) for(ll i = 0LL; i < (ll)(n); i++)
#define REPR(i, n) for(ll i = n-1; i >= 0LL; i--)
#define FOR(i, n, m) for(ll i = n; i < (ll)(m); i++)
#define PRINT(x) cout << x << endl
#define ALL(v) v.begin(), v.end()
#define INF (ll)1e18
#define INFD 1e18
#define PI 3.14159265358979
// #define MOD 1000000007
#define MOD 2019
#define vl vector<ll>

ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }


template<int mod>
struct ModInt{
	int x;
	ModInt():x(0){}
	ModInt(long long y):x(y>=0?y%mod:(mod-(-y)%mod)%mod){}
	ModInt &operator+=(const ModInt &p){
		if((x+=p.x)>=mod)x-=mod;
		return *this;
	}
	ModInt &operator-=(const ModInt &p){
		if((x+=mod-p.x)>=mod)x-=mod;
		return *this;
	}
	ModInt &operator*=(const ModInt &p){
		x=(int)(1LL*x*p.x%mod);
		return *this;
	}
	ModInt &operator/=(const ModInt &p){
		*this*=p.inverse();
		return *this;
	}
	ModInt &operator^=(long long p){
		ModInt res = 1;
		for (; p; p >>= 1) {
			if (p & 1) res *= *this;
			*this *= *this;
		}
		return *this = res;
	}
	ModInt operator-()const{return ModInt(-x);}
	ModInt operator+(const ModInt &p)const{return ModInt(*this)+=p;}
	ModInt operator-(const ModInt &p)const{return ModInt(*this)-=p;}
	ModInt operator*(const ModInt &p)const{return ModInt(*this)*=p;}
	ModInt operator/(const ModInt &p)const{return ModInt(*this)/=p;}
	ModInt operator^(long long p)const{return ModInt(*this)^=p;}
	bool operator==(const ModInt &p)const{return x==p.x;}
	bool operator!=(const ModInt &p)const{return x!=p.x;}
	explicit operator int() const { return x; }						   // added by QCFium
	ModInt operator=(const int p) {x = p; return ModInt(*this);} // added by QCFium
	ModInt inverse()const{
		int a=x,b=mod,u=1,v=0,t;
		while(b>0){
			t=a/b;
			a-=t*b;
			std::swap(a,b);
			u-=t*v;
			std::swap(u,v);
		}
		return ModInt(u);
	}
	friend std::ostream &operator<<(std::ostream &os,const ModInt<mod> &p){
		return os<<p.x;
	}
	friend std::istream &operator>>(std::istream &is,ModInt<mod> &a){
		long long x;
		is>>x;
		a=ModInt<mod>(x);
		return (is);
	}
};
typedef ModInt<MOD> mint;

int main()
{
	string S;
	cin >> S;
	map<ll, ll> m;
	ll ans = 0;
	// REP(i, S.size()) {
	// 	ll tmp = stoll(S.substr(i, S.size()-i));
	// 	PRINT(tmp);
	// 	m[tmp % 2019]++;
	// }

	mint t = 0;
	REPR(i, S.length()) {
		mint a = S[i] - '0';
		t = t + a * ((mint)10^(S.length()-1 - i));
		// PRINT(t);
		// PRINT(i);
		m[t.x]++;
	}
	for(P p : m) {
		// PRINT(p.first << " : " << p.second);
		ans += (p.second *(p.second-1)) / 2;
	}
	ans += m[0];
	PRINT(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

// #define STOPIT
#include<bits/stdc++.h>
#define rep(i,n,m) for(int i = (n); i <(m); i++)
#define rrep(i,n,m) for(int i = (n) - 1; i >=(m); i--)
using namespace std;
using ll = long long;

void debug_impl() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_impl(Head head, Tail... tail) { cerr << " " << head; debug_impl(tail...); }
#ifndef STOPIT
    #define debug(...)\
    do {\
        cerr << boolalpha << "[" << #__VA_ARGS__ << "]:";\
        debug_impl(__VA_ARGS__);\
        cerr << std::noboolalpha;\
    } while (false)
#else
    #define debug(...) {}
#endif

template < typename Container, typename Value = typename Container::value_type, enable_if_t<!is_same< Container, string >::value, nullptr_t> = nullptr>
istream& operator>> (istream& is, Container& v)
  { for (auto & x : v) { is >> x; } return is; }

template < typename Container, typename Value = typename Container::value_type, enable_if_t<!is_same< Container, string >::value, nullptr_t> = nullptr >
ostream& operator<< (ostream& os, Container const& v) {
  os << "{";
  for (auto it = v.begin(); it != v.end(); it++)
    {os << (it != v.begin() ? "," : "") << *it;}
  return os << "}";
}

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

    unordered_map<int, int> remainders;
    ll rem = 0;
    int cnt = 0;
    ll base = 1;
    remainders[0] = 1;
    rrep(i, S.size(), 0)
    {
        rem += base*(ll)(S[i]-'0');
        rem %= 2019;
        base *= 10;
        base %= 2019;
        // cout << rem << endl;

        cnt += remainders[rem];
        ++remainders[rem];
    }
    cout << cnt << endl;
    return 0;
}


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

import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

public class D_164 {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			String S = scan.next();
			
			String[] T = new String[S.length()+1];
			long []amari = new long[S.length()+1];
			Map<Long,Integer>map = new TreeMap<Long,Integer>();
			T[S.length()] = "0";
			amari[S.length()] = 0;
			map.put(amari[S.length()], 1);
			COMinit();

			for(int i = 0;i<S.length();i++) {
				//T[i] = S.substring(i, S.length());
				amari[i] = Long.valueOf(T[i])%2019;
				if(!map.containsKey(amari[i])) {
					map.put(amari[i], 1);
				}else {
					map.put(amari[i], map.get(amari[i])+1);
				}
			}
			
			long goukei = 0;
			
			for(Long Key:map.keySet()) {
				//System.out.print(Key);
				//System.out.print(" ");
				//System.out.println(map.get(Key));
				if(map.get(Key)>=2)goukei+=COM(map.get(Key),2);
			}
			//System.out.println();
			System.out.println(goukei);
			
			
			
			
			
			
			
			
			
		}
		
		
	}
	
	//拡張ユークリッドでの逆元の求め方でnCkをつくる、前処理必須。
	
	static  int MAX = 510000;
	static  int MOD = 1000000007;

	 static long[] fac = new long[MAX]; 
	 static long[] finv = new long[MAX]; 
	 static long[] inv = new long[MAX]; 

	// テーブルを作る前処理
	static void COMinit() {
	    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;
	    }
	}

	// 二項係数計算
	static long COM(int n, int k){
	    if (n < k) return 0;
	    if (n < 0 || k < 0) return 0;
	    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
	}
		

}


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

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

int main() {
 cin.tie(0);
 ios::sync_with_stdio(false);
 string n,s;
 int l;
 long long c,ans;
 ans = 0;
 cin>>n;
 c = 0;
 l = n.length();
 vector<int> vec(l);
 for(int m=0; m < l;m++){
     s = n.substr(l-m-1);
     vec[m] = stoll(s)%2019;   
 }
 sort(vec.begin(),vec.end());
 if (vec[0] == 0){
     ans = ans + 1;
     c++;
 for(int i = 1;i<l;i++){
     if (vec[i] == 0){
         ans = ans + c + 1;
         c++;
     }
     else if(vec[i] == vec[i-1]){
         ans = ans + c;
         c++;
     }
     else{
         c = 1;
     }
 }
 cout<<ans;
}

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

#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <cassert>
#include <fstream>
#include <iomanip>

using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;

const ll mod = 1e9 + 7;

vector<string> g;


int main() {
    
    
    string s;
    cin >> s;
    
    vector<vector<ll>> dp(s.size(), vector<ll>(2019));
    
    ll ret = 0;
    for (int i = 0; i < s.size(); ++i)
    {
        ll num = s[i] - '0';
        if (i == 0)
        {
            dp[0][num] = 1;
            continue;
        }
        dp[i][num]++;
        for (int j = 0; j < 2019; ++j)
        {
            dp[i][(j * 10 + num) % 2019] += dp[i - 1][j];
        }
        ret += dp[i][0];
    }

    cout << ret << 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>
#define rep(i,a,b) for(int i=int(a);i<=int(b);++i)
using namespace std;
template<class A>void pr(A a){cout << (a) << endl;}
template<class A,class B>void pr(A a,B b){cout << a << " "  ;pr(b);}
template<class A,class B,class C>void pr(A a,B b,C c){cout << a << " " ;pr(b,c);}
template<class A,class B,class C,class D>void pr(A a,B b,C c,D d){cout << a << " " ;pr(b,c,d);}
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
int INF=numeric_limits<int>::max();
// for(int j=0;j<N;++j) {
int to_int(char c) {
  return c - '0';
}

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

int main(void) {
  string S;cin>>S;
  int n = S.length();
  int T[n+10];
  vector<int> M(2018,0);

  T[n] = 0;
  M[T[n]]++;

  for(int i=n-1;i>=0;i--) {
    // pr(to_int(S[n-i-1]));
    T[i] = (T[i+1] + to_int(S[i])*modpow(10,n-i-1,2019)) % 2019;
    M[T[i]]++;
  }

  ll ans=0;

  for(auto m:M) {
    ans+=m*(m-1)/2;
  }

  pr(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>
using namespace std;

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
const int INF_N = 1e+9;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

//繰り返し二乗法
ll mod_pow(ll a, ll n, ll m) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%m;
		a = a * a%m; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

//逆元(Eucledean algorithm)
ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 18;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
using mP = pair<modint, modint>;

int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };




void solve() {
    string s; cin >> s;
    reverse(all(s));
    vec cnt(2019, 0);

    ll sum=0;
    ll b = 1;
    cnt[0]++;
    rep(i, s.size()){
        ll tmp = s[i]-'0';
        sum += tmp * b;
        sum %= 2019;
        cnt[sum]++;

        b *= 10;
        b %= 2019;
    }

    ll res = 0;
    rep(i, 2019){
        res += (ll)cnt[i]*(cnt[i]-1)/2;
    }

    cout << res << endl;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  //cout << fixed << setprecision(10);
  //init_f();
  //init();
  //int t; cin >> t; rep(i, t)solve();
  solve();
//   stop
    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 <algorithm>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define ll long long
#define INF 1000000000000000000

int main() {
    string s;
    cin >> s;
    int N = s.size();
    reverse(all(s));
    map<ll, ll> ma;
    ll MOD = 2019;
    vector<ll> sum(N + 1, 0);
    string str = "";
    rep(i, N) {
        str = s[i] + str;
        sum[i + 1] = stol(str);
    }

    rep(i, N + 1) {
        sum[i] %= MOD;
        ma[sum[i]]++;
    }

    ll res = 0;
    for (auto p : ma) {
        res += p.second * (p.second - 1) / 2;
    }

    cout << res << endl;
}

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

//codeforces
//
#include "bits/stdc++.h"
using namespace std;
using int64 = long long;
int main()
{
  string s;
  cin>>s;
  if(s.size()<=4)
    cout<<0;
  else{
    int n=s.size();
    //int64 rs=0;
    int t=0;
    for(int i=0; i<n; i++){
      int r=0;
      for(int j=i; j<n; j++){
        r = r*10 + s[j] - '0';
        if(r%2019==0)
          t++;
        r %= 2019;
      } 
    }
    cout<<t<<endl;
  }
	return 0;
}


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

from collections import Counter

s = input()
a = [0]
mod = 2019

for i,j in enumerate(s[::-1]):
    a.append(a[-1] + int(j)*pow(10,i,mod))
    a[-1] %= mod
b = Counter(a)

ans = 0
for i in b.values():
    ans += i*(i-1)//2
print(ans)

Compiler output:
main.c:1:1: error: unknown type name 'from'
    1 | from collections import Counter
      | ^~~~
main.c:1:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'import'
    1 | from collections import Counter
      |                  ^~~~~~
main.c:1:18: error: unknown type name 'import'
Language: C

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

long long N;
string S;

long long solve()
{
    vector<long long> val(2019, 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) % 2019;
        tenfactor = (tenfactor * 10) % 2019;
        val[cur]++;
    }
    long long res = 0;
    for (int p = 0; p < 2019; ++p)
        res += val[p] * (val[p] - 1) / 2;
    return res;
}

int main()
{
    cin >> S;
    N = S.size();
    cout << solve() << 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>
#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,start,end) for(int i=start;i<=end;i++)
const int INF = 1001001001;
typedef long long ll;
const ll MOD=1000000007;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); }
template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); }
template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); }
template<class T, class U>U COUNT(const T& a, const U& v) { return count(a.begin(),a.end(), v); }
template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); }
template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); }
int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; }

int main(void){
    // Your code here!
    string s;cin >> s ;
    ll now = 0,ans = 0,ten =1;
    vector<int> rem(2019,0);
    rep(i,s.size()){
        now += ten*(s[s.size()-1-i]-'0');
        now %=2019;
        rem[now]++;
        ten*=10;
        ten%=2019;
    }
    FOR(i,1,2018){
        ans+=rem[i]*(rem[i]-1)/2;
    }
    ans+=rem[0];
    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

//yukicoder@cpp14
//author:luckYrat(twitter:@luckYrat_)
//競技プログラミングから逃げるな
//https://www.youtube.com/watch?v=z_B9iJ8r4ic

//せんげん！
#include <iostream>

#include <cmath>
#include <algorithm>
#include <iomanip>

#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <bitset>

#include <cctype>
#include <utility>
#include <climits>


//なまえくーかん！
using namespace std;
using ll = long long;
using P = pair<ll,ll>;

//てーすう！
const int mod = 1000000007;
const int inf = (1<<30)-1;
const ll linf = (1LL<<62LL)-1;
const double EPS = (1e-10);

//でふぁいん！
#define anyfill(n,s) setw(n) << setfill(s)
#define loop(s) for(int i = 0; s > i; i++)
#define rep(i,q) for(int i = 0; (q) > i; i++)
#define repp(i,n,q) for(int i = n; (q) > i; i++)
#define dep(i,q) for(int i = (q); 0 < i; i--)

//みじかく！
#define pb push_back
#define fir first
#define scn second
#define ednl endl

//いぇすのー！
#define YesNo(a) (a?"Yes":"No")
#define YESNO(a) (a?"YES":"NO")
#define yesno(a) (a?"yes":"no")

//きんぼーnほーこー！！
P ar4[4] = {{0,1},{0,-1},{1,0},{-1,0}};
P ar8[8] = {{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,-1},{1,0},{1,1}};
/*
確認ポイント
cout << fixed << setprecision(n) << 小数計算//n桁の小数表記になる

計算量は変わらないが楽できるシリーズ
min(max)_element(iter,iter)で一番小さい(大きい)値のポインタが帰ってくる
count(iter,iter,int)でintがiterからiterの間にいくつあったかを取得できる
*/
int dp[2][2020];
__attribute__((constructor))
void initial() {
 cin.tie(0);
 ios::sync_with_stdio(false);
}
int main(){
  string s;cin>>s;
  int ans = 0;
  for(int i = 0; s.size() > i; i++){
    dp[0][0] += 1;
    for(int j = 0; 2020 > j; j++){
      dp[1][(j*10+s[i]-'0')%2019] += dp[0][j];
    }
    ans += dp[0][0];
    for(int j = 0; 2020 > j; j++){
      dp[0][j] = dp[1][j];
      dp[1][j] = 0;
    }
  }
  ans += dp[0][0];
  cout << ans-s.size() << endl;

}


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

//#define LOCAL_DEFINE
#include <bits/stdc++.h>
using namespace std;
#define rep(i,r) for(int i = 0; i < (r); i++)
#define pb push_back
#define ALL(a) a.begin(), a.end()
#define fastio ios::sync_with_stdio(0);cin.tie(0)
using ll = long long;
using ull = unsigned long long;

const int maxn = 2e6 + 10;
int pre[maxn];

int main() {
  fastio;
  string s;
  cin >> s;
  reverse(ALL(s));
  vector<int> mp(2019, 0); // residue -> cnt
  mp[0] = 1;
  int base = 1;
  int sum = 0;
  rep(i, s.size()) {
    sum = sum + (s[i] - '0') * base;
    sum %= 2019;

    mp[sum]++;

    base *= 10;
    base %= 2019;
  }

  ull ans = 0;
  for (auto p : mp) {
    int cnt = p.second;
    ans += (cnt*(cnt-1))/2;
  }
  cout << ans << '\n';

  
  #ifdef LOCAL_DEFINE
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
  #endif
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:17: error: request for member 'second' in 'p', which is of non-class type 'int'
   35 |     int cnt = p.second;
      |                 ^~~~~~
Language: C++

#include <math.h>
#include <cmath>
using namespace std;
using ll = long long;
using ull = unsigned long long;




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

  vector<int> mop10(s.size());
  mop10[0] = 1;
  for(int i = 1; i < 2019; i++){
    mop10[i] = mop10[i-1] * 10 % 2019;
  }

  reverse(s.begin(), s.end());

  vector<int> sum(s.size());
  vector<int> cnt(2019, 0);

  sum[0] = (int)(s[0] - '0');
  cnt[sum[0]]++;
   ll ans = 0LL;
  
 
  for(int i = 1; i < s.size(); i++){
    sum[i] = sum[i-1] + mop10[i] * (int)(s[i] - '0');
    sum[i] %= 2019;
    if(sum[i] == 0){ans++;}
    cnt[sum[i]]++;
  }
  
  for(int i = 0; i < 2019; i++){
    ll num = cnt[i] * (cnt[i] - 1) / 2;
    ans += num;
  }
  
  cout << ans << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'string' was not declared in this scope
   11 |   string s;
      |   ^~~~~~
a.cc:3:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    2 | #include <cmath>
  +++ |+#include <string>
    3 | using namespace std;
a.cc:12:3: error: 'cin' was not declared in this scope
   12 |   cin >> s;
      |   ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <cmath>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:12:10: error: 's' was not declared in this scope
   12 |   cin >> s;
      |          ^
a.cc:14:3: error: 'vector' was not declared in this scope
   14 |   vector<int> mop10(s.size());
      |   ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <cmath>
  +++ |+#include <vector>
    3 | using namespace std;
a.cc:14:10: error: expected primary-expression before 'int'
   14 |   vector<int> mop10(s.size());
      |          ^~~
a.cc:15:3: error: 'mop10' was not declared in this scope
   15 |   mop10[0] = 1;
      |   ^~~~~
a.cc:20:3: error: 'reverse' was not declared in this scope
   20 |   reverse(s.begin(), s.end());
      |   ^~~~~~~
a.cc:22:10: error: expected primary-expression before 'int'
   22 |   vector<int> sum(s.size());
      |          ^~~
a.cc:23:10: error: expected primary-expression before 'int'
   23 |   vector<int> cnt(2019, 0);
      |          ^~~
a.cc:25:3: error: 'sum' was not declared in this scope
   25 |   sum[0] = (int)(s[0] - '0');
      |   ^~~
a.cc:26:3: error: 'cnt' was not declared in this scope; did you mean 'int'?
   26 |   cnt[sum[0]]++;
      |   ^~~
      |   int
a.cc:42:3: error: 'cout' was not declared in this scope
   42 |   cout << ans << endl;
      |   ^~~~
a.cc:42:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:42:18: error: 'endl' was not declared in this scope
   42 |   cout << ans << endl;
      |                  ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <cmath>
  +++ |+#include <ostream>
    3 | using namespace std;
Language: C

#include<stdio.h>
#include<string.h>
#include<math.h>
#define N_MAX 200001
#define ll long long
#define MOD 2019



int main(){
  int g=1,len;
  ll ans=0;
  char a[N_MAX];
  scanf("%s",a);
  len=strlen(a);
  int T[len+1]={0};
  T[len]=0;
  int counter[MOD]={0};
  counter[0]=1;
  for(int k=len-1;k>=0;k--){
    T[k]=(T[k+1]+g*(a[k]-'0'))%MOD;
    counter[T[k]]++;
          g*=10;
          g%=2019;
  };
  for(int b=0;b<MOD;b++){
    ans+=counter[b]*(counter[b]-1)/2;
  };
  printf("%lld",ans);
};


Compiler output:
main.c: In function 'main':
main.c:16:16: error: variable-sized object may not be initialized except with an empty initializer
   16 |   int T[len+1]={0};
      |                ^
Language: C

#include <bits/stdc++.h>
using namespace std;
struct Fast {
    Fast() {
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(20);
    }
} fast;

void yes() {
    cout << "Yes" << endl;
    exit(0);
}
void no() {
    cout << "No" << endl;
    exit(0);
}
#define REP(i, n) for (long long i = 0; i < (n); i++)

vector<bool> visited(105);
vector<vector<int>> edge(105);
bool dfs(int cur, int par) {
    // if a cycle doesn't exist, return true
    visited[cur] = true;
    bool ic = false;
    if (edge[cur].size() == 0) {
        return true;
    } else {
        for (int i = 0; i < edge[cur].size(); i++) {
            if (edge[cur][i] == par) {
                continue;
            }
            if (visited[edge[cur][i]]) {
                ic = true;
                break;
            } else {
                visited[edge[cur][i]] = true;
            }
            if (!dfs(edge[cur][i], cur)) {
                ic = true;
            }
        }
        if (ic) {
            return false;
        } else {
            return true;
        }
    }
}
int ctoi(char c) {
    if (c >= '0' && c <= '9') {
        return c - '0';
    }
    return 0;
}
long long modpow(long long m, long long n) {
    if (n == 0) return 1;
    if (n % 2 == 0) {
        long long t = modpow(m, n / 2);
        return t * t % 2019;
    } else {
        return modpow(m, n - 1) * m % 2019;
    }
}
int main() {
    string s;
    cin >> s;
    map<long long int, int> cnt;
    long long int acc = 0, ans = 0;
    reverse(s.begin(), s.end());
    cnt[0]++;
    REP(i, s.size()) {
        acc += (ctoi(s[i]) * modpow(10, i)) % 2019;
        acc %= 2019;
        ans += cnt[acc];
        cnt[acc]++;
    }
    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.