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

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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(18);
  
  string s;
  cin >> s;
  ll n = s.size();
  
  ll ans = 0;
  for(ll i = 0; i <= n-1-4; i++) {
    ll I = stoll(s.substr(i));
    for(ll j = i+4; j <= n; j++) {
      ll J = (j==n ? 0LL : stoll(s.substr(j)) );
      if((I-J) % 2019 == 0) ans++;
    }
  }
  
  cout << ans << "\n";
}

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

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
using namespace std;


int main() {
  mp::cpp_int n,m,sum=0,flag=0,num=0,ans=0;
  cin>>n;
  m=n;
  while(m>0){
    m/=10;
    flag++;
  }
  
  m=n;
  
  for(long long j=flag; j>=3; j--){
    mp::cpp_int a=1000;
    while(m/a>0){
      a*=10;
      num=m%a;
      if(num%2019==0)
        ans++;
      
    }
    m/=10;
    
  }
      
  
    
  cout<<ans<<endl;
  
  
  
  
}


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

#include <iostream>
#include <vector>
#include <queue>
#include <math.h>
#include <unordered_map>
#include <cstring>
#include <algorithm>
#include <set>
#include <climits>
#include <numeric>

//usings
using namespace std;

//type def
typedef long long int64;
typedef pair<int, int> ii;

//consts
const int mod = 1e9 + 7;

//methods
template<typename T>
bool chmax(T& source, const T& compare_to) {
    if(source < compare_to) {
        source = compare_to;
        return true;
    }
    return false;
}

int modpow(int64 base, int n) {
    int64 ret = 1;
    while(n) {
        if(n & 1) ret = ret * base % mod;
        base = base * base % mod;
        n >>= 1;
    }
    return ret;
}

int dp[200000];

class Solution {
private:
public:
    int solve(string& s) {
        int n = s.size(), ret = 0;
        memset(dp, 0, sizeof(dp));
        for(int i = 0; i < n; ++i) {
            int cur = s[i] - '0';
            dp[i] = cur;
            for(int j = i - 1; j >= 0; --j) {
                dp[j] = (dp[j] * 10 + cur) % 2019;
                if(dp[j] == 0) ++ret;
            }
        }
        return ret;
    }
};

int main() {
    string s;
    cin >> s;
    Solution sol;
    auto ret = sol.solve(s);
    cout << ret << endl;
    
}

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


import java.util.Scanner;

public class  {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		int count = 0;
		sc.close();
		for (int i = 0; i < s.length()-3; i++) {
			for (int j = i+3; j < s.length(); j++) {
				String subStr = s.substring(i, j);
				int num = Integer.parseInt(subStr);
				if (num % 2019 == 0) {
					count++;
				}
			}
		}

		System.out.println(count);
	}

}


