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

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

int main(void) {
  char N;
  scanf("%s", &N);
  long cnt = 0;
  long S_int = 0;
  int len_s = strlen(S)
  for(int n = 4; n <= len_s; n++) {
    for(int i = 0; i <= len_s - n; i++) {
      strncpy(S_int, S+i, n);
      S_int = atoi(S_int);
      if (S_int % 2019 == 0){
       	cnt += 1;
      }
    }
  }
  printf("%ld", cnt);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:22: error: 'S' undeclared (first use in this function)
   10 |   int len_s = strlen(S)
      |                      ^
main.c:10:22: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:3: error: expected ',' or ';' before 'for'
   11 |   for(int n = 4; n <= len_s; n++) {
      |   ^~~
main.c:11:18: error: 'n' undeclared (first use in this function)
   11 |   for(int n = 4; n <= len_s; n++) {
      |                  ^
main.c:11:33: error: expected ';' before ')' token
   11 |   for(int n = 4; n <= len_s; n++) {
      |                                 ^
      |                                 ;
main.c:11:33: error: expected statement before ')' token
main.c:13:15: error: passing argument 1 of 'strncpy' makes pointer from integer without a cast [-Wint-conversion]
   13 |       strncpy(S_int, S+i, n);
      |               ^~~~~
      |               |
      |               long int
In file included from main.c:3:
/usr/include/string.h:144:40: note: expected 'char * restrict' but argument is of type 'long int'
  144 | extern char *strncpy (char *__restrict __dest,
      |                       ~~~~~~~~~~~~~~~~~^~~~~~
main.c:14:20: error: passing argument 1 of 'atoi' makes pointer from integer without a cast [-Wint-conversion]
   14 |       S_int = atoi(S_int);
      |                    ^~~~~
      |                    |
      |                    long int
In file included from main.c:2:
/usr/include/stdlib.h:105:30: note: expected 'const char *' but argument is of type 'long int'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C

#include<bits/stdc++.h>
#include<unordered_map>
using namespace std;
#define ll long long
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for(ll i = 0; i < n; i++)
const ll INF = 100100100100100100;//10^17
const ll MOD = 1000000007;


ll combination(ll n, ll r){
    if(n < r) return 0;
    if(r == 0||r == n) return 1;
    else if(r == 1) return n;
    return (combination(n - 1, r - 1) + combination(n - 1, r));
}

bool checkKaibun(string str){
    string checkStr = str;
    reverse(checkStr.begin(), checkStr.end());
    if(str == checkStr) return true;
    else return false;
}

int keta(ll num){
    int digits = 0;
    while(num > 0){
        num /= 10;
        digits++;
    }
    return digits;
}


ll mpow(ll x, ll n, ll mod){//繰り返し二乗法 計算量O(logN)
    ll ans = 1;
    while(n != 0){
        if(n&1) ans = ans * x % mod;
        x = x * x % mod;
        n  = n >> 1;
    }
    return ans;
}

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



int main(){
    string s;
    cin >> s;
    int len = s.length();
    ll num = 0;
    map<int, int> m;
    m[0]++;
    for(int i = 0; i < len; i++){
        num += (s[len - i - 1] - 48) * mpow(10, i, 2019);
        num %= 2019;
        m[num]++;
    }
    ll ans = 0;
    for(auto x: m){
        ans += (x.second * (x.second - 1)) / 2;
    }
    cout << ans << endl;
} 

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

ss = input()[::-1]
sv = ''
mods = {}

for s in ss:
    sv = s + sv
    i = int(sv) % 2019
    try:
        mods[i] += 1
    except KeyError:
        mods[i] = 1

if 0 in mods.keys():
    ans = 1
else:
    ans = 0

for v in mods.values():
    ans += (v * (v - 1)) // 2

print(ans)

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | ss = input()[::-1]
      | ^~
main.c:1:1: error: type defaults to 'int' in declaration of 'ss' [-Wimplicit-int]
main.c:1:6: error: implicit declaration of function 'input' [-Wimplicit-function-declaration]
    1 | ss = input()[::-1]
      |      ^~~~~
main.c:1:14: error: expected expression before '::' token
    1 | ss = input()[::-1]
      |              ^~
main.c:2:1: error: expected ',' or ';' before 'sv'
    2 | sv = ''
      | ^~
main.c:2:6: error: empty character constant
    2 | sv = ''
      |      ^~
main.c:5:1: error: expected identifier or '(' before 'for'
    5 | for s in ss:
      | ^~~
Language: C

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#define ll long long
using namespace std;
int main(){
    string s;
    cin>>s;
    ll n=s.length();
    vector<ll> x(n+1,0);
    for(ll i=0;i<n;i++){
        for(ll j=i;j<n;j++){
            x[i]+=(s[j]-'0')*pow(10,n-j-1);
        }
    }
    map<ll,ll> rmap;
    for(ll i=0;i<n+1;i++){
        rmap[x[i]%2019]++;
    }
    
    ll ans=0;
    for(const auto& imap:rmap){
        ans+=imap.second*(imap.second-1)/2;
    }
    cout<<ans<<endl;
    return 0;
}

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

#include <iostream>
#include <string>
#include <map>
#include <set>
#include <cstdlib>
using namespace std;
 
int main(){
  int count=0;
  int mod;
  string s;
  cin >> s;
  int sz=s.size();
  long val=atoi(s.c_str());
  for(int d=sz;d>3;d--)
    if (val%2019==0) {
      count++;
    }
    val=val/10;
  }
  cout << count << endl;
  return 0;
}


Compiler output:
a.cc:21:3: error: 'cout' does not name a type
   21 |   cout << count << endl;
      |   ^~~~
a.cc:22:3: error: expected unqualified-id before 'return'
   22 |   return 0;
      |   ^~~~~~
a.cc:23:1: error: expected declaration before '}' token
   23 | }
      | ^
Language: C++

#include <iostream>
#include <string>
#include <map>
#include <set>
#include <cstdlib>
using namespace std;
 
int main(){
  int count=0;
  int mod;
  string s;
  cin >> s;
  int sz=s.size();
  long val=atoi(s.c_str());
  for(int d=sz;d>3;d--)
    if (val%2019==0) {
      count++;
    }else {
      val=val/10;
    }
  }
  cout << count << endl;
  return 0;
}


Compiler output:
a.cc:22:3: error: 'cout' does not name a type
   22 |   cout << count << endl;
      |   ^~~~
a.cc:23:3: error: expected unqualified-id before 'return'
   23 |   return 0;
      |   ^~~~~~
a.cc:24:1: error: expected declaration before '}' token
   24 | }
      | ^
Language: C

#include <bits/stdc++.h>
#define REP(i, m, n) for(int (i) = (m); (i) < (n); ++i)
#define rep(i, n) REP(i, 0, n)
#define all(x) (x).begin(), (x).end()
using namespace std;
using Graph = vector<vector<int>>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
typedef long long ll;
typedef pair<ll, ll> P;
const int INF = 1e9+7;
const ll LINF = 1LL<<60;

int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    // int n, p;
    // cin >> n >> p;
    string s;
    cin >> s;

    int n = s.length();
    int p = 2019;
    if (10 % p == 0) {
        ll ans = 0;
        rep(r, n) {
            if ((s[r] - '0') % p == 0) {
                ans += r + 1;
            }
        }
        cout << ans << endl;
        return 0;
    }

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

    vector<int> cnt(p);
    ll ans = 0;
    // iを左端の桁としたときに、右側に選べる物が何個あるかをカウントしながら追加している
    for (int i = n; i >= 0; --i) {
        ans += cnt[d[i]];
        cnt[d[i]]++;
    }
    cout << ans << endl;

    return 0;
}

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

