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

#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <math.h>
#include <numeric>
#include <iomanip>
#include <map>
#include <queue>
#include <list>


#define REP(i, n ,N) for(ll i = (n); i < (N); i++)
//#define RREP(i, n ,N) for(ll i = (N-1); i >= (n); i--)
#define p(s) cout<<(s)<<endl
#define p2(a, b) cout<<(a)<<" "<<(b)<<endl
#define INF 1e9
#define vint vector<int>

using namespace std;
typedef long long  ll;

//const long long M = 1e9+7;
int ctoi(const char c){
    switch(c){
        case '0': return 0;
        case '1': return 1;
        case '2': return 2;
        case '3': return 3;
        case '4': return 4;
        case '5': return 5;
        case '6': return 6;
        case '7': return 7;
        case '8': return 8;
        case '9': return 9;
        default : return -1;
    }
}

int main()
{
    string s;
    cin >> s;
    ll n = 0;
    vint count;
    count.push_back(0);
    char c;
    REP(i, 0, s.size()){
        //        n = stoll(s.substr(s.size() - i, i));
        c = s[s.size() - i - 1];
        n += ctoi(c) * pow(10, i);
//        p(n);
//        p2(s.substr(s.size() - i, i), n%2019);
        count.push_back(n%2019);
    }

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

    ll ans = 0;
    ll tmp = 1;
    REP(i, 0, count.size()-1){
        if(count[i] == count[i+1]){
            tmp++;
        } else {
            ans += (tmp*(tmp-1))/2;
            tmp = 1;
        }
    }

    if(tmp!=1){
        ans += (tmp*(tmp-1))/2;
    }

    p(ans);
}

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 fastio     ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define debug(x)   cerr<<#x<<": "<<x<<endl;
#define all(x)     (x).begin() , (x).end()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define endl       '\n'
#define MAX        1000000
typedef long long int ll;
using namespace std;


const ll mod = 1e9+7;
const double eps = 1e-9;


string s;
int dp[2019];

void solve(){
    cin>>s;
    int n=(int)s.size();
    ll ans=0;
    for(int i=0;i<n;i++) {
        int tdp[2019];
        memset(tdp,0,sizeof(tdp));
        int d=(s[i]-'0');
        tdp[d%2019]=1;
        for(int j=0;j<2019;j++) {
            if(dp[j]>0) { 
                int rem=(10*j+d)%2019;
                if(rem==0)ans += dp[j];
                tdp[rem]+=dp[j];
            }
        }
        for(int i=0;i<2019;i++) {
            dp[i]=tdp[i];
        }
    }
    cout<<ans;
}