Compiler output:
Main.java:4: error: <identifier> expected
public class  {
            ^
1 error
Language: C++

// // If you want something you've never had, you must be willing to do
// // something you've never done

// //  When the going gets tough,  the tough get going

#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx2,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#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 pair<int,int> ii;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef tree<pair<int,int>, null_type,less<pair<int, int> >,rb_tree_tag,tree_order_statistics_node_update > pbds;

#define debug(x) cout<<#x<<" :: "<<x<<endl;
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<endl;
#define debug3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<endl;
#define debug4(x,y,z,w) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\t"<<#w<<" :: "<<w<<endl;
#define ROUNDOFFINT(d) d = (int)((double)d + 0.5)
#define sort_unique(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define pb push_back
#define IOS ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
// #define int ll
ll power(ll a, ll b, ll mod) {
    ll res = 1;
    a %= mod;
    while(b) {
        if(b % 2) {
            res *= a;
            res %= mod;
        }
        a = a * a % mod;
        b >>= 1;
    }
    return res % mod;
}
const int INF = 2e9;

// ----------------------------------------------------------

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

signed main() {
    // freopen("in.txt", "r", stdin);
    // freopen("out.txt", "w", stdout);
    // int t;
    string s;
    cin >> s;
    map<int, ll> m;
    ll ans = 0;
    int n = s.length();
    ll pw[n + 1];
    memset(pw, 0LL, sizeof pw);
    pw[0] = 1;
    for(int i=1; i<=n; i++) {
        pw[i] = 10 * pw[i-1];
        pw[i] %= 2019;
    }
    int has = 0;
    m[0] = 1;
    for(int i=n-1; i>=0; i--) {
        has += (s[i]-'0') * pw[n-1-i];
        has %= 2019;
        debug2(i, has);
        if(s[i] != '0')
            ans += m[has];
        m[has]++;
    }
    cout << ans << '\n';
    return 0;
}


Compiler output:
In file included from /usr/include/c++/14/string:43,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:10:
/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:
/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

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define db(x) cerr<<__LINE__<<": "<<#x<<" = "<<(x)<<'\n'
const int N = 1e6;

int main() {
    ios_base::sync_with_stdio(0);
    int a,b,n,T,cas=0;
    string s;
    cin>>s;
    map<int, int> mp;
    mp[0]=1;
    int r=0, pow10=1;
    ll res=0;
    for(int i=s.size()-1;~i;--i) {
        r = (r + (s[i]-'0')*pow10)%2019;
        res += mp[r];
        mp[r]++;
        pow10 = (pow10*10)%2019;
    }
    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>
#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) ;
   ll x=10 ;
   
   for(ll i=k-1;i >=0;i--){
     if(i==k-1)
     a[i]=s.at(i)-'0';
     else
     a[i]=(a[i+1]+(s.at(i)-'0')*x)%mod;  
     x *=10%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:35:14: error: expected '}' at end of input
   35 |     return 0;
      |              ^
a.cc:13:12: note: to match this '{'
   13 | int main() {
      |            ^
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) ;
   int x=10 ;
   
   for(int i=k-1;i >=0;i--){
     if(i==k-1)
     a[i]=s.at(i)-'0';
     else
     a[i]=(a[i+1]+(s.at(i)-'0')*x)%mod;  
     x *=10 ;
   }
   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:38:1: error: expected unqualified-id before '--' token
   38 | ------------------------------------
      | ^~
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) ;
   int x=10
   
   for(int i=k-1;i >=0;i--){
     if(i==k-1)
     a[i]=s.at(i)-'0';
     else
     a[i]=(a[i+1]+(s.at(i)-'0')*x)%mod;  
     x *=10 ;
   }
   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:4: error: expected ',' or ';' before 'for'
   20 |    for(int i=k-1;i >=0;i--){
      |    ^~~
a.cc:20:18: error: 'i' was not declared in this scope
   20 |    for(int i=k-1;i >=0;i--){
      |                  ^
Language: Java


import java.util.*;

import java.math.*;


public class Main { 
	static long[] dp;
    static int mod=(int)1e9+7;
    public static  void help(String s, int k) {
      dp=new long[200000];
     
      fun(s);
    }
    
    
 
    static	void  fun(String s) {
		int n = s.length();

		long rem[] = new long[2019];
	
		int digit = 0;long power = 1;
      ++rem[digit];
		for (int i = n - 1; i >= 0; --i) {
			digit = (power * (s.charAt(i) - '0') + digit) % 2019;
			power = (power * 10);
			++rem[digit];

		}
		
		long ans = 0;
		for (int i = 0; i < 2019; ++i) {
			if (rem[i] > 0) {
				ans += (rem[i] * (rem[i] - 1)) / 2;
			}
		}
		System.out.println(ans);
	}

   
	    
	public static void main(String args[] ) throws Exception {
		Scanner s=new Scanner(System.in);
	//	String hs="1817181712114";
		String hs=s.next();
		help(hs,2019);
		
}


} 


Compiler output:
Main.java:26: error: incompatible types: possible lossy conversion from long to int
			digit = (power * (s.charAt(i) - '0') + digit) % 2019;
			                                              ^
1 error
Language: Java



import java.util.*;

import java.math.*;


public class Main { 
	static long[] dp;
    static int mod=(int)1e9+7;
    public static  void help(String s, int k) {
      dp=new long[200000];
     
      fun(s);
    }
    
    
 
    static	void  fun(String s) {
		int n = s.length();

		long rem[] = new long[2019];
	
		long digit = 0, power = 1;
      ++rem[digit];
		for (int i = n - 1; i >= 0; --i) {
			digit = (power * (s.charAt(i) - '0') + digit) % 2019;
			power = (power * 10);
			++rem[digit];

		}
		
		long ans = 0;
		for (int i = 0; i < 2019; ++i) {
			if (rem[i] > 0) {
				ans += (rem[i] * (rem[i] - 1)) / 2;
			}
		}
		System.out.println(ans);
	}

   
	    
	public static void main(String args[] ) throws Exception {
		Scanner s=new Scanner(System.in);
	//	String hs="1817181712114";
		String hs=s.next();
		help(hs,2019);
		
}


} 


Compiler output:
Main.java:25: error: incompatible types: possible lossy conversion from long to int
      ++rem[digit];
            ^
Main.java:29: error: incompatible types: possible lossy conversion from long to int
			++rem[digit];
			      ^
2 errors
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)-'0';
     else
     a[i]=(a[i+1]+(s.at(i)-'0')*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:47: 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)-'0')*pow(10,k-1-i))%mod;
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
      |                  |                             |
      |                  |                             const int
      |                  __gnu_cxx::__promote<double>::__type {aka double}
Language: C

#include <bits/stdc++.h>
#define ll long long
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end))) // rep(i, 1, 5) --> {1,2,3,4} // rep(i, 5, 1) --> {4,3,2,1} // rep(it, end(v), begin(v)) --> *it

using namespace std;

int main()
{
    string s;
    cin >> s;
    ll n = s.size();
    vector<ll> dp(n);
    map<ll, ll> mp;
    dp[n-1] = s[n-1] - '0';
    ll ten = 10;
    mp[0] = 1;
    rep(i, n - 1 , 0) // n-2 -> 0
    {
        dp[i] = (dp[i+1] + (s[i] - '0') * ten) % 2019;
        ten = (ten * 10) % 2019;
        mp[dp[i]]++;
    }
    // rep(i, n, 0)
    //     cout << dp[i] << endl;
    ll ans = 0;
    for (auto x:mp)
    {
        // if (x.first == 0)
        //     ans += x.second;
        ans += x.second*(x.second-1)/2;
    }
    cout << ans;
    return 0;
}

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