#include <iostream>
#include <string>
#include <map>
#include <set>
#include <cstdlib>
using namespace std;
 
int main(){
  int count=0;
  int mod;
  string s;
  cin >> s;
  int sz=s.size();
  if (atoi(c.str())%2019==0) count++;
  cout << count << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: 'c' was not declared in this scope
   14 |   if (atoi(c.str())%2019==0) count++;
      |            ^
Language: C

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

int main() {
  string s;
  cin >> s;
  reverse(s.begin(),s.end());

  map<long long, long long> mp;
  mp[0] = 1;
  long long now = 0, ten = 1;

  for(auto e:s){
    now = (now + (e - '0') * ten) % 2019;
    ten *= 10;
    ten %= 2019;
    mp[now]++;
    cout << now << endl;
  }

  long long ans = 0;
  for(auto e:mp){
    ans += e.second * (e.second - 1) / 2;
//    cout << e.first << " : " <<  e.second << " : " << ans << endl;
  }
  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 S;
  int count=0;
  cin>>S;
  map<long long,long long> saves;
  saves[0]++;
  for(long long i=1;i<(long long)S.size()+1;i++){
  string a=S.substr(S.size()-i,i);
    long long b=stoll(a);
    //cout<<b<<endl;
  saves[b%2019]++;
}

    for(auto k=saves.begin();k!=saves.end();k++){
    int amari=k->second;
      count=count+amari*(amari-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

//
//  main.cpp
//  atcoder
//
//  Created by Hisaki Kobayashi on 2020/04/14.
//  Copyright © 2020 Hisaki Kobayashi. All rights reserved.
//

#include <bits/stdc++.h>
#include <string>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <bitset>
typedef long long ll;
using namespace std;

const int MAX = 510000;
const int MOD = 1000000007;
const int MAX_N = 200000;

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(int argc, const char * argv[]) {
    
    string S;
    cin >> S;
    ll N=S.size();
    ll P = 2019;
    
//    reverse(S.begin(),S.end());
    
    vector<ll> d(N);
    for(ll i=0;i<N;i++){
        d[i] = ctoi(S[N-i-1]);
    }
    
    if(10%P==0){
        ll ans=0;
        for(ll i=0;i<N;i++){
            if(d[i]%P==0){
                ans += N-i;
            }
        }
        cout << ans << endl;
        return 0;
    }

    vector<ll> s(N+1);
    s[0] = 0;
    
    ll ten=1;
    for(ll i=0; i<N; i++){
        
        s[i+1] = (ten * d[i] + s[i])%P;
//        ten *= 10 % P;
        ten = ten*10% P;
    }
    
    vector<ll> kind(P,0);
    
    for(ll i=0;i<N+1;i++){
        kind[s[i]]++;
    }
    
    
    ll cnt=0;
    for(ll i=0;i<P;i++){
        cnt += ((kind[i]-1)*(kind[i]))/2;
    }

    cout << cnt << endl;
    
    return 0;
}




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<iostream>
#include<vector>
#include<string>
using namespace std;
typedef long long ll;
int main(){
  string s;
  cin>>s;
  int n=s.size();
  vector<ll> val(2019,0);
  ll fac=1;
  ll cur=0;
  val[cur]++;
  for(int i=0;i<n;++i){
     long long add=s[n-1-i]-'0';
     cur=(cur+fac*add)%2019;
     fac=(fac*10)%2019;
     val[cur]++;
  }
  ll ans=0;
  for(int i=0;i<val.size();++i){
     ans+=val[i]*(val[i]-1)/2;
     }
     cout<<res<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:12: error: 'res' was not declared in this scope
   24 |      cout<<res<<endl;
      |            ^~~
Language: C

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

int main(){
  string s;
  cin >> s;
  int n = s.size();
  reverse(s.begin(),s.end());
  int tot = 0;
  int x = 1;
  int m = 2019;
  int ans = 0;
  vector<int> cnt(m,0);
  for(int i = 0; i < n; i++){
    cnt.at(tot)++;
    tot += ((s.at(i) - '0') * x);
    tot %= m;
    ans += cnt.at(tot);
    x = x * 10 % m;
  }
  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;
typedef long long ll;

const int m = 2019;

int main()
{
	string s;
	cin >> s;
	reverse(s.begin(), s.end());

	int n = s.size();
	vector<ll> sum(n);
	sum[0] = s[0] - '0';
	ll x = 10;
	for (int i = 1; i < n; i++) {
		sum[i] = (sum[i - 1] + (s[i] - '0')*x) % m;
		x *= 10 % m;
	}

	map<ll, ll> mp;
	mp[0] = 1;
	for (int i = 0; i < n; i++) {
		if (mp.count(sum[i])) mp[sum[i]] = (mp[sum[i]] + 1) % m;
		else mp[sum[i]] = 1;
	}

	ll ans = 0;
	for (const auto& item : mp) ans += (item.second*(item.second - 1) / 2) % m;
	cout << ans << endl;
}


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

#include<iostream>
#include<vector>
using namespace std;
typedef long long ll
int main(){
  string s;
  cin>>s;
  int n=s.size();
  vector<ll> val(2019,0);
  ll fac=1;
  ll cur=0;
  val[cur]++;
  for(int i=0;i<n;++i){
     long long add=s[n-1-i]-'0';
     cur=(cur+fac*add)%2019;
     fac=(fac*10)%2019;
     val[cur]++;
  }
  ll res=0;
  for(int i=0;i<val.size();++i){
     res=val[i]*(val[i]-1)/2;
     }
     cout<<res<<endl;
}

Compiler output:
a.cc:5:1: error: expected initializer before 'int'
    5 | int main(){
      | ^~~
Language: C

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (int i = 0; i < n; i++)
vector<ll> data1;
vector<ll> memo;
string s;
ll n;
int dp(int u)
{
    if (memo[u] != 0)
    {
        return memo[u];
    }
    if (u == n)
    {
        return 0;
    }
    int res = 0;
    res = dp(u + 1) + (s[u] - '0') * data1[n - 1 - u];
    memo[u] = res % 2019;
    return memo[u];
}
int main()
{
    cin >> s;
    n = s.size();
    data1.resize(s.size());
    memo.resize(s.size());
    rep(i, n)
    {
        if (i == 0)
        {
            data1[i] = 1;
            continue;
        }
        data1[i] = data1[i - 1] * 10 % 2019;
    }      //0からn-1まで入ったはず。
    dp(0); //0個以上の数字を文字列とした時に、
    rep(i, n)
    {
        //  cout << memo[i] << endl;
    }
    map<ll, ll> h;
    rep(i, n)
    {
        h[memo[i]] += 1;
    }
    h[0] += 1;
    ll count = 0;
    for (auto x : h)
    {
        //cout << x.first << " " << x.second << endl;
        count += x.second - 1;
    }
    cout << count << endl;
}
//カウントするのは同じものが何個あるかと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;

	int len=s.size();
	map<int,int> modulocount;
	int current_mod=0;
	int mod10n=0;

	modulocount[0]=1;
	mod10n=1;
	for (int i=len-1;i>=0;--i)
	{
		current_mod+=(mod10n*(s[i]-'0'));
		while (current_mod>=2019)
		{
			current_mod-=2019;
		}

		modulocount[current_mod]++;
		//fprintf(stderr,"i:%d current:%d mod10n:%d\n",i,current_mod,mod10n);

		mod10n*=10;
		while (mod10n>=2019)
		{
			mod10n-=2019;
		}
	}

	int count=0;
	for (pair<int,int> p: modulocount)
	{
		int combination=p.second*(p.second-1)/2;
		//fprintf(stderr,"mod %d, count %d, combination %d\n",p.first,p.second,combination);
		count+=combination;
	}
	cout << count << endl;
}




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

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		String str = sc.next();
		StringBuilder strBul = new StringBuilder(str).reverse();
		String[] ar = strBul.toString().split("");
		int mod = 2019;
		int[] a_array = new int[str.length()];
		int[] ruiseki = new int[str.length()+1];
		int[] ten_mod = new int[str.length()];
		ten_mod[0] = 1;
 		for(int i=1;i<str.length();i++) {
 			ten_mod[i]=ten_mod[i-1]*10%mod;
		}
 		for(int i=0;i<str.length();i++) {
 			a_array[i] = Integer.parseInt(ar[i])*ten_mod[i]%mod;
		}
 		for(int i=0;i<str.length();i++) {
 			ruiseki[i+1] = (a_array[i]+ruiseki[i])%mod;
		}
 		int[] cnts= new int[2019];
 		for(int i=1;i<str.length()+1;i++) {
// 			System.out.println(ruiseki[i]);
 			cnts[ruiseki[i]]++;
 		}
 		long ans=0;
 		for(int i=0;i<2019;i++) {
 			if (cnts[i]>1) {
 				ans+=cnts[i]*(cnts[i]-1)/2;
 			}
 		}
 		ans += cnts[0];
 		System.out.println(ans);
	}

}


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

#include <bits/stdc++.h>
using namespace std;
#define ci(a) cin>>(a)
#define co(a) cout<<(a)<<endl
#define rep(i,n) for(int i=0;i<n;i++)

long long make_num(string s,int sta,int len)
{
	long long num=0;
	for(int i=0;i<len;i++){
		num*=10;
		num+=(s.at(sta-len+i)-'0');
	}
	return num;
}
int main()
{
	string S;
	cin>>S;
	int size=S.size();
	long long num;
	int mod[2019]={0};
	rep(i,size-3){
		num=make_num(S,size,4+i);
//		cout<<(num%2019)<<endl;
		mod[num%2019]++;
	}
	int cnt=mod[0];
	rep(i,2019){ if(i>0&&mod[i]>0&&mod[i]%2==0)cnt++;}
	co(cnt);
	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

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
typedef long long ll;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repe(i,n) for (int i = 0; i <= (n); ++i)
#define repe1(i,n) for (int i = 0; i <= (n); ++i)
#define all(x) (x).begin(),(x).end()
#define pb(x) push_back(x)
#define eb(k,v) emplace_back(k,v)
#define ct(res) cout << res << "\n";
#define vi vector<int>
#define vl vector<ll>
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; }
const int INF = 1e9;
const ll MOD = 1000000007;
using Graph = vector<vector<int>>;
ll gcd(ll a, ll b) {return (a%b) ? gcd(b, a%b) : b;}


int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string s;cin >> s;
    int n = s.size();
    vl val(2019,0);
    ll fac=1;
    ll cur=0;
    val[cur]++;
    for (int i=0; i<n; ++i) {
        ll add = s[n-1-i]-'0';
        cur = (cur+fac*add)%2019;
        fac = (fac*10)%2019;
        val[cur]++;
    }
    ll res = 0;
    for(int i=0; i<val.size(); ++i) {
        res += val[i]*(val[i]-1)/2;
    }
    ct(res);
}


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

#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
 
int main(){
  int count=0;
  int mod;
  string s;
  cin >> s;
  int sz=s.size();
  for(int l=0; l<sz-3; l++) {
    mod=atoi(s.substr(l, 4).c_str())%2019;
    for(int r=l+3; r<sz;) {
      if(mod == 0){
        count++;        
      }else{
        r++;
        mod = (mod*10 +atoi(s.substr(r,1).c_str()))%20l9;
      }
    }
  }
  cout << count << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:53: error: unable to find numeric literal operator 'operator""l9'
   19 |         mod = (mod*10 +atoi(s.substr(r,1).c_str()))%20l9;
      |                                                     ^~~~
Language: C++

#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
 
int main(){
  int count=0;
  int mod;
  string s;
  cin >> s;
  int sz=s.size();
  for(int l=0; l<sz-3; l++) {
    mod=atoi(s.substr(l, 4).c_str())%2019;
    for(int r=l+3; r<sz;) {
      if(mod == 0){
        count++;        
      }else{
        r++;
        mod = mod*10 +atoi(s[r].c_str());
      }
    }
  }
  cout << count << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:33: error: request for member 'c_str' in 's.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)r))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   19 |         mod = mod*10 +atoi(s[r].c_str());
      |                                 ^~~~~
Language: C++

#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
 
int main(){
  int count=0;
  int mod;
  string s;
  cin >> s;
  int sz=s.size();
  for(int l=0; l<sz-3; l++) {
    mod=atoi(s.substr(l, 4).c_str())%2019;
    for(int r=l+3; r<sz;) {
      if(mod == 0){
        count++;        
      }else{
        r++;
        mod = mod*10 +atoi(s[r]);
      }
    }
  }
  cout << count << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:27: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
   19 |         mod = mod*10 +atoi(s[r]);
      |                       ~~~~^~~~~~
      |                           |
      |                           __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C

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


void solve(){
  
}

int main() {
	// your code goes here
    
    string s;
    cin >> s;
    
    int n = s.length();
    int ans = 0;
    
    for(int i=0;i<=n-4;i++){
        
        string temp;
        temp += s[i];
        for(int j=i+1;j<n;j++){
            
            temp += s[j];
            stringstream x(temp);
            
            ll num;
            x >> num;
            
            if(num % 2019 == 0)
                ans++;
        }
    }
    
    cout << ans;
}


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

#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
 
int main(){
  int count=0;
  int mod;
  string s;
  cin >> s;
  int sz=s.size();
  int tmp_target
  for(int l=0; l<sz-3; l++) {
    mod=atoi(s.substr(l, 4).c_str())%2019;
    for(int r=l+3; r<sz;) {
      if(tmp_target == 0){
        count++;        
      }else{
        r++;
        tmp_target = tmp_target *10 +atoi(s[r]);
      }
    }
  }
  cout << count << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: expected initializer before 'for'
   13 |   for(int l=0; l<sz-3; l++) {
      |   ^~~
a.cc:13:16: error: 'l' was not declared in this scope
   13 |   for(int l=0; l<sz-3; l++) {
      |                ^
Language: C

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

const int mod=2019;

int main(){
  string s;
  cin >> s;
  int n=s.size();
  reverse(s.begin(),s.end());
  int tot=0;
  long long ans=0;
  int x=1;
  vector<int> cnt(mod);
  for(int i=0;i<n;++i){
    cnt[tot]++;
    tot+=(s[i]-'0')*x;
    tot%=mod;
    ans+=cnt[tot];
    x=x*10%mod;
  }
  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 <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
int main(){
    ios::sync_with_stdio(false);
    string str;
    cin >> str;
    reverse(str.begin(), str.end());
    int n = str.size();
    vector<int> a(n), s(n+1);
    int pow_10_mod = 1;
    s[0] = 0;
    rep(i, n) {
        a[i] = ((str[i]-'0')*pow_10_mod)%2019;
        s[i+1] = (s[i] + a[i])%2019;
        pow_10_mod = (pow_10_mod*10)%2019;
    }
    vector<int> cnt(2019);
    int ans = 0;
    rep(i,n+1) {
        ans += cnt[s[i]];
        cnt[s[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>

#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <math.h>
#include <map>

typedef long long ll;
typedef unsigned long long ull;

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

const double INF = 1e+09;
const int MOD = 1e9+7;

using namespace std;

template <typename _Ty>
ostream& operator << (ostream& ostr, const vector<_Ty>& v) {if (v.empty()) {ostr << "{ }"; return ostr;}
    ostr << "{" << v.front(); for (auto itr = ++v.begin(); itr != v.end(); itr++) {ostr << ", " << *itr;}
    ostr << "}";
    return ostr;}

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

vector<int> uniq(vector<int> vec){
  sort(vec.begin(), vec.end());
  vec.erase(unique(vec.begin(), vec.end()), vec.end());
  return vec;}


  /*
  ll tmp = 1;
  for (int i = n - 1; i >= 0; i--){ vec[i] = (vec[i+1] + tmp*(s[i] - '0')) % 2019;
    tmp *= 10;
    tmp %= 2019;
  }
  */
int main(void){
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  ll n = s.size();
  vector<int> vec(n+1);
  vec[n] = 0;
  int tmp = 1;
  for (int i=n-1; i>=0; i--){
    vec[i] = (vec[i+1] + tmp*int(s[i] - '0')) % 2019;
    tmp *= 10;
    tmp %= 2019;
  }
  sort(vec.begin(), vec.end());
  ll ans = 0;
  int memo = vec[0];
    ll conf = 1;
  FOR(i, 1, n+1){
    if (vec[i] == memo){
      conf++;
    }
    else{
      ans += conf * (conf-1) /2;
      memo = vec[i];
      conf = 1;
    }
  }
  cout << ans << endl;
  return 0;
}



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

#include <bits/stdc++.h>

using namespace std;
const ll MOD=2019;
#define ll long long
ll binpow(ll a,ll b)
{
    if (b==0)
        return 1;
    if (b%2==0)
        return (binpow(a,b/2)*binpow(a,b/2))%MOD;
    return ((binpow(a,b/2)*binpow(a,b/2))%MOD*a)%MOD;
}
int main()
{
    string s;
    cin>>s;
    map<ll,ll>mp;
    ll mo=0;
    mp[mo]++;
    ll ans=0;
    for (ll i=s.length()-1;i>=0;i--)
    {
        mo+=((s[i]-'0')*binpow(10,s.length()-i-1))%MOD;
        mo%=MOD;
        ans+=mp[mo];
        mp[mo]++;
    }
    cout<<ans;
    return 0;
}


Compiler output:
a.cc:4:7: error: 'll' does not name a type
    4 | const ll MOD=2019;
      |       ^~
a.cc:4:7: note: the macro 'll' had not yet been defined
a.cc:5:9: note: it was later defined here
    5 | #define ll long long
      |         ^~
a.cc: In function 'long long int binpow(long long int, long long int)':
a.cc:11:46: error: 'MOD' was not declared in this scope
   11 |         return (binpow(a,b/2)*binpow(a,b/2))%MOD;
      |                                              ^~~
a.cc:12:43: error: 'MOD' was not declared in this scope
   12 |     return ((binpow(a,b/2)*binpow(a,b/2))%MOD*a)%MOD;
      |                                           ^~~
a.cc: In function 'int main()':
a.cc:24:52: error: 'MOD' was not declared in this scope
   24 |         mo+=((s[i]-'0')*binpow(10,s.length()-i-1))%MOD;
      |                                                    ^~~
Language: C++

#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
 
int main(){
  int N;
  int count=0;
  string s,sub;
  cin >> s;
  int sz=s.size();
  for(int l=0; l<sz; l++) {
    for(int r=l+3; r<sz; r++) {
      if(atoi(s.substr(l, r-l))%2019==0){
        count++;
      }
    }
  }
  cout << count << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:23: error: cannot convert 'std::__cxx11::basic_string<char>' to 'const char*'
   14 |       if(atoi(s.substr(l, r-l))%2019==0){
      |               ~~~~~~~~^~~~~~~~
      |                       |
      |                       std::__cxx11::basic_string<char>
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long  ll;
const ll INF=(ll)1e18;

int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);
    string s;cin>>s;
    int counter=0;
    for(int i=4;i<=s.size();i++){
        for(int j=0;j<s.size()-i+1;j++){
            string b=s.substr(j,i);
            unsigned ll x=b[0]-'0';
            for(int y=1;y<b.size();y++){
                x*=10;x+=b[y]-'0';
                x%=2019;
            }
            if(x==0)counter++;
        }
    }
    cout<<counter<<"\n";
}




Compiler output:
a.cc: In function 'int main()':
a.cc:13:25: error: expected initializer before 'x'
   13 |             unsigned ll x=b[0]-'0';
      |                         ^
a.cc:15:17: error: 'x' was not declared in this scope
   15 |                 x*=10;x+=b[y]-'0';
      |                 ^
a.cc:18:16: error: 'x' was not declared in this scope
   18 |             if(x==0)counter++;
      |                ^
Language: Java



import java.util.*;

import java.math.*;


public class sumo { 
	static int[] dp;
    static int mod=(int)1e9+7;
    public static  long help(String s, int k) {
    //  dp=new int[200000];
      
      
     return fun(s,k,0);
    }
    
    
     public static long fun(String s, int k,int i) {
         
         long cc=0;
        
         for (int j = 0; j <s.length(); j++) {
			for (int j2 = j+1; j2 <s.length(); j2++) {
				if(j2-j>=1 && Long.parseLong(s.substring(j, j2+1))%2019==0)
					cc++;
				
			}
		}
         return cc;
         
     }
	    	
	    
	public static void main(String args[] ) throws Exception {
		Scanner s=new Scanner(System.in);
	//	String hs="1817181712114";
		String hs=s.next();
		 System.out.println(help(hs,2019));
		
}


} 


Compiler output:
Main.java:8: error: class sumo is public, should be declared in a file named sumo.java
public class sumo { 
       ^
1 error
Language: Java



import java.util.*;

import java.math.*;


public class leet3 { 
	static int[] dp;
    static int mod=(int)1e9+7;
    public static  int help(String s, int k) {
      dp=new int[200000];
      
      
     return fun(s,k,0);
    }
    
    
     public static int fun(String s, int k,int i) {
         
         int cc=0;
        
         for (int j = 0; j <s.length(); j++) {
			for (int j2 = j+1; j2 <s.length(); j2++) {
				if(j2-j>=1 && Long.parseLong(s.substring(j, j2+1))%2019==0)
					cc++;
				
			}
		}
         return cc;
         
     }
	    	
	    
	public static void main(String args[] ) throws Exception {
		Scanner s=new Scanner(System.in);
	//	String hs="1817181712114";
		String hs=s.next();
		 System.out.println(help(hs,2019));
		
}


} 


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

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;

//typedef
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;

//conversion
inline LL toLong(string s) {LL v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) LL((a).size())
#define EACH(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define UNTIL(p) while(!(p))

//constant
const double EPS = 1e-5;
const double PI  = acos(-1.0);

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

#define PUTS(x) cout << (x) << endl;

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin>>s;
    reverse(ALL(s));

    LL cnt[2020] = {1,0};
    LL sum = 0;
    LL x = 1;
    for(char c : s){
        LL a = c - '0';
        sum += a * x;
        sum %= 2019;
        x *= 10;
        x %= 2019;
        cnt[sum]++;
    }

    LL ans = 0;
    REP(i,2019){
        ans += cnt[i] * (cnt[i] - 1) / 2;
    }
    PUTS(ans);
}

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

s = input()
from collections import Counter
x = 1
mod = 2019
total = 0
ans = 0
cnt = Counter()
for i in range(len(s)-1,0,-1):
    cnt[total] += 1
    total = int(s[i::])%mod
    ans += cnt[total]
print(ans)

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

#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int) n; i++)
using ll = long long;
template <class T>
using vt = std::vector<T>;
using vvi = std::vector<vt<int>>;
const int MOD = 2019;

int main(){
  std::string s;
  std::cin >> s;
  int N = s.size();

  vt<int> p(N);
  int ten = 10;
  p[0] = s[N-1] - '0';
  for(int i = N-2; i >= 0; i--) {
    p[N-1-i] = ((s[i]-'0')*ten + p[N-2-i])%MOD;
    ten *= 10;
    ten%=MOD;
  }

  vt<int> v(2019);
  rep(i,N){
    v[p[i]]++;
  }
  int ans = 0;
  rep(i,2019){
    if(i==0)
      ans += v[0];
    else
      ans += v[i]*(v[i]-1)/2;
  }

  std::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;
typedef long long ll;
const int maxn = 200000 + 10;
const int mod = 2019;
map<int, int> M;
char s[maxn];
int n;
ll ans;
int main()
{
	scanf("%s", s + 1);
	n = strlen(s + 1);
	reverse(s + 1, s + n + 1);
	int cur = 0, base = 1;
	M[0] = 1;
 	for(int i = 1; i <= n; ++i)
 	{
 		cur = (base * (s[i] - '0') + cur) % mod;
 		base = base * 10 % mod;
 		//cout << cur << endl; 
 		ans += M[cur];
 		++M[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>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int const m = 2019;

int main() {
    string s;
    cin >> s;
    int n = s.size();
    reverse(s.begin(), s.end());
    int x = 1, tot = 0;
    vector<int> cnt(m);
    ll ans = 0;
    rep(i, n) {
        cnt[tot]++;
        tot += (s[i] - '0')*x;
        tot %= m;
        ans += cnt[tot];
        x = x * 10%m;
    }
  
  for(int j = 0; j < 10; j++) {
    cout << cnt(j) << endl;
  }
    
    cout << ans << endl;
    return 9;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:16: error: no match for call to '(std::vector<int>) (int&)'
   25 |     cout << cnt(j) << endl;
      |             ~~~^~~
Language: C++

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

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

    cout << ans << endl;
    return 9;
}

Compiler output:
a.cc:6:10: error: expected initializer before 'm'
    6 | int cont m = 2019;
      |          ^
a.cc: In function 'int main()':
a.cc:14:21: error: 'm' was not declared in this scope
   14 |     vector<int> cnt(m);
      |                     ^
Language: C

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

using namespace std;

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

	int mod = 2019;
	vector<int> dp(s.length() + 1);
	int t = 1;
	for (int i = s.length() - 1; i >= 0; i--) {
		dp[i] = (s[i] - '0') * t + dp[i + 1];
		dp[i] %= mod;
		
		t *= 10;
		t %= mod;
	}

	int a[2019] = {};
	for (int i = 0; i <= s.length(); i++) {
		a[dp[i]]++;
	}

	long long ans = 0;
	for (int i = 0; i < 2019; i++) {
		ans += a[i] * (a[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;
#define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define ll long long
#define pb push_back
#define F first
#define S second
#define ld long double
#define vi vector<ll>
const int N = 1e9 + 5;

void solve() {
	string s;
	cin >> s;
	vi MOD(2019, 0);
	MOD[0] = 1;
	ll n = 0, a = 1;
	for (int i = s.size() - 1; i >= 0; i--) {
		ll cur = s[i] - '0';
		n = (n + (a * cur) % 2019) % 2019;
		//cout << a << " " << n << endl;
		a *= 10;
		a %= 2019;
		MOD[n]++;
	}
	ll ans = 0;
	for (auto c : MOD) ans += (c * (c - 1)) / 2;
	cout << ans;
}

int main() {

	FASTIO;
/*
#ifndef ONLINE_JUDGE
	// for getting input from input.txt
	freopen("input.txt", "r", stdin);
	// for writing output to output.txt
	freopen("output.txt", "w", stdout);
#endif
*/
	int t = 1;
	//cin >> t;
	while (t--) {
		solve();
	}
	return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
#define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define ll long long
#define pb push_back
#define F first
#define S second
#define ld long double
#define vi vector<ll>
const int N = 1e9 + 5;

void solve() {
	string s;
	cin >> s;
	vi MOD(2019, 0);
	MOD[0] = 1;
	ll n = 0, a = 1;
	for (int i = s.size() - 1; i >= 0; i--) {
		ll cur = s[i] - '0';
		n = (n + (a * cur) % 2019) % 2019;
		//cout << a << " " << n << endl;
		a *= 10;
		a %= 2019;
		MOD[n]++;
	}
	ll ans = 0;
	for (auto c : MOD) ans += (c * (c - 1)) / 2;
	cout << ans;
}

int main() {

	FASTIO;

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

	int t = 1;
	//cin >> t;
	while (t--) {
		solve();
	}
	return 0;
}

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

///Bismillahir Rahmanir Rahim
#pragma GCC optimize("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#pragma warning(disable:4786)
#pragma warning(disable:4996)
#include <ctime>
#include<list>
#include <numeric>
#include<bitset>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<functional>
#include<string>
#include<cstring>
#include<cstdlib>
#include<queue>
#include<utility>
#include<fstream>
#include<sstream>
#include<cmath>
#include<stack>
#include<assert.h>
#include<unordered_map>
#include<unordered_set>
using namespace std;
#define                           fast                        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define                           f(i,l,r)                    for(int i=l;i<=r;i++)
#define                           rf(i,r,l)                   for(int i=r;i>=l;i--)
#define M 200009
int cnt[2020],ncnt[2020];
int a[M+2];
int ten[M+3];
const int mod=2019;
inline int bigmod(int B,int P){int R=1;while(P>0){if(P&1){R=(R*B)%mod;}P>>=1;B=(B*B)%mod;}return R;}
int main()
{
    string s;
    cin>>s;
    int sz=s.size();
    int cur=0;
    ten[0]=1;
    f(i,1,M)
    {
        ten[i]=(ten[i-1]*10)%mod;
    }
    rf(i,sz-1,0)
    {
         a[cur]=s[i]-'0';
         cur++;
    }
    int n=cur;
    int sum=0;
    int ses=0;
    f(i,0,n-1)
    {
        int val=(ten[i]*a[i])%mod;
        sum=(sum+val)%mod;
        cnt[sum]++;
        if(sum==0)ses++;
    }
    f(i,0,n-3)
    {
         f(j,0,2019)ncnt[j]=0;
         f(j,0,2019)
         {
             int nval=(j-ten[i]+mod)%mod;
             nval=(nval*bigmod(ten[1],mod-2))%mod;
             if(nval<0)nval+=mod;
             nval%=mod;
             if(nval==0)ses+=cnt[j];
             ncnt[nval]+=cnt[j];
         }
         f(j,0,2019)cnt[j]=ncnt[j];
    }
    cout<<ses<<endl;

}


Compiler output:
In file included from /usr/include/c++/14/list:63,
                 from a.cc:9:
/usr/include/c++/14/bits/allocator.h: In destructor 'std::__cxx11::basic_string<char>::_Alloc_hider::~_Alloc_hider()':
/usr/include/c++/14/bits/allocator.h:182:7: error: inlining failed in call to 'always_inline' 'std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = char]': target specific option mismatch
  182 |       ~allocator() _GLIBCXX_NOTHROW { }
      |       ^
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from a.cc:11:
/usr/include/c++/14/bits/basic_string.h:186:14: note: called from here
  186 |       struct _Alloc_hider : allocator_type // TODO check __is_final
      |              ^~~~~~~~~~~~
Language: C

#define _GLIBCXX_DEBUG
#include "bits/stdc++.h"
//#include <intrin.h>  //AtCoder (gcc) 上ではこれがあると動かない。__popcnt用のincludeファイル。
using namespace std;
using Graph = vector<vector<int>>;

typedef long long ll;
typedef long double ld;


#define int long long
#define rep(i, n) for(long long i = 0; i < (n); i++)
#define sqrt(d) pow((long double) (d), 0.50)

const ll INF = 2e9;
const ll large_P = 1e9 + 7;



//繰り返し2乗法
//N^aの、Mで割った余りを求める。
ll my_pow(ll N, ll a, ll M) {
	ll tempo;
	if (a == 0) {
		return 1;
	}
	else {
		if (a % 2 == 0) {
			tempo = my_pow(N, a / 2, M);
			return (tempo * tempo) % M;
		}
		else {
			tempo = my_pow(N, a - 1, M);
			return (tempo * N) % M;
		}
	}
}



//N_C_a を M で割った余り
ll my_combination(ll N, ll a, ll M) {
	ll answer = 1;

	rep(i, a) {
		answer *= (N - i);
		answer %= M;
	}

	rep(i, a) {
		answer *= my_pow(i + 1, M - 2, M);
		answer %= M;
	}

	return answer;
}



ll my_gcd(ll& a, ll& b) {
	if (b == 0) return a;
	ll temp = a % b;
	return my_gcd(b, temp);
}



// long long型 n を、base 進法での、i 桁目の数が入った vector にする。
void ll_to_vector(ll base, ll n, vector<ll>& v) {
	ll tempo = n;

	ll n_digit = floor(log10(n) / log10(base)) + 1;
	v.assign(n_digit, 0);

	//ll n_digit = v.size();

	for (ll i = 0; i < n_digit; i++) {
		v.at(i) = tempo / pow(base, n_digit - 1 - i);
		tempo -= v.at(i) * pow(base, n_digit - 1 - i);
	}
}



int char_to_int(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 0;
	}
}



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

	map<int, int> memo; memo[0]++;
	
	int amari = 0;
	int digit = 1;
	
	rep(i, N) {
		amari = (amari+ digit * char_to_int(S.at(N - 1 - i))) % 2019;
		digit = (digit * 10) % 2019;

		memo[amari]++;
		//cout << amari << endl;
	}

	int res = 0;
	for (auto&& iter = memo.begin(); iter != memo.end(); iter++) {
		res += iter->second * (iter->second - 1)/2;
		//cout << iter->first << " " << iter->second << endl;
	}

	cout << res << endl;
}

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

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;

const int m = 2019;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:16:8: error: expected primary-expression before 'int'
   16 |   for((int i=0; i<n; i++){
      |        ^~~
a.cc:16:8: error: expected ')' before 'int'
   16 |   for((int i=0; i<n; i++){
      |       ~^~~
      |        )
a.cc:16:17: error: 'i' was not declared in this scope
   16 |   for((int i=0; i<n; i++){
      |                 ^