int main(){
    fastio
    int test=1;
    while(test--)
        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>
#define FOR(i, a, n) for(int (i) = (int)(a); (i) < (int)(n); ++(i))
#define FORe(i, a, n) for(int (i) = (int)(a); (i) <= (int)(n); ++(i))
#define rFOR(i, a, n) for(int (i) = (int)(n)-1; (i) >= (int)(a); --(i))
#define rFORe(i, a, n) for(int (i) = (int)(n); (i) >= (int)(a); --(i))
#define REP(i, n) FOR((i), 0, (n))
#define REPe(i, n) FORe((i), 1, (n))
#define REPo(i, n) FORe((i), 0, (n))
#define rREP(i, n) rFOR((i), 0, (n))
#define rREPe(i, n) rFORe((i), 1, (n))
#define rREPo(i, n) rFORe((i), 0, (n))
#define rep(i, n) FOR((i), 0, (n))
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define fi first
#define se second
#define dup(x, y) (((x)+(y)-1)/(y))
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
using ll = long long;
using P = pair<int,int>;
using T = tuple<int,int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vs = vector<string>;
using vp = vector<P>;
using vt = vector<T>;

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

const int mod = 2019;

int main() {
  string s;
  cin >> s;
  int n = s.size();
  vi d(n+1);
  int ten = 1;
  rREP(i, n) {
    int a = (s[i]-'0') * ten % mod;
    d[i] = (d[i+1]+a) % mod;
    ten *= 10; ten %= mod;
  }
  vi cnt(mod);
  ll ans = 0;
  rREPo(i, n) {
    ans += cnt[d[i]];
    cnt[d[i]]++;
  }
  cout << ans << endl;

  return 0;
}

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

/* Simplicity and Goodness */

#include <bits/stdc++.h>
using namespace std;
#define scn(n) scanf("%d",&n)
#define lscn(n) scanf("%lld",&n)
#define lpri(n) printf("%lld ",n)
#define pri(n) printf("%d ",(int)n)
#define prin(n) printf("%d\n",(int)n)
#define lprin(n) printf("%lld\n",n)
#define deb(x) cout << #x << ' ' << x << '\n'
#define rep(i,ini,n) for(int i=ini;i<(int)n;i++)
#define per(i,ini) for(int i=ini;i>=0;i--)
#define tc int tt; scn(tt); while(tt --)
#define pb push_back
#define mp make_pair
#define F first
#define S second
using ll = long long;
const int inf = INT_MAX;
const int ninf = INT_MIN;
const int mod = 1e9+7;
const int N = 1e6+2;

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

	int n = s.size();

	vector<int> pwr(n);

	pwr[0] = 1;

	rep(i, 1, n)
	pwr[i] = (pwr[i-1] * 10) % mod;

	vector<int> fa(mod, 0);

	fa[0] = 1;

	ll ans = 0;

	int cur = n-1, sum = 0;

	rep(i, 0, n)
	{
		sum = (sum + pw[cur] * (s[i] - '0')) % mod;

		cur --;

		ans += fa[sum];

		fa[sum] ++;
	}

	lpri(ans); 
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:30: error: 'pw' was not declared in this scope; did you mean 'pwr'?
   49 |                 sum = (sum + pw[cur] * (s[i] - '0')) % mod;
      |                              ^~
      |                              pwr
Language: C++

using namespace std;
int main(){
  string s;
  cin>>s;
  int i,j;
  for(i=0;i<s.size()-3;i++){
    for(j=i+3;j<s.size();j++){
      if(stoi(s.substr(i,j))%2019==0)
        count++;
    }
  }
  cout<<count<<endl;
 
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'string' was not declared in this scope
    3 |   string s;
      |   ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | using namespace std;
a.cc:4:3: error: 'cin' was not declared in this scope
    4 |   cin>>s;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:4:8: error: 's' was not declared in this scope
    4 |   cin>>s;
      |        ^
a.cc:8:10: error: 'stoi' was not declared in this scope
    8 |       if(stoi(s.substr(i,j))%2019==0)
      |          ^~~~
a.cc:8:10: note: 'std::stoi' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
a.cc:9:9: error: 'count' was not declared in this scope
    9 |         count++;
      |         ^~~~~
a.cc:12:3: error: 'cout' was not declared in this scope
   12 |   cout<<count<<endl;
      |   ^~~~
a.cc:12:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:9: error: 'count' was not declared in this scope
   12 |   cout<<count<<endl;
      |         ^~~~~
a.cc:12:16: error: 'endl' was not declared in this scope
   12 |   cout<<count<<endl;
      |                ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C

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

# define REP(i,n) for (int i=0;i<(n);++i)
# define all(v) v.begin(),v.end()
# define showVector(v) REP(i,v.size()){cout << (v[i]) << " ";} cout << endl;
typedef long long int ll;

int main(void) {

  string s;
  cin >> s;

  int md = 2019;

  int now = 0;
  int ten = 1;
  vector<int> mp(2019, 0);
  for(int i = s.size()-1; i >= 0; i--){
    (now += (s[i] - '0') * ten) %= md;
    mp[now]++;
    (ten *= 10) %= md;
  }

  ll ans = mp[0];
  for(auto m : mp) {
    ans += m * (m - 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;

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

using ll = long long;

ll pow(ll x, ll y) {
    if (y == 0LL) return 1LL;
    ll X = 1LL;
    for (ll i = 0LL; i < y; i++) {
      X *= x;
      X %= 2019;
    }
    return X;
}

ll dp[200100];
ll dpp[2100];

int main() {
  string S;
  cin >> S;
  ll l = S.size();
  ll f = S.at(0) - '0';
  dp[l+1] = 0LL;
  dpp[0] = 1LL;
  ll s = 10LL;
  for(ll i = l; i >=1; i--) {
    ll t = S.at(i-1) - '0';
    dp[i] = (dp[i+1] + t*s)%2019LL;
    s *= 10LL;
    s %= 2019LL;
    dpp[dp[i]]++;
  }
  ll ans = 0LL;
  for(ll i = 0; i < 2100; i++) {
    ans += dpp[i] * (dpp[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>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repI(i, d, n) for (int i = (d); i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
using Pl = pair<ll, ll>;
using M = map<int, int>;
ll const INF = 1ll<<61;
double pi = 3.141592653589793238;
int const DEV = 2019;

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

  ll cursor = 0;
  vector<ll> cnt(DEV, 0);
  cnt[cursor]++;

  rep(i, n) {
    cursor += (s[n-1-i] - '0') * pow(10, i);
    //cout << cursor << " " << cursor % DEV <<  endl;
    cnt[cursor % DEV]++;
  }

  ll ans = 0;

  rep(i, DEV) {
    ans += cnt[i] * (cnt[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<iostream>
using namespace std;
long N,P,cnt[200101],T[2<<17],ans,mod,i;

int main()
{
    string s;cin>>s;
    N=s.size();P=2019;
    T[N-1]=1;
    for(int i=N-2;i>=0;i--) T[i]=T[i+1]*10%P;
    cnt[0]=1;
    for(int i=0;i<N;i++)
    {
        mod=(mod+(s[i]-'0')*T[i])%P;
        ans+=cnt[mod]++;
        //cout<<mod<<endl;
    }
    cout<<ans<<endl;
}


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

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <queue>
#include <cstring>
#include <vector>
#include <map>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <bitset>
#include <set>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,k,n) for(int i=(k);i<(int)(n);i++)
#define all(i,n) (i),(i+n)

int dx4[4]={1,0,-1,0};
int dy4[4]={0,-1,0,1};
int dx8[8]={1,0,-1,1,-1,1,0,-1};
int dy8[8]={1,1,1,0,0,-1,-1,-1};
int dx9[9]={0,1,0,-1,1,-1,1,0,-1};
int dy9[9]={0,1,1,1,0,0,-1,-1,-1};

typedef pair<int, int> P;
typedef pair<string, int> SP;
typedef long long ll;
typedef pair<ll, ll> PLL;

const int INF = 1e9;
const ll LLINF = 1e18;
const int MAX_V = 1e6+1;
const ll mod = 1000000007;

// --------------------------------------
string s;
int dp[200005][2019];
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  cin >> s;

  REP(i, s.length()) {
    int s_l = s[i] - '0';
    REP(j, 2019) {
      dp[i + 1][(j * 10 + s_l) % 2019] += dp[i][j];
    }
    dp[i + 1][s_l] += 1;
  }

  int ans = 0;
  FOR(i, 1, s.length() + 1) {
    ans += dp[i][0];
  }

  cout << ans << endl;
}


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

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

int main(){

  string S;
  cin >> S;
  long long len = S.length();

  cout << len << endl;

  long long count = 0;

  vector<long long> mod(2019,0);

  long long nowNum = 0;
  long long digit = 1;
  long long nowMod = nowNum%2019;
  mod[nowMod]++;
  for(long long i=len-1;i>=0;i--){
    nowNum = (nowNum + (S[i]-'0')*digit)%2019;
    digit = (digit*10)%2019;
    mod[nowNum%2019]++;
  }

  for(long long i=0;i<2019;i++){
    if(mod[i] <= 0) continue;
    else{
      count += mod[i]*(mod[i]-1)/2;
    }
  }

  cout << count << 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 <bits/stdc++.h>

using namespace std;

int main() {
    string s;
    cin >> s;
    map <int, int> mp;
    long long ans = 0;
    int pw = 1, pf = 0;
    mp[0] = 1;
    for (int i = (int)s.size() - 1; i >= 0; i--) {
        pf = (pf + pw * (s[i] - '0')) % 2019;
        ans += mp[pf];
        mp[pf]++;
        pw = (pw * 10) % 2019;
    }
    cout << ans << endl;
}


Compiler output:
main.c:1:11: 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;
using Graph = vector<vector<int>>;
#define rep(i,m,n) for(int i=(int)(m);i<(int)(n);++i)
#define rREP(i,m,n) for(int (i)=(n)-1; (i)>=(m);--(i))
#define all(x) (x).begin(),(x).end()
#define out(y,x,h,w) (y)<0||(x)<0||(y)>=(h)||(x)>=(w)
constexpr int INF = 1000000001;
constexpr ll mod = 1000000007;
constexpr double PI = 3.1415926535897932;

template<class T>inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
template<class T>inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}
inline void init() {
	cin.tie(nullptr); cout.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

int main() {
	init();

	string s; cin >> s;
	vector<int>vec(s.size() + 1);
	vec[s.size()] = 0;
	int a = 1;
	rREP(i, 0, s.size()) {
		vec[i] = (((s[i] - '0') * a) + vec[i + 1]) % 2019;
		a *= 10;
		a %= 2019;
	}
	map<int, ll>mp;
	ll ans = 0;
	rep(i, 0, vec.size()) {
		mp[vec[i]]++;
	}
	for (auto p : mp) {
		ans += (p.second * (p.second - 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;

#define ALL(x) x.begin(), x.end()
#define RALL(x) x.rbegin(), x.rend()
#define MP make_pair
#define PB push_back
#define X first
#define Y second

typedef long long int lld;
typedef pair<int, int> pii;
typedef pair<lld, lld> pll;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    string s;
    lld rmd[2019];
    lld tmp[2019];

    cin >> s;

    lld ans = 0;
    for (char &c : s) {
        c -= '0';
        for (int i = 0; i < 2019; i++) {
            
            if ((i * 10 + c) % 2019 == 0) {
                ans += rmd[i];
            }
        }

        for (int i = 0; i < 2019; i++) {
            tmp[(i * 10 + c) % 2019] = rmd[i];
        }

        for (int i = 0; i < 2019; i++) {
            rmd[i] = tmp[i];
        }
        rmd[c]++;

    }

    cout << ans << '\n';

    return 0;
}

// g++ sol.cpp -o sol.out -Wall -Wextra -Wshadow -fsanitize=undefined -std=c++17

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;
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; }
const ll INF = 1LL << 60;
#define mod 2019

vector<ll> cnt(2019);

int main() {
    string S; cin >> S;
    int N = S.length();
    
    cnt[0] = 1;
    ll p = 1;
    ll now = 0;
    for (int i = N - 1; i >= 0; i--) {
        now = (now + (S[i] - '0') * p) % mod;
        cnt[now]++;
        p = (p * 10) % mod;
    }
    
    ll ans = 0;
    for (int i = 0; i < 2019; i++) {
        ll n = cnt[i];
        ans += n * (n - 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 <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <deque>
#include <map>

#define ll long long
#define ld long double
#define COIN const int
#define ite iterator
#define PII pair<int,int>
#define PSI pair<string,int>
#define PIS pair<int,string>

#define REP(i,n) for((i)=0;(i)<(int)(n);(i)++)
#define REPD(i,n) for((i)=(n)-1;(i)>=0;(i)--)

#define ALL(c) (c).begin(), (c).end()
#define LEN(s) (s).size()
#define CLEAR(x) memset(x,0,sizeof x);

#define MP make_pair
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define X first
#define Y second

#define VI vector<int>
#define VS vector<string>
#define VII vector<PII>
#define VVI vector<VI>

#define PIII 3.1415926
#define PI 3.14
/*****************************************************************************/

using namespace std;

int a[200001],p[2020];

int main()
{
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	string s; cin >>s;
	reverse(ALL(s));
	int i,tmp=1,ans=0;
	for (i=0;i<s.size();i++) {
		a[i]=(tmp*(s[i]-'0'))%2019;
		tmp=(tmp*10)%2019;
	}
	tmp=0;
	for (i=0;i<s.size();i++) {
		tmp=(tmp+a[i])%2019;
		p[tmp]++;
	}
	for (i=0;i<2019;i++) {
		ans+=p[i]*(p[i]-1)/2;
	}
	ans+=p[0];
	cout <<ans;
	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, n) for (ll i = 0; i < (ll)(n); i++)
#define ll long long
using namespace std;
  map<int, int> t;

int main() {
  string s;
  cin >> s;
  int n = s.size();
  vector<int> a(n);
  rep (i, n) a[i] = s[i] - '0';
  vector<ll> num(n);
  for (int i = 1; i < n + 1; i++) {
    if (i == 1) {
      num[n - 1] = a[n - 1];
      // cout << num[n - 1] << endl;
    }
    else {
      num[n - i] = num[n - i + 1] + pow(10, i - 1) * a[n - i];
      // cout << num[n - i] << endl;
    }
  }

  t[0] = 1;

  rep(i, n) {
    int a = num[i] % 2019;
    t[a]++;
  }

  int count = 0;

  for (auto p : t) {
    if (p.second > 0) {
      count += p.second * (p.second - 1) / 2;
    }
  }
  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

#include<bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define repk(i,k,n) for (ll i = k; i < (ll)(n); ++i)
#define MAX 500000001000000000
#define MOD 1000000007
typedef long long  ll;

using namespace std;

ll ans;
map<int, int> t;

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

	string s;
	cin >> s;

	int n = s.size();

	vector<int> num(n);
	rep(i,n) {
		num[i] = s[i] - '0';
	}
	
	vector<ll> snum(n);
	snum[n-1] = num[n-1];
	repk(i, 1, n) {
		snum[n-i-1] = snum[n-i] + num[(n-1)-i] * pow(10, i);
	}

	t[0]++;
	rep(i, n) {
		t[(snum[i] % 2019)]++;
	}

	for (auto p : t) {
		ans += p.second * (p.second - 1) / 2;
	}

	cout << ans << 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 <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <climits>
#include <cstdlib>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define DEBUG 1
using namespace std;
constexpr int kMod = 1000000007;
typedef long long LL;


int main() {
  string S; cin >> S;
  int L = S.size();
  vector<vector<LL>> dp(L+1, vector<LL>(2020, 0));
  int cnt = 0;
  for (int i = 0; i < 2020; ++i) dp[0][0] = 0;

  for (int i = 1; i <= L; ++i) {
    int x = S[i-1]-'0';
    for (int j = 0; j < 2020; ++j) {
      int y = (j*10+x) % 2019;
      dp[i][y] += dp[i-1][j];
    }
    ++dp[i][x];
    cnt += dp[i][0];
  }
  cout << cnt << endl;
}


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

#include<bits/stdc++.h>
using namespace std;
int main()
{
string s;cin>>s;
  int n=s.size();
  map<int,int>f;
  int mod=0,cur=1;
  for(int i=n-1;i>=0;i++)
  {
    mod=(mod+cur*(s[i]-'0'))%2019;
    cur*=10;
    ans+=f[mod];f[mod]++;
  }cout<<ans;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |     ans+=f[mod];f[mod]++;
      |     ^~~
      |     abs
a.cc:14:10: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |   }cout<<ans;
      |          ^~~
      |          abs
Language: C

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

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

    /*
    for(int i = 0; i < 2019; ++i) {
        if(v[i] > 0) cout << "i:" << i << "v[i]:" << v[i] << endl;
    }
    */

    long long sum = 0;
    for(int i = 0; i < 2019; ++i) {
        sum += (v[i]*v[i]-1)/2;
    }
    cout << sum << endl;
    return 0;
}

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

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

using namespace std;
using namespace __gnu_pbds;

typedef long long int ll;
typedef tree< ll, null_type, less< ll >, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

const ll mod = 1e9 + 7;

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

  string s;
  cin >> s;
  ll n = s.length();
  vector < vector < ll > > dp(n, vector < ll > (2019, 0));
  vector < ll > dp1(2019, 0), dp2(2019, 0);
  dp1[s[0] - '0'] = 1;
  ll ans = 0;
  for(int i = 1; i < n; i++){
    ll num = s[i] - '0';
    dp2[num] = 1;
    for(int j = 0; j < 2019; j++){
      dp2[(10 * j + num) % 2019] += dp1[j];
    }
    ans += dp2[0];
    dp1 = dp2;
    dp2.assign(2019, 0);
  }

  cout << ans << '\n';
}


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

#include <bits/stdc++.h>

using namespace std;

int main()
{
  string s;
  cin >> s;
  int n = s.length();
  int dp[n][2019];
  memset(dp, false, sizeof(dp));
  dp[n-1][s[n-1]-'0'] = 1;
  int curr = 10;
  for(int i=n-2;i>=0;i--)
  {
    int z = ((s[i]-'0')*curr)%2019;
    for(int j=0;j<2019;j++)
    {
      if(dp[i+1][j])
      {
        int y = (z+j)%2019;
        dp[i][y] += dp[i+1][j];
      }
    }
    dp[i][z] += 1;
    curr = (curr*10)%2019;
  }
  int ans = 0;
  for(int i=0;i<n;i++)
    ans += dp[i][0];
  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(){

  string S;
  cin >> S;
  long long len = S.length();

  long long count = 0;
  int mod[2019];
  menset(mod,0,sizeof(mod));

  long long nowNum = 0;
  long long degit = 1;
  long long nowMod = nowNum%2019;
  mod[nowMod]++;

  for(long long i=len-1;i>=0;i--){
    nowNum = nowNum + (S[i]-'0')*degit;
    degit *= 10;
    mod[nowNum%2019]++;
  }

  for(long long i=0;i<2019;i++){
    if(mod[i] <= 0) continue;
    else{
      count += mod[i]*(mod[i]-1)/2;
    }
  }

  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'menset' was not declared in this scope; did you mean 'memset'?
   12 |   menset(mod,0,sizeof(mod));
      |   ^~~~~~
      |   memset
Language: C

#include<bits/stdc++.h>
#define ll  long long
#define pb push_back
#define pii pair<int,int>
#define vi vector<ll>

#define sz(x) ((int) (x).size())
#define pll pair<long long,long long>
#define mp make_pair
#define F first
#define S second
#define T int tt; cin>>tt; while(tt--)
#define fastio ios_base::sync_with_stdio(false);
 
#define endl '\n'
#define all(a) (a).begin(), (a).end()
#define display(x) for(auto i : x) cout << i << " "; cout << '\n';
#define input(x) for(int i = 0; i < n; i++) cin >> x[i];
#define make(x,y) fill(all(x), y)
#define FO(i,startLoop,n) for (int i = startLoop; i < n; i++)

#define mod 1000000007
#define Y cout<<"YES"<<endl;
#define N cout<<"NO"<<endl;
#define ITFO(myiterator, mymap) for(auto myiterator = mymap.begin(); myiterator!=mymap.end(); ++myiterator)
using namespace std;  
 

int main()
{
    fastio
    cin.tie(NULL); cout.tie(0);
    
    
  
  string s; cin>>s; ll res = 0;
  ll n = s.size();
  for(int i=0; i<n-1; ++i)
  {
    ll val = s[i] - '0';
    for(int j = i+1; j<n; ++j)
    {
        ll num = val*10 + s[j] - '0'; val = num  % 2019;
        if(!val) res++;
    } 
  }
  cout<<res<<endl;
  cerr << "\nTime elapsed: "<< 1000 * clock() / CLOCKS_PER_SEC << "ms\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;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

string S;
int N;
int rn[2019];

int main(){
	cin>>S; N = S.size();
	memset(rn, 0, sizeof(rn));
	int r = S[N-1] - '0';
	rn[0] = 1;
	int r10 = 1;
	rn[r] = 1;
	ll res = 0;
	for(int i=N-2; i>=0; i--){
		r10 = (r10 * 10) % 2019;
		r = (r + (S[i] - '0') * r10) % 2019;
		//cout<<i<<" "<<r<<" "<<rn[r]<<endl;
		res += rn[r];
		rn[r]++;
	}

	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;

#define int long long

int cnt[2019];

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

	string s;
	cin >> s;
	cnt[0] = 1;
	int p = 1, now = 0, ans = 0;
	for(int i=s.size()-1; i>=0; --i){
		now = (now + (s[i] - '0') * p) % 2019;
		ans += cnt[now];
		++cnt[now];
		p = ((p << 3) + (p << 1)) %2019
	}
	cout << ans << "\n";

	return 0;
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:20:48: error: expected ';' before '}' token
   20 |                 p = ((p << 3) + (p << 1)) %2019
      |                                                ^
      |                                                ;
   21 |         }
      |         ~
Language: C

#include<iostream>
#include<string>
//#include<chrono>

using namespace std;

int main()
{
	//auto start = chrono::steady_clock::now();
	string S;
	int count = 0;

	cin >> S;

	for (int j = S.length() - 1; j >= 3; j--)
	{
		int sum = 0;
		int base = 1;
		for (int i = j; i >= 0; i--)
		{
			sum += (S[i] - '0') * 1;
			sum %= 2019;
			base *= 10;
			base %= 2019;
			count += (sum == 0);
		}
	}
	
	cout << count << endl;

	//auto end = chrono::steady_clock::now();
	//chrono::duration<double> d = end - start;
	//cout << d.count() << endl;
	return 0; 
}

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;

#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(){
  ll P = 2019;
  string S; cin>>S;
  vector<ll> dp(N+1,0);
  ll ten = 1;
  for(int i = N-1; i >= 0; i--){
    ll tmp = ten*((int)(S.at(i)-'0')) + dp.at(i+1);
    tmp %= P;
    ten *= 10;
    ten %= P;
    dp.at(i) = tmp;
    // cout<<dp.at(i)<<endl;
  }
  sort(begin(dp),end(dp));
  map<ll,ll> m;
  for(auto i: dp){
    if(m.count(i))m[i]++;
    else m[i]=1;
  }
  //for(auto p: m)cout<<p.first<<" "<<p.second<<endl;
  ll res = 0;
  for(auto p: m){
    ll cnt = p.second;
    res += (cnt-1)*cnt/2;
  }
  cout<<res<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'N' was not declared in this scope
   13 |   vector<ll> dp(N+1,0);
      |                 ^
Language: C++

#include <bits/stdc++.h>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;
 
int main() {
    string s;
    int a,b,ans = 0,keta = 1,flg = 0, result = 0,q = 1;
    cin >> s;
    int count = s.length();

    vector <int> vec_size(count+1),res;
    long long number[count];

    vec_size[count] = 0;

    number[count-1] = (int)(s[count-1] - '0');
    vec_size[count-1] = number[count-1]%2019;

    for (int i = count-2; i >-1; i--)
    {
        number[i] = ((int)(s[i] - '0')*pow(10,keta) + number[i+1]);
        vec_size[i] = number[i]%2019;  
        keta++;   
    }

    sort(vec_size.begin(), vec_size.end());
    unique_copy(vec_size.begin(), vec_size.end(),back_inserter(res));

    for (auto itr = vec_size.begin(); itr != vec_size.end(); ++itr)
    {
        cout << *itr << " : ";?
        if(next(itr) != vec_size.end()){
            if(*itr == *(next(itr))){
                q++;
                cout << " +" << ?q << " ";
            }else{
                result += q*(q-1)*0.5;
                q = 1;
                // cout << "//";
            }
        }
    }

    cout << endl;

    cout << result<< endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:31: error: expected primary-expression before '?' token
   34 |         cout << *itr << " : ";?
      |                               ^
a.cc:35:9: error: expected primary-expression before 'if'
   35 |         if(next(itr) != vec_size.end()){
      |         ^~
a.cc:34:32: error: expected ':' before 'if'
   34 |         cout << *itr << " : ";?
      |                                ^
      |                                :
   35 |         if(next(itr) != vec_size.end()){
      |         ~~                      
a.cc:35:9: error: expected primary-expression before 'if'
   35 |         if(next(itr) != vec_size.end()){
      |         ^~
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class test {

    public static void main(String[] args) {
        String[] n=new String[100];
        try{
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
            n=br.readLine().split("");
        }catch (IOException e){
            e.printStackTrace();
        }
        int len=n.length;
        int rs=0;
        int start=0;
        int end=0;
        int num=0;
        for (int i = 1; i < len-2; i++) {
            start=0;
            end=len-i;
            for (int j = 0; j < i; j++) {
                num=0;
                for (int k = 0; k < end + 1; k++) {
                    num+=Integer.parseInt(n[j+k])*Math.pow(10,end-k);
                }
                if (num%2019==0){
                    rs++;
                }
            }
        }
        System.out.println(rs);
    }
}

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

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

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

    int64_t T = S;
    int count = 0;
    while (T > 0) {
        T = T / 10;
        count++;
    }

    T = S;
    int64_t U = T;
    int64_t X = 1;
    for (int i = 0; i < count - 1; i++) {
        X = X*10;
    }

    int64_t ans = 0;
    
    for (int i = 0; i < count; i++) {
        for (int j = i; j < count; j++) {
            if (U % 2019 == 0) {
            ans++;
            }
            U = U / 10;
        }
        T = T % X;
        U = T;
        X = X / 10;
    }
    
    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 <string>
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;
 
int main() {
    string s;
    int a,b,ans = 0,keta = 1,flg = 0;
    cin >> s;
    int count = s.length();

    vector <int> vec_size(count+1),res;
    long long number[count];

    vec_size[count] = 0;

    number[count-1] = (int)(s[count-1] - '0');
    vec_size[count-1] = number[count-1]%2019;

    for (int i = count-2; i >-1; i--)
    {
        number[i] = ((int)(s[i] - '0')*pow(10,keta) + number[i+1]);
        vec_size[i] = number[i]%2019;  
        keta++;   
    // }

    // for (int j = 0; j < count; j++)
    // {
    //     cout << j << " : " << number[j] << endl;
    // }
    

    // int i = 0;
    // for (auto itr = vec_size.begin(); itr != vec_size.end(); ++itr)
    // {
    //     cout << i << " : " << *itr << endl;
    //     i++;
    // }
    
    if(vec_size[count-1] == vec_size[count-2]){
        flg++;
    }else if(vec_size[count-1] == vec_size[count-3]){
        flg++;
    }else if(vec_size[count-3] == vec_size[count-2]){
        flg++;
    }

    sort(vec_size.begin(), vec_size.end());
    unique_copy(vec_size.begin(), vec_size.end(),back_inserter(res));
    cout << count - res.size() + 1 -flg << endl;
    
}


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

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

int main(){
  string S;
  cin >> S;
  int L=S.size();
  vector<int> M(L+1);
  M.at(L)=0;
  M.at(L-1)=(S.at(L-1)-'0')%2019;
  int Mod=1;
  for(int i=0; i<L-1; i++){
    Mod=(Mod*10)%2019;
    M.at(L-2-i)=(S.at(L-2-i)-'0')*Mod+M.at(L-1-i);
    M.at(L-2-i)%=2019;
  }
  int Ans=0;
  for(int i=4; i<=L; i++){
    for(int j=0; j<L-i+1; j++){
      if((M.at(j)-M.at(j+i))%2019==0){
        Ans++;
      }
    }
  }
  cout << Ans << endl;
}

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

#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define rep(i,n); for(long long i = 0;i < (n);i++)
using ll = long long;
using P = pair<long long,long long>;
template <class T> using vec = vector<T>;


ll pow2019(ll x,ll n){
    if(n == 0)return 1;
    if(n%2)return x*pow2019(x*x%2019,n/2)%2019;
    else return pow2019(x*x%2019,n/2)%2019;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s; cin >> s;
    ll n = s.size();
    vec<ll> t(n+1); t[n] = 0;
    rep(i,n)t[n-i-1] = ((t[n-i] + (s[n-i-1] - '0')*pow2019(10,i))%2019 + 2019)%2019;
    t.pop_back;
    sort(t.begin() , t.end());
    ll ans = 0,num = 1;
    rep(i,n-1){
        if(t[i] != t[i+1]){
            ans += num*(num-1)/2;
            num = 0;
        }
        num++;
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:7: error: invalid use of non-static member function 'void std::vector<_Tp, _Alloc>::pop_back() [with _Tp = long long int; _Alloc = std::allocator<long long int>]'
   23 |     t.pop_back;
      |     ~~^~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1324:7: note: declared here
 1324 |       pop_back() _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
Language: C++

#include "bits/stdc++.h"
#define int long long
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(obj) begin(obj), end(obj)
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
#define LOWER_BOUND(A, key) distance(A.begin(), lower_bound(ALL(A), key))
#define UPPER_BOUND(A, key) distance(A.begin(), upper_bound(ALL(A), key))

using namespace std;
using ll       = long long;
const int MOD  = (int)(1e13 + 7);
const int MOD2 = 2019;
const int INF  = (int)(1e13 + 7);

template <class T = int>
int in() {
  T x;
  cin >> x;
  return x;
}
int bpm(int x, int y) {
  if (x == 0)
    return 0;
  else if (y == 0) {
    return 1;
  }
  int ans = 1;
  x %= MOD2;
  int digit = (int)((log((double)y) / log((double)2) / 1 + 1));
  for (int i = 0; i < digit; i++) {
    if (((y >> i) & 1u) == 1) {
      ans *= x;
      ans %= MOD2;
    }
    x = x * x;
    x %= MOD2;
  }
  return ans;
}
#define MAX_ 500000
int inv_list[MAX_]; //inv_list[i-1] = inverse of i
int fac[MAX_];
int finv[MAX_];
void nCk_init() {
  inv_list[0] = fac[0] = finv[0] = 1;
  for (int i = 0; i < MAX_ - 1; i++) {
    inv_list[i + 1] = MOD - ((inv_list[(MOD % (i + 2)) - 1] * (MOD / (i + 2))) % MOD);
    fac[i + 1]      = (fac[i] * (i + 2)) % MOD;
    finv[i + 1]     = (finv[i] * inv_list[i + 1]) % MOD;
  }
}
int nCk(int n, int k) {
  if (n == k || k == 0) return 1;
  if (n < k) return 0;
  return (fac[n - 1] * ((finv[k - 1] * finv[n - k - 1]) % MOD)) % MOD;
}
class DMultipleOf2019 {
public:
  static void solve(std::istream &cin, std::ostream &cout) {
    string S;
    cin >> S;
    vector<int> T(S.size() + 1, 0);
    rep(i, S.size()) {
      T[S.size() - (i + 1)] = (T[S.size() - i] + bpm(10, i) * (S[S.size() - (i + 1)] - '0')) % MOD2;
    }
    vector<int> check(2019, 0);
    rep(i, T.size()) {
      check[T[i]]++;
    }
    int ans = 0;
    nCk_init();
    rep(i, 2019) {
      ans += nCk(check[i], 2);
    }
    cout << ans << endl;
  }
};


Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C

#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i < b; i++)
#define Rep(i, a, b) for(int i = a; i <= b; i++)
#define _GLIBCXX_DEBUG
#define Vl vector<ll>
#define Vs vector<string>
#define Vp vector<pair<ll, ll>>
#define ll long long
#define ALL(v) (v).begin(),(v).end()
using namespace std;
const double pi = acos(-1.0);
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;
using Graph = vector<vector<int>>;

int main() {
  string s; cin >> s;
  ll p = 2019;

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

  //組み合わせの数を計算
  vector<int> sum(p, 0);
  ll ans = 0;
  Rep(i, 0, n){
    ans += sum[d[i]];
    sum[d[i]]++;
  }

  cout << ans << endl;

  return 0;
}


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

 #include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
const ll INF=1e18 ;
const int mod=2019 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}

int main() {
   string s;
   cin>>s ;
   ll k= s.size() ;
   vector<ll> a(k) ;
   for(ll i=k-1;i >=0;i--){
     if(i==k-1)
     a[i]=s.at(i);
     else
     a[i]=(a[i+1]+s.at(i)*pow(10,k-1-i))%mod;  
   }
   vector<ll> b(2019) ;
   rep(i,k) b[a[i]] ++ ;

  ll ans=0 ;
  rep(j,2019) 
  ans+= b[j]*(b[j]-1) /2 ;
   
   cout<<ans <<endl;
    return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:22:41: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'const int' to binary 'operator%'
   22 |      a[i]=(a[i+1]+s.at(i)*pow(10,k-1-i))%mod;
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
      |                  |                       |
      |                  |                       const int
      |                  __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

#include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
const ll INF=1e18 ;
const int mod=2019 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}

int main() {
   string s;
   cin>>s ;
   ll k= s.size() ;
   vector<ll> a(k) ;t
   for(ll i=k-1;i>=0;i--){
     if(i==k-1)
     a[i]=s.at(i);
     else
     a[i]=(a[i+1]+s.at(i)*pow(10,k-1-i))%mod;  
   }
   vector<ll> b(2019) ;
   rep(i,k) b[a[i]] ++ ;

  ll ans=0 ;
  rep(j,2019) 
  ans+= b[j]*(b[j]-1) /2 ;
   
   cout<<ans <<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:21: error: 't' was not declared in this scope
   17 |    vector<ll> a(k) ;t
      |                     ^
a.cc:18:17: error: 'i' was not declared in this scope
   18 |    for(ll i=k-1;i>=0;i--){
      |                 ^
Language: C++

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

typedef long long ll;
// #define int ll
#define pb push_back
const int INF = 1e9;

signed main(){

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


	string s; cin>>s;

	int n = s.size();

	vector<int> dp(2019,0), next(2019,0);
	int ans = 0;
	for(int i=0;i<n;i++){
		next.assign(2019,0);
		int cur = s[i] - '0';
		next[cur] = 1;
      	int idx = (10*j+cur)%2019;
		for(int j=0;j<2019;j++){
			next[idx] += dp[j];
          	idx++;
          	if (idx == 2019)
              idx = 0;
		}

		for(int j=0;j<2019;j++)
			dp[j] = next[j];

		ans += dp[0];

	}	
	cout<<ans;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:23: error: 'j' was not declared in this scope
   26 |         int idx = (10*j+cur)%2019;
      |                       ^
Language: C++

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

typedef long long ll;
// #define int ll
#define pb push_back
const int INF = 1e9;

signed main(){

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


	string s; cin>>s;

	int n = s.size();
  	if (n > 100000)
      assert(false);
	vector<int> dp(2019,0), next(2019,0);
	int ans = 0;
	for(int i=0;i<n;i++){
		next.assign(2019,0);
		int cur = s[i] - '0';
		next[cur] = 1;
      	int idx = (10*j+cur)%2019;
		for(int j=0;j<2019;j++){
			next[idx] += dp[j];
          	idx++;
          	if (idx == 2019)
              idx = 0;
		}

		for(int j=0;j<2019;j++)
			dp[j] = next[j];

		ans += dp[0];

	}	
	cout<<ans;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:23: error: 'j' was not declared in this scope
   27 |         int idx = (10*j+cur)%2019;
      |                       ^
Language: C++

#include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
const ll INF=1e18 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}
int main() {
   string s;
   cin>>s ;
   ll k= s.size() ;
   vector<ll> a(k) ;
   for(ll i=k-1;i>=0;i--){
     if(i==k-1)
     a[i]=s.at(i);
     else
     a[i]=(a[i+1]+s.at(i)*pow(10,k-1-i))%2019;  
   }
   vector<ll> b(2019) ;
   rep(i,k) b[a[i]] ++ ;
   
  ll ans=0 ;
  rep(j,2019) 
  ans+= b[j]*(b[j]-1) /2 ;
   
   cout<<ans <<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:41: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
   20 |      a[i]=(a[i+1]+s.at(i)*pow(10,k-1-i))%2019;
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
      |                  |                       |
      |                  |                       int
      |                  __gnu_cxx::__promote<double>::__type {aka double}
Language: C

/*
      THINK  TWICE  CODE  ONCE
        KEEP   GOING   BI*CH
           NEVER GIVE UP
               3 R B
                . .
                 .
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define ll long long
#define bp  __builtin_popcount
#define pb push_back
using namespace std;
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag, tree_order_statistics_node_update> indexed_set;
const int maxn=1e5+5;
const  double EPS = 1e-14;
const ll MOD = 1e9+7;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
#endif
    string s;
    cin>>s;
    int cnt=0;
    for(int i=0;i<=s.size();i++)
    {
        if(s[i -'0']%2019==0)
            cnt++;
    }
    cout<<cnt;
}


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

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);++i)
#define ALL(v)   (v).begin(),(v).end()
#define debug(x) cerr<<#x<<": "<<(x)<<endl
#define INF      (int)1e9
#define EPS      (double)1e-9
#define MOD      ((int)1e9+7)
using namespace std;
typedef long long     llong;
typedef vector<int>   vi;
typedef vector<vi >   vvi;
typedef vector<vvi >  vvvi;
typedef pair<int,int> pii;
template<class Type> void line(const Type &a){int cnt=0;for(const auto &elem:a){if(cnt++)cout<<' ';cout<<elem;}cout<<endl;}

//解説参考.
int main(){
	string s;
	cin>>s;
	
	vi cnt(2019,0);
	cnt[0]=1;
	int tmp=0;
	int weight=1;
	llong ans=0;
	REP(i,s.size()){
		tmp=(tmp+weight*(s[s.size()-1-i]-'0')%2019)%2019;
		ans+=cnt[tmp];
		cnt[tmp]++;
		weight=(10*weight)%2019;
	}
	
	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.