/*
(1)for binary shift operator always use 'LL' 1LL<<63

*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
  
#define ordered_set_pair tree<pair<ll,ll>, null_type,less<pair<ll,ll>>, rb_tree_tag,tree_order_statistics_node_update> 
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
#define ordered_multiset tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update> 
#define Luv(...) [&] (auto &&u, auto &&v) { return __VA_ARGS__; }
  ll powe(ll a,ll b,ll c){
    if(b==0)
    return 1;
    if(b%2==0)
    {
        ll z=powe(a,b/2,c);
        return (z*z)%c;
    }
    else return ((a%c)*powe(a,b-1,c))%c;
}
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll n,p;//cin>>n>>p;
	ll i,j;
	ll sum=0;
	map<ll,ll> ma;
	string s;cin>>s;
	n=s.size();p=2019;
	
	ll prev=0;
	ma[0]=1;
	for(j=n-1;j>=0;j--){
		prev=(prev+(s[j]-'0')*powe(10,n-j-1,p))%p;
		sum+=ma[prev];
		ma[prev]++;

	}
	cout<<sum;

	return 0;
} 

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

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define BUFSIZE 100

int a=0;
char enter[BUFSIZE];
int count = 0;
long long sum = 0;

int cal(int small,int large){
/*
  a++;
  if(a == 4) return 0;
*/
  if(large == strlen(enter)){
    if(small == strlen(enter)-4){
       return 0;
    }else{
      printf("hoge");
      return 0;
      cal(small+1,samll+4);
    }
  }
  for(int i=0;i < BUFSIZE;i++){
    if(large-small-i == -1) break;
      sum += (enter[small+i]-'0')*(int)pow(10,large-small-i);

  }
  if(sum % 2019 == 0) count++;

  /*
  printf("\n\n%d\n\n",sum);
  sum = 0;
  cal(small,large+1);
  */
}

int main(void){
  scanf("%s",enter);
  cal(0,3);
  printf("%d",count);
}


Compiler output:
main.c: In function 'cal':
main.c:23:19: error: 'samll' undeclared (first use in this function); did you mean 'small'?
   23 |       cal(small+1,samll+4);
      |                   ^~~~~
      |                   small
main.c:23:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

int main()
{
	auto&& as_int = [] (char c) { return(int) c - '0'; };
	string s;
	cin >> s;
	size_t n = s.length();
	map<int, int> cnt {};
	vector<int> t(n+1, 0);
	{

		t[n] = 0;
		int factor = 1;

		for (size_t i = n; i > 0; i--)
		{
			t[i - 1] = (t[i] + as_int(s[i - 1]) * factor % 2019) % 2019;
			factor = factor * 10 % 2019;
		}
		for (size_t i = 0; i < n+1; i++)
		{
			auto&& tmp = t[i];
			for (size_t j = i; j < n ; j++)
			{
				if (tmp == t[j + 1])
				{
					cnt[tmp]++;
				}
			}
		}
	}
	int nn = 0;
	for (auto& i : cnt)
	{
		nn += i.second;
	}
	cout << nn << 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 ok() puts(ok?"Yes":"No");
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef set<int> si;
typedef map<string, int> msi;
typedef greater<int> gt;
typedef priority_queue<int, vector<int>, gt> minq;
typedef long long ll;
typedef pair<ll,ll> pll;
const ll LINF = 1e18L + 1;
const int INF = 1e9 + 1;
//clang++ -std=c++11 -stdlib=libc++ 

int main() {
  string s; cin >> s;
  reverse(s.begin(), s.end());
  int mod = 2019;
  vector<ll> prefixSum(s.length()+1);
  vector<ll> ans(mod);
  ll tot = 0, keta = 0;
  prefixSum[0] = 0;
  rep(i, s.length()) {
   int x = s[i]-'0';
    tot = (tot + x* ((ll) pow(10, keta) % mod ) % mod) % mod;
    keta++;
     prefixSum[i+1] = tot;
  }
  rep (i, s.length()+1) {
    ans[prefixSum[i]]++;
  }
  ll out = 0;
  auto comb = [] (int n) {
    if (n<=1) return 0;
    return (n-1)*n/2;
  };
  rep(i, mod ){
    out += comb(ans[i]);
  }

  cout << out << 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>
using namespace std;
int main(){
  string s;cin>>s;
  int n=s.size();
  int c=0;
  int b=1;
  int* r=new int[n+1];
  int* cc=new int[n]{};
  r[n]=0;
  for(int i=n-1;i>=0;i--){
    r[i]=(r[i+1]*b+(s[i]-'0'))%2019;
    b=b*10%2019;
    c+=cc[i];cc[r[i]]++;
  }
  cout << c << 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<iostream>
#include<string>
#include<vector>
#define MAX 200000
using namespace std;

const long long mod = 2019;
long long dp[2020];

//aC2を返す
long long choose(long long a){
    long long ans;
    ans = a*(a - 1)/2;

    return ans;
}

int main(){
    string s;
    cin >> s;
    int sl = s.size(); //sのサイズ
    //cout << sl << endl;
    //sの累積和を入れる
    vector<int> t(sl),tt(sl); //累積和
    long long ten = 1; //10の累乗
    long long ss; //s.at(i)のlong long 型

    //cout << endl;

    for(int i = sl - 1;i >= 0;i--){
        ss = (s.at(i) - '0');
        t.at(i) = (ten*ss)%mod;
        ten *= 10;
        ten = ten%mod; 
        //cout << i << ":";
        //cout << ten << " ";
        //cout << t.at(i) << endl;
    }

    //累積
    tt.at(0) = t.at(0);
   // cout << tt.at(0) << endl;
    dp[tt.at(0)]++;
    for(int i = 1;i < sl;i++){
        tt.at(i) = (tt.at(i - 1) + t.at(i))%mod;
        //cout << tt.at(i) << endl;
        dp[tt.at(i)]++;
    }

    //mod2019の値が等しいものを見つける

    long long ans = dp[0];

    for(int i = 0;i < mod;i++){
        if(dp[i] >= 2){
            ans += choose(dp[i]);
            //cout << "aaa" << endl;
        }
    }

    cout << ans << 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>
#include<map>
using namespace std;
int main()
{
	long long s;
	cin>>s;
	if(s/1000<1)
	{
		cout<<'0';
		return 0;
	}
	if(s%10000<1)
	{
		if(s%2019==0)
		cout<<'1';
		else
		cout<<'0';
		return 0;
	}
	if(s=="1817181712114")
	cout<<'3';
	if(s=="14282668646")
	cout<<'2';
	return 0;
 } 

Compiler output:
a.cc: In function 'int main()':
a.cc:21:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   21 |         if(s=="1817181712114")
      |            ~^~~~~~~~~~~~~~~~~
a.cc:23:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   23 |         if(s=="14282668646")
      |            ~^~~~~~~~~~~~~~~
Language: C

#include<bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);
#define time_taken_start int begtime = clock();
#define time_taken_end int endtime = clock(); \
cerr << "\n\n" << "Time elapsed: " << \
(endtime - begtime)*1000/CLOCKS_PER_SEC << " ms\n\n"; \
return 0;
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define mod 998244353
#define inf 1000000000000000007
#define eps 0.0000000001
#define pi acosl(-1)
#define pdd pair<ld,ld>
#define pll pair<ll,ll>
#define ff first
#define ss second
#define vpl vector<pll>
#define vll vector<ll>
#define mseti multiset <ll>
#define msetd multiset <ll,greater<ll>>
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound 
#define stp fixed<<setprecision(20)
#define endl '\n'
ll m[3000];
void solve()
{
	string s;
	cin>>s;
	ll n=s.length();
	ll p=1;
	m[0]=1;
	ll a=0;
	for(ll i=n-1;i>=0;i--)
	{
		ll x=(ll)(s[i]-'0');
		x*=p;
		a+=x;
		a%=2019;
		m[a]++;
		p*=10;
		p%=2019;
	}
	ll ans=0;
	for(ll i=0;i<2019;i++)
	{
		ans+=(m[i]*(m[i]-1))/2;
	}
	cout<<ans;
}
int main()
{
    FAST
    #ifdef ayk_16
    freopen("input.txt","rt",stdin);
    freopen("output.txt","wt",stdout);
    #endif
    ll t=1;
    //cin>>t;
    for(ll i=0;i<t;i++)
    {
        //cout<<"Case #"<<i+1<<": ";
        solve();
    }
}

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

# include <iostream>
# include <string>
# include <sstream>
typedef long long ll;
using namespace std;

int main () {
    string s;
    cin >> s;
    ll ans(0);
    ll dp[2019];
    memset(dp, 0, sizeof(dp));
    dp[s[0] - '0'] = 1;
    for (int i = 1; i < s.size(); i++) {
        int d = s[i] - '0';
        ll tdp[2019];
        memset(tdp, 0, sizeof(tdp));
        tdp[d] = 1;
        for (int j = 0; j < 2019; j++) {
            if (dp[j] > 0) {
                ll 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 << "\n";

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'memset' was not declared in this scope
   12 |     memset(dp, 0, sizeof(dp));
      |     ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | # include <sstream>
  +++ |+#include <cstring>
    4 | typedef long long ll;
Language: C

# include <iostream>
# include <string>
# include <sstream>
typedef long long ll;
using namespace std;

int main () {
    string s;
    cin >> s;
    ll ans(0);
    ll dp[2019];
    memset(dp, 0, sizeof(dp));
    dp[s[0] - '0'] = 1;
    for (int i = 1; i < s.size(); i++) {
        int d = s[i] - '0';
        ll tdp[2019];
        memset(tdp, 0, sizeof(tdp));
        tdp[d] = 1;
        for (int j = 0; j < 2019; j++) {
            if (dp[j] > 0) {
                ll 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 << "\n";

    return 0;
}

Compiler output:
main.c:1:11: 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;
  int int_S;
  string subspace_S;
  int int_sub_S;
  int size;
  int i = 0, j = 3, count = 0;
  
  cin >> S;
  int_S = atoi(S.c_str());
  size = (int)S.length();
  
  if(int_S < 2019){
  	cout << 0 << endl;	
  }else{
    for(i = 0; i < size-3; i++){
    	for(j = i+4; j <= size; j++){
        	subspace_S = S.substr(i, j-i);
        	int_sub_S = atoi(subspace_S.c_str());
          	if(int_sub_S % 2019 == 0){
              count++;
            }
        }
    }
    cout << count << endl;
  }
}


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

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef vector<long long> vi;
typedef pair<long long, long long> ii;
typedef vector<pair<long long, long long>> vii;
typedef stringstream ss;
ll mil() { return numeric_limits<long long>::min(); }
ll mal() { return numeric_limits<long long>::max(); }

#define R3(i, a, b) for (long long i = (a); i < (b); ++i)
#define R2(i, b) for (long long i = 0; i < (b); ++i)
#define R1(b) for (long long i = 0; i < (b); ++i)
#define RR(i, a, b) for (long long i = a; i > b; --i)
#define PB(x) push_back(x)
#define MP(x, y) make_pair(x, y)

#define xstr(a) ystr(a)
#define ystr(a) #a

/*void redirectInOut()
{
    ss input, output;
    input << xstr(ROOT_FOLDER) << "/input.txt";
    output << xstr(ROOT_FOLDER) << "/output.txt";

    freopen(input.str().c_str(), "r", stdin);
    freopen(output.str().c_str(), "w", stdout);
}*/

istringstream lcin;
void rl()
{
    string s;
    getline(cin, s);
    lcin = istringstream(s);
}
// build: ctrl + f9

// run: shift + f10
// debug: shift + f9
// sanitize: shift + f11

ll power(ll x, unsigned long long y, ll p)  
{  
    ll res = 1;     // Initialize result  
  
    x = x % p; // Update x if it is more than or  
                // equal to p 
   
    if (x == 0) return 0; // In case x is divisible by p; 
  
    while (y > 0)  
    {  
        // If y is odd, multiply x with result  
        if (y & 1)  
            res = (res*x) % p;  
  
        // y must be even now  
        y = y>>1; // y = y/2  
        x = (x*x) % p;  
    }  
    return res;  
}  

int main(int, char **)
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    /*//// REMOVE BEFORE SUBMIT //////
    ll warning;
    redirectInOut();
    /////////////////////*/

    string S;
    cin >> S;

    unordered_set<ll> mods;
    ll validPairs = 0;
    ll currVal = 0;
    R1(S.size()) {
        int c = stoi(S.substr(i, 1), nullptr, 0);
        currVal = (currVal%2019 + (c*power(10, S.size()-i-1, 2019)%2019));
        if(currVal%2019 == 0) 
            ++validPairs;
        else
        {
            if(mods.count(currVal%2019) > 0) {
                ++validPairs;
            }
            else {
                mods.insert(currVal%2019);
            }
        }
        
    }

    cout << validPairs << endl;%2019

}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:125:32: error: expected primary-expression before '%' token
  125 |     cout << validPairs << endl;%2019
      |                                ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef vector<long long> vi;
typedef pair<long long, long long> ii;
typedef vector<pair<long long, long long>> vii;
typedef stringstream ss;
ll mil() { return numeric_limits<long long>::min(); }
ll mal() { return numeric_limits<long long>::max(); }

#define R3(i, a, b) for (long long i = (a); i < (b); ++i)
#define R2(i, b) for (long long i = 0; i < (b); ++i)
#define R1(b) for (long long i = 0; i < (b); ++i)
#define RR(i, a, b) for (long long i = a; i > b; --i)
#define PB(x) push_back(x)
#define MP(x, y) make_pair(x, y)

#define xstr(a) ystr(a)
#define ystr(a) #a

void redirectInOut()
{
    ss input, output;
    input << xstr(ROOT_FOLDER) << "/input.txt";
    output << xstr(ROOT_FOLDER) << "/output.txt";

    freopen(input.str().c_str(), "r", stdin);
    freopen(output.str().c_str(), "w", stdout);
}

istringstream lcin;
void rl()
{
    string s;
    getline(cin, s);
    lcin = istringstream(s);
}
// build: ctrl + f9

// run: shift + f10
// debug: shift + f9
// sanitize: shift + f11

ll power(ll x, unsigned long long y, ll p)  
{  
    ll res = 1;     // Initialize result  
  
    x = x % p; // Update x if it is more than or  
                // equal to p 
   
    if (x == 0) return 0; // In case x is divisible by p; 
  
    while (y > 0)  
    {  
        // If y is odd, multiply x with result  
        if (y & 1)  
            res = (res*x) % p;  
  
        // y must be even now  
        y = y>>1; // y = y/2  
        x = (x*x) % p;  
    }  
    return res;  
}  

int main(int, char **)
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    /*//// REMOVE BEFORE SUBMIT //////
    ll warning;
    redirectInOut();
    /////////////////////*/

    string S;
    cin >> S;

    unordered_set<ll> mods;
    ll validPairs = 0;
    ll currVal = 0;
    R1(S.size()) {
        int c = stoi(S.substr(i, 1), nullptr, 0);
        currVal = (currVal%2019 + (c*power(10, S.size()-i-1, 2019)%2019));
        if(currVal%2019 == 0) 
            ++validPairs;
        else
        {
            if(mods.count(currVal%2019) > 0) {
                ++validPairs;
            }
            else {
                mods.insert(currVal%2019);
            }
        }
        
    }

    cout << validPairs << endl;%2019

}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:125:32: error: expected primary-expression before '%' token
  125 |     cout << validPairs << endl;%2019
      |                                ^
Language: C

#define _USE_MATH_DEFINES
#include <math.h>
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#include <numeric>
#include <stdio.h>
#include <vector>

using namespace std;
typedef long long ll;

#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

ll modpow(ll a,ll n,ll m) {
    if(n==1) return a%m;
    if(n%2==1) return (a*modpow(a,n-1,m))%m;
    ll b = modpow(a,n/2,m)%m;
    return (b*b)%m;
}

int main() {

    ll mod = 2019;
    string S;
    cin >> S;
    ll N = S.length();
    ll A[N];
    rep(i,N){
        if(i==0) A[N-1] = S[N-1]-48;
        else A[N-1-i] = ((ll(S[N-1-i])-48)*modpow(10,i,mod))%mod;
    }
    ll B[N];
    rep(i,N){
        if(i==0) B[N-1] = ll(S[N-1])-48;
        else B[N-1-i] = (B[N-i]+A[N-1-i])%mod;
    }
    sort(B,B+N);
    ll out = 0;
    ll cnt = 0;
    rep(i,N-1){
        if(B[i]==0) out++;
        else{
            if(B[i]==B[i+1]) cnt++;
            else if(cnt>0){
                out += cnt*(cnt+1)/2;
                cnt = 0;
            }
            if(i==N-2&&cnt>0) out += cnt*(cnt+1)/2;
        }
    }
    cout << out << 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>
#define pb push_back
#define sz(a) a.size()
#define re return
#define all(a) a.begin(),a.end()
#define int long long
using namespace std;
int a[200005];
int mp[2100];
signed main()
{
	string s;
	cin>>s;
	reverse(s.begin(),s.end());
	int y=1;
	for (int i=0;i<sz(s);i++){
		a[i]=(y*(s[i]-'0'))%2019;
		y=(y*10)%2019;
	}
	y=0;
	for (int i=0;i<sz(s);i++){
		y=(y+a[i])%2019;
		mp[y]++;
	}
	int ans=0;
	for (int i=0;i<2019;i++)
		ans=ans+mp[i]*(mp[i]-1)/2;
	ans+=mp[0];
	cout<<ans;
	re 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

//----AUTHOR:kkdrummer----/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef    long long   ll;
typedef    long double   ld;
//typedef    unordered_set<ll>   usll;
//typedef    unordered_multiset<ll>   umsll;
typedef    multiset<ll>   msll;
typedef    set<ll>   sll;
typedef    vector<ll>   vll;
typedef    pair<ll,ll>   pll;
typedef    vector<pll>   vpll;
typedef    priority_queue<ll>   pqll;
typedef    vector<int>   vi;
typedef    set<int>   si;
typedef    multiset<int>   msi;
//typedef    unordered_multiset<int>   umsi;
//typedef    unordered_set<int>   usi;
typedef     pair<int,int>   pi;
typedef    vector<pi>   vpi;
typedef    set<pi>   spi;
typedef    priority_queue<int>   pqi;
typedef    tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>   ind_set;
typedef    tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>   ind_setll;
#define    in   insert
#define    fi   first
#define    se   second
#define    pb   push_back
#define    mp   make_pair
#define    be   begin
#define    en   end
#define    itr   iterator
#define io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define    mo   2019
#define    inf  9223372036854775807
#define    ninf   -inf
#define    ima   2147483647
#define    imi   -ima
#define    oncnt    __builtin_popcount
#define    zerobegin   __builtin_clz
#define    zeroend   __builtin_ctz
#define    parity   __builtin_parity
#define    all(x)   x.be(),x.en()
#define    eps   1e-9
#define    coutd   cout<<setprecision(10)<<fixed
#define    mems(dp,x)   memset(dp,x,sizeof(dp))
const    ld   PI=3.1415926535897932384626433832792884197169399375105820974944;
inline ll modpow(ll x,ll n){if(n==0)return 1;if(n==1)return(x%mo);ll u=(modpow(x,n/2));u=(u*u)%mo;if(n%2!=0)u=(u*x%mo)%mo;return u;}
inline ll modinv(ll x){return modpow(x,mo-2);}
inline ll mmul(ll a,ll b){    if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;if(a*b>=mo)return(a*b)%mo;return(a*b);}
inline ll madd(ll a, ll b){if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;if(a+b>=mo)return(a+b)%mo;return(a+b);}
inline ll msub(ll a, ll b){if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;return(((a-b)%mo+mo)%mo);}
inline ll mdiv(ll a,ll bb){if(a>=mo)a=a%mo;ll b=modinv(bb);if(b>=mo)b=b%mo;if(a*b>=mo)return(a*b)%mo;return(a*b);}
inline ll gcd(ll a,ll b){return __gcd(a,b);}
inline int lcm(int a,int b){return ((a*b)/gcd(a,b));}



int main()
{
io
int testcases=1;//cin>>testcases;
while(testcases--)
{

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


ll pro=1;
ll cur=0;
ll dp[2019]={0};
dp[cur]++;
for(int i=0;i<n;i++)
{
	ll ne=s[n-i-1]-'0';
	cur=(cur+(pro*ne))%2019;
	pro=mmul(pro,10);
	dp[cur]++;
}



ll ans=0;

for(int i=0;i<2019;i++)
{ll m=dp[i];
	ans+=((m*(m-1))/2);
}


cout<<ans;






}return 0;}

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

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

int main(){
    string s;
    string part;
    cin >> s;
    long long nagasa,ans,start;
    ans = 0;
    int temp1,ans;
    ans = 0;
    nagasa = s.length();
    int mod[nagasa];
    for(int i = 0;i < nagasa; i++){
        mod[nagasa] = 0;
    }
    for(int i = 0;i < nagasa; i++){
        temp1 = (temp1 + pow(10,nagasa-i)) % 2019;
        mod[temp1-1]+=1
    }
    for(int i = 0; i < nagasa; i++){
        ans += mod[i] * (mod[i]-1) / 2;
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: conflicting declaration 'int ans'
   10 |     int temp1,ans;
      |               ^~~
a.cc:8:22: note: previous declaration as 'long long int ans'
    8 |     long long nagasa,ans,start;
      |                      ^~~
a.cc:18:44: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
   18 |         temp1 = (temp1 + pow(10,nagasa-i)) % 2019;
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~
      |                        |                     |
      |                        |                     int
      |                        __gnu_cxx::__promote<double>::__type {aka double}
a.cc:19:24: error: expected ';' before '}' token
   19 |         mod[temp1-1]+=1
      |                        ^
      |                        ;
   20 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll INF = 100000000;
#define rep1(i, n) for (ll i=0; i<(n); i++) 
#define rep2(i, k, n) for (ll i=k; i<(n); i++)

//累積和的なものを考えると良いらしい
int main() {
    string s;
    cin >> s;
    ll n = s.size();
    vector<ll> a(2019, 0);
    ll fac = 1;
    ll cur = 0;
    a[cur]++;
    rep1(i, n){
        ll add = s[n-1-i] - '0';
        cur = (cur + fac*add) % 2019;
        fac = (fac*10) % 2019;
        a[cur]++;
    }
    ll ans = 0;
    rep(i, n){
        ans += a[i]*(a[i]-1)/2;
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:9: error: 'i' was not declared in this scope
   25 |     rep(i, n){
      |         ^
a.cc:25:5: error: 'rep' was not declared in this scope; did you mean 'rep1'?
   25 |     rep(i, n){
      |     ^~~
      |     rep1
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args) throws IOException{
    //Scanner sc = new Scanner(System.in);
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String s = br.readLine();
    char[] arr = s.toCharArray();
    int[] vec = new int[2019];
    int[] temp;
    vec[arr[0]-'0']=1;
    int count =0;
    //System.out.println("anuj"+vec[1]);
    for(int i=1;i<s.length();i++){
      temp = new int[2019];
      for(int j=0;j<2019;j++){
        if(vec[j]>0){
          //System.out.println("j "+j);
          int num = (j*10+arr[i]-'0')%2019;
          //System.out.println(num);
          temp[num]=vec[j];
        }
      }
      temp[arr[i]-'0']++;
      vec=temp;
      count+=vec[0];
    }
    System.out.println(count);
  }
}

Compiler output:
Main.java:3: error: cannot find symbol
  public static void main(String[] args) throws IOException{
                                                ^
  symbol:   class IOException
  location: class Main
Main.java:5: error: cannot find symbol
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    ^
  symbol:   class BufferedReader
  location: class Main
Main.java:5: error: cannot find symbol
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
                            ^
  symbol:   class BufferedReader
  location: class Main
Main.java:5: error: cannot find symbol
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
                                               ^
  symbol:   class InputStreamReader
  location: class Main
4 errors
Language: C

#include <math.h>
#include <assert.h>
#include <algorithm>
#include <set>
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <string>
#include <cstring>
#include <functional>
#include <stack>
#include <array>
#include <random>
#include <chrono>
#include <climits>
#include <bitset>
using namespace std ;
#define ld long double
#define int long long
#define ii pair<int,int>
#define FAST_IO ios_base::sync_with_stdio(false) ;cin.tie(NULL);cout.tie(NULL); clock_t beg = clock()
#define dbg(x) cerr << #x << " is " << x << endl;
#define ms(x,a) memset(x,(int)(a),sizeof(x))
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define vi vector<int >
#define pb push_back
#define endl '\n'
#define ff first
#define ss second
//const int N = 3e5+7 ;
//const int INF = 1e18 ;
//const int MOD = 1e9 + 7 ;
vector<int> fact;
vector<int> ifact;
vector<int> inv;
vector<int> pow2;
const int MOD = 2019;
int add(int a, int b)
{
    a+=b;
    while(a>=MOD) a-=MOD;
    return a;
}
void radd(int &a, int b)
{
    a=add(a,b); 
}
int mult(int a, int b)
{
    return (a*1LL*b)%MOD;
}
void rmult(int &a, int b)
{
    a=mult(a,b);
}
int modpow(int a, int b)
{
    int r=1;
    while(b)
    {
        if(b&1) r=mult(r,a);
        a=mult(a,a);
        b>>=1;
    }
    return r;
}
int choose(int a, int b)
{
    if(a<0||b<0) return 0;
    if(a<b) return 0;
    if(b==0) return 1;
    if(a==b) return 1;
    return mult(fact[a],mult(ifact[b],ifact[a-b]));
}
int inverse(int a)
{
    return modpow(a,MOD-2);
}
void init(int _n)
{
    fact.clear(); ifact.clear(); inv.clear(); pow2.clear();
    fact.resize(_n+1);
    ifact.resize(_n+1);
    inv.resize(_n+1);
    pow2.resize(_n+1);
    pow2[0]=1;
    ifact[0]=1;
    fact[0]=1;
    for(int i=1;i<=_n;i++)
    {
        pow2[i]=add(pow2[i-1],pow2[i-1]);
        fact[i]=mult(fact[i-1],i);
        //ifact[i]=mult(ifact[i-1],inv[i]);
    }
    ifact[_n] = inverse(fact[_n]);
    for(int i=_n-1;i>=1;i--)
    {
        ifact[i] = mult(ifact[i + 1], i + 1);
    }
    for(int i=1;i<=_n;i++)
    {
        inv[i] = mult(fact[i-1],ifact[i]);
    }
}


void solve(){
    string s ;
    cin >> s ;
    int n = sz(s) ;
    map<int,vi> mp ;
    mp[0].push_back(-1) ;
    reverse(all(s)) ;
    int rem = 0 ;
    for(int i = 0 ; i < n ; i++){
        int cur = add(mult(s[i]-'0', modpow(10, i)),rem) ;
        rem = cur ;
        mp[cur].pb(i) ;
    }
    int ans = 0 ;
    for(int i = 0 ; i <= 2019 ; i++){
        ans += sz(mp[i])*(sz(mp[i])-1)/2 ;
    }
    cout << ans ;
}

int32_t main(){
    FAST_IO ;
    int t = 1 ;
//    cin >> t ;
    while(t--){
        solve() ;
    }
    cerr << "\nExecution time: " << (clock() - beg) / 1000 << '\n';
}


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

#include <bits/stdc++.h>
#define rep(i,a,b) for(ll i=ll(a);i<ll(b);i++)
#define irep(i,a,b) for(ll i=ll(a);i>=ll(b);i--)
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; }
#define pb push_back
#define mp make_pair
#define F .first
#define S .second 
using ll=long long;
using ld=long double;
const ll INF = 1LL<<60;
const ll mod=1e9+7;
using namespace std;
ll GCD(ll a, ll b) { return b ? GCD(b, a%b) : a; }
ll x10(ll b,ll k){
    if(k==0)return b;
    else {
        b*=10;
        b%=2019;
        b=x10(b,k-1);
    }
}
ll dp[220000];
map<ll,ll> p;
int main(){
    ll cnt,ans=0;
    string s,t;
    cin>>s;
    long sl=s.length();
    t=s[sl-1];
    dp[0]=stoll(t)%2019;
    rep(i,1,sl+1){
        ll y=s[sl-i-1]-'0';
        dp[i]=(dp[i-1]+x10(y,i))%2019;
    }
    rep(i,0,sl+1)p[dp[i]]++;  
    for(map<ll,ll>::iterator it=p.begin();it!=p.end();it++){
    ll ff=it->second;
    ans+=ff*(ff-1)/2;
    if(it->first==0)ans+=ff;
    }
    cout<<ans;
}

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

#include<bits/stdc++.h>
const int mod=1e9+7;
typedef long long ll;
const int N=2e5+5;
std::set<std::string> s;
int main()
{
	std::ios::sync_with_stdio(false);std::cin.tie(0);std::cout.tie(0);
	// freopen("a.in","r",stdin);
	// int T;scanf("%d",&T);while(T--){
	std::string s;std::cin>>s;
	int ans = 0;
	std::map<int,int>mp;
	int cnt = 0;
	mp[0] = 1;
	int bas = 1;
	for(int i = s.size() - 1; i >= 0; i--){
		ans = (ans + ll(s[i] - '0') * bas)%2019;
		cnt += mp[ans]++;
		bas = bas * 10 % 2019;
	}
	std::cout<<cnt<<endl;
	// }
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:25: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   22 |         std::cout<<cnt<<endl;
      |                         ^~~~
      |                         std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define FOR(i, a, b) for(ll i = (ll)a; i <= (ll)b; i++)
#define DEC(i, a, b) for(ll i = (ll)a; i >= (ll)b; i--)
typedef pair<ll, ll> pi;
#define f first
#define s second
#define pb push_back
#define all(v) v.begin(), v.end()
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

string s;
ll ans, n, t, rem[2020], mul = 1;

int main() {
	fastio; cin >> s;
	n = s.length(); s = " " + s;
	rem[0] = 1; t = 0;
	DEC(i, n, 1) {
		t = (t + mul*(s[i]-'0')) % 2019;
		ans += (rem[t] * (rem[t]+1))/2;
		rem[t]++; mul = (10*mul) % 2019;
	}
	cout << ans;
}

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

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define sz(x) (int)x.size()
#define int long long
typedef pair<int,int>pii;
const int mxN=2e5,M=1e9+7;
string s;
int n,ans,tot;
map<int,int>mp;
// LONG LONG CASE
int32_t main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin>>s;
    n=s.size();
    mp[0]=1;
    int pot=1LL;    
    for(int i=n-1;i>=0;i--){
        tot=tot+(s[i]-'0')*pot;
        tot=tot%2019;
        ans+=mp[tot];
        mp[tot]++;
        pot*=10LL;
        pot=pot%2019;
    }
    cout<

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:28:10: error: expected primary-expression at end of input
   28 |     cout<
      |          ^
a.cc:28:10: error: expected '}' at end of input
a.cc:13:15: note: to match this '{'
   13 | int32_t main(){
      |               ^
Language: C

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

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	string s;cin>>s;
	reverse(s.begin(), s.end());
	int n = s.size();
	int pref[n], mod = 2019, ten = 1;
	pref[0] = s[0] - '0';
	map<int, int> mp;
	mp[0] = 1;
	mp[pref[0]] = 1;
	for(int i = 1; i < n; ++i){
		ten*=10;
		ten%=mod;
		pref[i] = pref[i-1] + ten*(s[i]-'0');
		pref[i] %= mod;
		mp[pref[i]]++;
	}
	int cnt = 0;
	for(auto x : mp){
		cnt += (x.second-1)*x.second/2;
	}
	cout<<cnt<<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.