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

// atcoder/abc164/D/main2.cpp
// author: @___Johniel
// github: https://github.com/johniel/

#include <bits/stdc++.h>

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," << p.second << ")"; return os; }
template<typename P, typename Q> istream& operator >> (istream& is, pair<P, Q>& p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; for (auto& i: v) os << i << ","; os << ")"; return os; }
template<typename T> istream& operator >> (istream& is, vector<T>& v) { for (auto& i: v) is >> i; return is; }
template<typename T> ostream& operator << (ostream& os, set<T> s) { os << "#{"; for (auto& i: s) os << i << ","; os << "}"; return os; }
template<typename K, typename V> ostream& operator << (ostream& os, map<K, V> m) { os << "{"; for (auto& i: m) os << i << ","; os << "}"; return os; }

template<typename T> inline T setmax(T& a, T b) { return a = std::max(a, b); }
template<typename T> inline T setmin(T& a, T b) { return a = std::min(a, b); }

using lli = long long int;
using ull = unsigned long long;
using point = complex<double>;
using str = string;
template<typename T> using vec = vector<T>;

constexpr array<int, 8> di({0, 1, -1, 0, 1, -1, 1, -1});
constexpr array<int, 8> dj({1, 0, 0, -1, 1, -1, -1, 1});
constexpr lli mod = 1e9 + 7;

int main(int argc, char *argv[])
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.setf(ios_base::fixed);
  cout.precision(15);

  str s;
  while (cin >> s) {
    map<int, lli> m;
    int x = 0;
    each (c, s) {
      x = (x * 10 + (c - '0')) % 2019;
      ++m[x];
    }

    lli y = 0;
    each (i, m) y += i.second * (i.second - 1) / 2;
    cout << y << endl;
  }

  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<bits/stdc++.h>
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<vector>
#include<set>
#include<iostream>
#define pb push_back
#define fi first
#define se second
#define sz(x)  x.size()
#define cl(x)  x.clear()
#define all(x)  x.begin() , x.end()
#define r(x)  scanf("%d", &x)
#define rr(x , y)  scanf("%d%d" , &x , &y)
#define rst(s)  scanf("%s" , s)
#define rl(x)  scanf("%lld" , &x)
#define rrl(x , y)  scanf("%lld%lld" , &x , &y)
#define w(x)  printf("%d" , x)
#define ww(x , y)  printf("%d %d" , x , y)
#define wl(x)  printf("%lld" , x)
#define wwl(x , y)  printf("%lld %lld" , x , y)
#define sp()  printf(" ")
#define en()  puts("")
#define rep(i , x , n)  for(int i = x ; i <= n ; i ++)
#define per(i , n , x)  for(int i = n ; i >= x ; i --)
#define mem0(x)  memset(x , 0 , sizeof(x))
#define mem_1(x)  memset(x , -1 , sizeof(x))
#define mem_inf(x)  memset(x , inf , sizeof(x))
#define mem__inf(x)  memset(x , -inf , sizeof(x))
#define p_queue priority_queue
#define debug(x)  cout << '*' << x << '\n'
#define ddebug(x , y)  cout << '*' << x << ' ' << y << '\n'
#define ios std::ios::sync_with_stdio(false) , cin.tie(0)
using namespace std ;
//mt19937  rnd(chrono::high_resolution_clock::now().time_since_epoch().count()) ;
typedef long long ll ;
typedef unsigned long long ull ;
typedef pair<int , int> pii ;
typedef pair<ll , ll> pll ;
typedef pair<int , ll> pil ;
typedef pair<ll , int> pli ;
const int inf = 0x3f3f3f3f ;
const int maxn = 2e5 + 5 ;
const int maxm = 30 ;
const double eps = 1e-6 ;
int n ;
char s[maxn] ;
int num[3005] ;
int main()
{
	rst(s + 1) ;
	n = strlen(s + 1) ;
	int now = 0 ;
	int base = 1 ;
	mem0(num) ;
	num[0] ++ ;
	rep(i , n , 1)
	{
		now = (now + s[i] - '0' * base) % 2019 ;
		base *= 10 ;
		base %= 2019 ;
		num[now] ++ ;
	}
	ll ans = 0 ;
	rep(i , 0 , 2018)  ans += ll(num[i]) * (num[i] - 1) / 2 ;
	wl(ans) , en() ;
	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;
using vi = vector<int>;
using vb = vector<bool>;
using vl = vector<long>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvb = vector<vector<bool>>;
using vvc = vector<vector<char>>;
using pii = pair<int, int>;
using pil = pair<int, long>;
using pll = pair<long, long>;
#define fix20 cout << fixed << setprecision(20)
#define YES cout << "Yes" << endl
#define NO cout << "No" << endl
#define rep(i,n) for(int i=0; i<(int)(n);i++)
#define REP(i,s,t) for(int i=s; i<t; i++)
#define RNG(i,s,t,u) for(int i=s; i<t; i+=u)
#define MOD 1000000007
#define all(vec) vec.begin(), vec.end()

int main(){
  string s;
  cin >> s;
  vector<int> cnt(2019,0);
  cnt.at(0)++;
  long res = 0;
  long keta = 1;
  for(int i=s.size()-1;i>=0;i--){
    long p = s.at(i) - '0';
    long a = p * keta + res;
    res = a%2019;
    cnt.at(res)++;
    keta *= 10;
    keta %= 2019;
  }
  long ans = 0;
  rep(i,2019){
    long t = cnt.at(i);
    ans += t*(t-1)/2;
  }
  cout << ans << endl;
}

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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (ll i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define m1(x) memset(x,-1,sizeof(x))
const int INF = 1e9;
const ll MOD = 1e9 + 7;
const double PI = 3.141592653589;

int main(){
  string s;
  cin >> s;
  int ans=0;
  int c[200000];
  rep(i, s.size()){
    c[i] = s.at(i) - '0';
    if(c[i]==0) ans++;
  }
  int a = s.size();
  int dp[2][2019];
  dp[0][c[0]]++;
  
  for(int i = 1; i < a; i++){
    if(c[i] == 0){
       for(int j = 0; j<2019; j++){
         dp[1][(10*j + c[i]) % 2019] = dp[0][j];
       }
      for(int j = 0; j < 2019; j++){
        dp[0][j] = dp[1][j];
      }
      continue;
    }else{
       for(int j = 0; j<2019; j++){
         dp[1][(10*j + c[i]) % 2019] = (10*j + c[i])%2019==c[i] ? dp[0][j]+1: dp[0][j];
       }
      for(int j = 0; j < 2019; j++){
        dp[0][j] = dp[1][j];
      }
    }
    ans+=dp[0][0];
  }
  cout<<ans<<endl;
}

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

import java.math.BigInteger;
import java.util.Scanner;

public class Main 
{
	static int mod(int x)
	{
		int an = x%2019;
		while(an<0)an+=2019;
		return an;
	}

	public static void main(String[] args) 
	{
		BigInteger bi = new BigInteger("10");
		int x = 141;
//		System.out.println("test: " + mod(10*202));
		
		int inverse = 202;
		int goback = 1;
		
		System.out.println(bi);
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		
		int n = s.length();
		int[] a = new int[n];
		
		int target = 0;
		
		for(int i = 0; i < n; i++)
		{
			a[i] = s.charAt(i) - '0';
		}
		
		int[] avail = new int[2019];
		int suffix = 0;
		int digitval = 1;
		
		int cur = 0;
		
		int backtransmul = 1;
		int backtransadd = 0;
		int score = 0;
//		int digsz = 1;
		int curval = 0;
		for(int i = 0; i < n; i++)
		{
			curval = mod(curval*10 + a[i]);
			
//			System.out.println("curval " + curval);
//			int cura = mod((a[i] * backtransmul) - backtransadd);
			int cura = mod((0 * backtransmul) - backtransadd);
			avail[cura]++;
//			System.out.println("cura " + cura);
			
			int curb = mod((0 * backtransmul) - backtransadd);
//			System.out.println("curb " + curb + " " + avail[curb]);
			
//			if(i>0)
			{
				backtransmul = mod(backtransmul*202);
//				backtransadd = mod(backtransadd*202    + a[i] * 202);
				backtransadd = mod(backtransadd + backtransmul*a[i]);
			}
//			digsz = mod(digsz*202);
//			System.out.println("trans x" + backtransmul + " " + " - " + backtransadd);
			
			{
				int curc = mod((0 * backtransmul) - backtransadd);
//				System.out.println("curc " + curc + " " + avail[curc] + "\n");
				score += avail[curc];
			}
		}
		
		System.out.println(score);
	}

}


Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.math.BigInteger;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.math.BigInteger;
      |            ^
main.c:2:1: error: unknown type name 'import'
    2 | import java.util.Scanner;
      | ^~~~~~
main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | import java.util.Scanner;
      |            ^
main.c:4:1: error: unknown type name 'public'
    4 | public class Main
      | ^~~~~~
main.c:4:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    4 | public class 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 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}
int main() {
   string s;
   cin>>s ;
   ll k= s.size() ;
   vector<ll> a(k) ;
   for(ll i=k-1;i>=0;i--){
     if(i==k-1)
     a[i]=s.at(i);
     else
     a[i]=(a[i+1]+s.at(i)*pow(10,k-1-i))%2019;  
   }
   vector<ll> b(2019) ;
   rep(i,2019) b[i]=0 ;
    rep(i,k){
    rep(j,2019) {
       if( d[i]==j )
       b[j] ++ ;
    }
}
  ll ans=0 ;
  rep(j,2019) 
  ans+= b[j]*(b[j]-1) /2 ;
   
   cout<<ans <<endl;
    return 0;
}




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

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define P pair<int,int>
#define PI 3.141592653589793
const int INF = 1000000;

int main() {
	string S;
	cin >> S;
	int N = S.size();
	vector<int> mod(N),d(N);
	rep(i, N) {
		if (i == 0) {
			d[i] = 1;
			continue;
		}
		d[i] = 10 * d[i - 1];
		d[i] %= 2019;
	}
	rep(i, N) {
		int a = S.at(N - 1 - i) - '0';
		if (i == 0) {
			mod[i] = a;
			//cout << mod[i] << endl;
			continue;
		}
		mod[i] = (a * d[i]) % 2019 + mod[i-1];
		mod[i] %= 2019;
		//cout << mod[i] << endl;
	}
	vector<int> cnt(2019);
	cnt[0]++;
	rep(i, N) {
		cnt[mod[i]]++;
	}
	ll ans = 0;
	rep(i, 2019) {
			ans += cnt[i] * (cnt[i] - 1) / 2;
	}
	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;

int main(){
  string str; cin >> str;
  string zero = "00000"; str = zero + str;
  int a[110];
  int dp[110] = {0};
  int sum = 0;
  for (int i = 0; i < 100; i++){
    a[i] = (2019 * i) % 100;
  }
  for (int k = str.size() - 8; k >= 0; k--){
    string s = str.substr(k, 8);
    int res = stoi(s);
    for (int i = 0; i < 100; i++){
      if ((res % 100) != a[i]) continue;
      for (int j = 0; j < 100; j++){
        if ((res - (j * 100 + i) * 2019) < 0) break;
        if ((res - (j * 100 + i) * 2019) % 10000 == 0) {
          int cnt; bool flag = false;
          if ((res % 10000) == (j * 100 + i) * 2019) {
            cnt = 4; flag = true;
          }
          if ((res % 100000) == (j * 100 + i) * 2019) {
            cnt = 5; flag = true;
          }
          if ((res % 1000000) == (j * 100 + i) * 2019) {
            cnt = 6; flag = true;
          }
          if ((res % 10000000) == (j * 100 + i) * 2019) {
            cnt = 7; flag = true;
          }
          if ((res % 100000000) == (j * 100 + i) * 2019) {
            cnt = 8; flag = true;
          }
          if (flag) dp[k + 8 - cnt - 1] = dp[k + 7] + 1;
        }
      }
    }
  }
  int p = str.size()
  for (int i = 0; i < p; i++) sum += dp[i];
  cout << sum << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:3: error: expected ',' or ';' before 'for'
   43 |   for (int i = 0; i < p; i++) sum += dp[i];
      |   ^~~
a.cc:43:19: error: 'i' was not declared in this scope
   43 |   for (int i = 0; i < p; i++) sum += dp[i];
      |                   ^
Language: C

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define P pair<int,int>
#define PI 3.141592653589793
const int INF = 1000000;

int main() {
	string S;
	cin >> S;
	int N = S.size();
	vector<int> mod(N),d(N);
	rep(i, N) {
		if (i == 0) {
			d[i] = 1;
			continue;
		}
		d[i] = 10 * d[i - 1];
		d[i] %= 2019;
	}
	rep(i, N) {
		int a = S.at(N - 1 - i) - '0';
		if (i == 0) {
			mod[i] = a;
			cout << mod[i] << endl;
			continue;
		}
		mod[i] = (a * d[i]) % 2019 + mod[i-1];
		mod[i] %= 2019;
		cout << mod[i] << endl;
	}
	vector<int> cnt(2019);
	cnt[0]++;
	rep(i, N) {
		cnt[mod[i]]++;
	}
	ll ans = 0;
	rep(i, 2019) {
			ans += cnt[i] * (cnt[i] - 1) / 2;
	}
	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;
 
 
int main(){
  string S;
  vector<int> vec(0);
  long cnt = 0;
  
  cin >> S;
  for(int i=0;i<S.size();++i){
    if(S.at(i)=='1' || S.at(i)=='2' || S.at(i)== '4' || S.at(i) == '6' || S.at(i) == '8'){
      vec.push_back(i);
    }
  }
  
 
  
  for(int i=0;i<vec.size();++i){
    for(int j=3;j<S.size()-vec.at(i);++j){
      string str;
      for(int k=0;k<=j;++k){
        str.push_back(S.at(vec.at(i)+k));
      }
      long t = stol(str);
      if(t % 2019 == 0){
        cnt += 1;
      }
    }
  }
 
  cout << cnt << endl;
}
#include <bits/stdc++.h>
using namespace std;


int main(){
  string S;
  vector<int> vec(0);
  long cnt = 0;
  
  cin >> S;
  for(int i=0;i<S.size();++i){
    if(S.at(i)=='1' || S.at(i)=='2' || S.at(i)== '4' || S.at(i) == '6' || S.at(i) == '8'){
      vec.push_back(i);
    }
  }
  
 
  
  for(int i=0;i<vec.size();++i){
    for(int j=3;j<S.size()-vec.at(i);++j){
      string str;
      for(int k=0;k<=j;++k){
        str.push_back(S.at(vec.at(i)+k));
      }
      long t = stol(str);
      if(t % 2019 == 0){
        cnt += 1;
      }
    }
  }

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

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

#include<algorithm>
#include<cmath>
#include<cstdio>
#include<functional>
#include<iomanip>
#include<iostream>
#include<numeric>
#include<math.h>
#include<map>
#include<queue>
#include<set>
#include<string>
#include<utility>
#include<vector>
// 追加１
#include <fstream>



using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll mod = 2019;
#define rep(i,n) for(int i=0;i<n;i++)
#define repl(i,s,e) for(int i=s;i<e;i++)
#define reple(i,s,e) for(int i=s;i<=e;i++)
#define revrep(i,n) for(int i=n-1;i>=0;i--)
#define all(x) (x).begin(),(x).end()


ll pmod(ll n, ll p) {
    ll m = n % mod;
    if (p == 0) return 1;
    ll rtn = pmod((m * m) % mod, p / 2) % mod;
    if (p % 2 == 1) rtn = rtn * m % mod;
    return rtn;
}

ll modinv(ll n) {
    return pmod(n, mod - 2);
}

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

    vector<int> X(S.size() + 1, 0);

    int tmp = 1;

    for(int i = S.size() - 1;i >= 0;i--)
    {
        int a = S[i] - '0';
        X[i] = (a * tmp + X[i + 1]) % mod;
        tmp *= 10;
        tmp %= mod;
    }

    vector<vector<int>> R(2019, vector<int>());

    rep(i, S.size())
    {
        R[X[i]].push_back(i);
    }

    ll count = 0;

    rep(i, S.size())
    {
        int idx = S.size() - i;

        int m = 0;
        if (idx < S.size()) m = X[idx];

        auto iter = lower_bound(all(R[m]), idx);

        count += distance(R[m].begin(), iter);
    }

    cout << count << endl;

    return 0;
}

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

g=[x=a=-1]*M=2019
t = 0
gets.bytes do
  x-=g[a%M]+=1
  t = t*202%M
  a+=_1%48*t
end
p~x

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | g=[x=a=-1]*M=2019
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'g' [-Wimplicit-int]
main.c:1:3: error: expected expression before '[' token
    1 | g=[x=a=-1]*M=2019
      |   ^
main.c:1:4: error: 'x' undeclared here (not in a function)
    1 | g=[x=a=-1]*M=2019
      |    ^
main.c:1:6: error: 'a' undeclared here (not in a function)
    1 | g=[x=a=-1]*M=2019
      |      ^
Language: C

#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <algorithm>
#include <iomanip>
#include <math.h>
#include <string.h>
#include <cstdio>
#include <tuple>
using namespace std; using ll = long long; using pll = pair<ll, ll>;
using vl = vector<ll>; using vll = vector<vl>; using vpll = vector<pll>;
//**デバッグ準備**//
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
void debug_out() { cerr << endl; }
template<typename Head, typename... Tail>
void debug_out(Head h, Tail... t) {
	cerr << " " << h;
	if (sizeof...(t) > 0) cerr << " :";
	debug_out(t...);
}
template <typename T>
ostream& operator<<(ostream& os, vector<T> vec) {
	for (size_t i = 0; i < vec.size(); i++)os << vec[i] << (i + 1 == vec.size() ? "" : " ");
	return os;
}
ll ctoi(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;
	}
}
bool pairCompare(const pll firstElof, pll secondElof)
{
	return firstElof.first > secondElof.first;
}
//**Snippetリスト**//
//rep, vin, all, iteLoop//
//bitSearch, bitList, gcdlcm, isPrime, primeFactorize, Npow, divisor, modinv, dfs, bfs, eratos//
//dijkstra, WarshallFloyd, BellmanFord, UnionFind, COM, digitDP ,RMQ//
ll i, j, k, l; ll N, M, K, H, W, L, X, Y, Z, R;
ll MOD = 1000000007; ll INF = 1LL << 62; ll ans = 0; ll z = 0, o = 1;
vl flag, color, D; vll path;
ll Npow(ll x, ll n) {
	if (n == 0) return 1;
	if (n % 2 == 0) return Npow(x * x % 2019, n / 2);
	else return x * Npow(x, n - 1) % 2019;
}
int main() {
	string S;
	cin >> S;
	N = S.length();
	vl T(N+1);
	vl P(2019);
	T[N] = 0;
	P[T[N]]++;
	ll c = 0;
	for (i = N-1; i >= 0; i--) {
		T[i] = (T[i + 1] +ctoi(S[i])*Npow(10,c)) % 2019;
		P[T[i]]++;
		c++;
		//debug(i, T[i]);
	}
	for (i = 0; i < 2019; i++) {
		ans += P[i] * (P[i] - 1) / 2;
	}
	cout << ans;
}

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

#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void Main() {
    string S; cin >> S;
    ll N = S.size();

    ll MOD = 2019;

    // (i, j)が条件を満たすのは a_{j} + 10 * a_{j-1} + .... + 10^{j-i}*a_{i} が2019の倍数の時
    //　左からk+1文字目以降の整数を値とみなしたときの数字をTkとすると，(i, j)が条件を満たすのは 10^{n-j}(T_{i-1} - T_{j})が2019の倍数のとき
    // 10はmod2019で逆元が存在するので，T_{i-1} == T_{j} (mod2019)なら良い

    vector<vector<ll>> modind(MOD);
    modind.at(0).push_back(0);
    ll num = 0;
    rep(i, N){
        num += (S[N-1-i] - '0') * ((ll) pow(10, i));
        modind.at(num % 2019).push_back(i + 1);
    }
    ll ans = 0;
    rep(i, MOD){
        ll size = modind.at(i).size();
        if (size >= 2){ans += size * (size - 1) / 2;}
    }
    cout << ans << endl;
}


int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    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 ALL(a)  (a).begin(),(a).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<long long, long long> Pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
template <typename T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template <typename T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
const int INT_INF = 1 << 30;
#define MOD 1000000007LL
#define endl "\n"

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  string S;
  cin >> S;
  int N = S.size();
  vvll dp(N+1, vll(673, 0));
  ll initial = S.at(0) - '0';
  dp.at(1).at(initial) = 1;

  ll ans = 0;
  
  for(int i = 1; i < N; i++){
    ll num = S[i] - '0';
    for(int j = 0; j < 673; j++){
      if(dp[i][j] == 0) continue;
      dp[i+1][(10*j + num) % 673] += dp[i][j];
    }
    dp[i+1][num]++;
    ans += dp[i][0];
  }
  ans += dp[N][0];
  cout << ans << endl;
}


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

#include <bits/stdc++.h>
using namespace std;
int main()
{
    string str;
    cin >> str;
    int a[200001];

    int length = str.length();

    int count = 0;

    for (int i = 0; i < length - 2; i++)
    {
        int add = (int)(str[i] - '0') + (int)(str[i + 1] - '0') + (int)(str[i + 2] - '0');
        

        for (int j = i + 3; j < length; j++)
        {
            //cout << "(" << i << "," << j << ") " << str.substr(i, j - i + 1) << endl;

            add += (int)(str[j] - '0');
            //cout << "(" << i << "," << j << ") end " << endl;

            unsigned long int num = 0;
            int fin = i;

            if(add % 3 == 0){
                for (int k = fin; k <= j; k++)
                {
                    num = num * 10 + (int)(str[k] - '0');
                }
                fin = j;

                if(num % 673 == 0) count++;
                
                //cout << "(" << i << "," << j << ") " << num << endl;
            }
            //cout << "(" << i << "," << j << ") end2 " << endl;
        }
        
    }
    
    cout << count << endl;

    return 0;
}

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

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
#include <complex>
using namespace std;

typedef long long ll;
typedef uint64_t ull;
typedef pair<int, int> P;
constexpr double PI = 3.1415926535897932;   // acos(-1)
constexpr double EPS = 1e-9;
constexpr int INF = 1001001001;
constexpr int mod = 1000000007;
// constexpr int mod = 998244353;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)

ll dp[200005][2020];
constexpr int m = 2019;

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

    string s;
    cin >> s;
    int n = s.length();
    
    dp[0][0] = 1;
    ll ans = 0;
    for(int i = 0; i < n; ++i){
        int num = s[i] - '0';
        vector<ll> nextdp(m, 0);
        for(int j = 0; j < m; ++j){
            if(!dp[i][j])   continue;
            int nj = (j * 10 + num) % m;
            dp[i + 1][nj] += dp[i][j];
        }
        ans += dp[i + 1][0]++;
    }
    cout << ans << endl;
}


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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll zero = 0;
ll INF = 10000000000;
int ctoi(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;
	}
}
int main(){
    string S;
    cin >> S;
    int N;
    N = S.size();
    
    vector<int> mod10(2020); //10のi乗を2019で割ったあまり
    mod10.at(0) = 1;
    for(int i = 1; i < 2020; i++){
        mod10.at(i) = (mod10.at(i-1) * 10) % 2019;
    }
    
    vector<int> mod(N + 1); //下からi桁目までを2019で割ったあまり
    mod.at(0) = 0;
    for(int i = 1; i < N + 1; i++){
        mod.at(i) = (mod.at(i-1) + ctoi(S.at(N-i)) * mod10.at(i-1)) % 2019;
    }
    
    vector<int> count(2019,0); //配列modで中身がiなものの個数
    for(int i = 0; i < N + 1; i++){
        count.at(mod.at(i))++;
    }
    
    ll ans = 0;
    int kl = 0;
    for(int i = 0; i < 2019; i++){
        ans += count.at(i) * (count.at(i) - 1) / 2;
    }
    printf("%lld\n", 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;

using ll = long long int;

constexpr int M = 2019;

int main(){
    string s;
    cin >> s;
    int n = s.size();
    ll ans = 0, cnt[M]{};
    cnt[0] = 1;
    for(int i=n-1,r=0,d=1;i>=0;i--,d=d*10%M){
        r += (s[i]-'0')*d;
        r %= M;
        ans += cnt[r];
        cnt[r]++;
    }
    cout << ans << endl;
    return 0;
}

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

#include <bits/stdc++.h>

using namespace std;

const double PI = 3.14159265358979323846;
typedef long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
//#define rep(i, n) for (ll i = 0; i < (n); ++i)
//typedef pair<ll, ll> P;
typedef pair<ll, ll> P;
const ll INF = 10e17;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)
#define ret() return 0;

double equal(double a, double b) {
    return fabs(a - b) < DBL_EPSILON;
}

std::istream &operator>>(std::istream &in, set<string> &o) {
    string a;
    in >> a;
    o.insert(a);
    return in;
}

std::istream &operator>>(std::istream &in, queue<int> &o) {
    ll a;
    in >> a;
    o.push(a);
    return in;
}

bool contain(set<int> &s, int a) { return s.find(a) != s.end(); }

//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);
//const ll mod = 1e10;

typedef priority_queue<ll, vector<ll>, greater<ll> > PQ_ASK;


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

    string s;
    cin >> s;

    int n = s.size();
    vector<int> prev(2019);
    int ans = 0;
    rep(i, n) {
        vector<int> next(2019);

        int k = s[i] - '0';
        next[k] += 1;

        rep(j, 2019) {
            int l = j * 10 + k;
            l = l % 2019;
            next[l] += prev[j];
        }
        prev = next;
        ans += prev[0];
    }

    cout << ans << endl;
}


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

#include<bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define bg begin()
#define ed end()
#define all(x) x.bg,x.ed
#define pb push_back
#define pf push_front
#define eb emplace_back
using namespace std;
typedef long long ll;
template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;}
template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;}
template<class t> using vc=vector<t>;
template<class t> using vvc=vc<vc<t>>;
using pi=pair<int,int>;
using vi=vc<int>;
void yes(){ cout << "Yes" << endl; }
void no(){ cout << "No" << endl; }
int SIZE(string s){return (int)s.size();}
const long long INF = 1LL << 60;

int main(){
    cout << fixed << setprecision(20);
    string s; cin >> s;
    int si = SIZE(s);
    ll ans = 0;
    vc<ll> a(200010); a[0]++;
    ll next = 1, cur = 0;
    for(int i = si-1; i >= 0; i--){
        cur = (cur+(s[i]-'0')*next)%2019;
        next = next*10%2019;
        ans += a[cur];
        a[cur]++;
    }
    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>
using namespace std;
const long long MOD = 1000000007;
const long long INF = 9999999999999999;
using ll = long long;
int main(){
  string s;
  cin>>s;
  int N = s.size();
  int dp[N][2019] = {};//i番目までに2019で割った余りがいくつあるか

  int p = s.at(0) - '0';
  dp[0][p] = 1;
  for(int i = 1;i<N;i++){
    p = s.at(i) - '0';
    dp[i][p]++;
    for(int k = 0;k<2019;k++){
      dp[i][(10*k)%2019] += dp[i-1][k];
      dp[i][(10*k+p)%2019] += dp[i-1][k];
    }
  }
  cout << dp[N-1][0] << endl;
  return 0;
}

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

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define ll long long
using namespace std;
//typedef vector<unsigned int>vec;
//typedef vector<ll>vec;
//typedef vector<vec> mat;
typedef pair<int, int> P;
typedef pair<ll,ll> LP;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int INF = 1000000000;
const ll LINF = 1000000000000000000;//1e18
const ll  MOD = 1000000007;
const double PI = acos(-1.0);
const double EPS = 1e-10;

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; }
//template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};

void solve(){
    string S;
    cin >> S;
    reverse(S.begin(), S.end());
    map<int, ll> mp;
    ll cur = 0;
    ll ans = 0;
    mp[0]++;
    ll fac = 1;
    REP(i,S.size()){
        cur = (cur + (S[i] - '0') * fac) % 2019;
        fac *= 10;
        fac %= 2019;
        cur %= 2019;
        mp[cur]++;
    }

    for(auto x : mp) ans += x.second * (x.second - 1) / 2;
    cout << ans << endl;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
    // int T; cin >> T; REP(t,T) solve();
}


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 ll mod=1e9+7;
const ll INF=mod*mod;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define all(x) (x).begin(),(x).end()
ll min(ll a,ll b){
  if(a>b){
    return b;
    }
      else{
        return a;
      }
  }
  
  ll max(ll a,ll b){
    if(a>b){
      return a;
    }
    else{
      return b;
    }
  }

ll power(ll a,ll b){
 ll ans=1;
 for(ll i=1;i<=b;i++){
ans*=a;
  }
  return ans;
}

 ll gcd(ll m,ll n){
 	if(n==0){
       return m;
     }
   return gcd(n,m%n);
 }
ll lcm(ll a,ll b){
  return a/gcd(a,b)*b;
		

}


int main(){
  
  string S;
  cin>>S;
  vector<ll>date(S.size());
  vector<ll>pile(S.size());
  ll ans=0;
  
  ll index=0;
for(ll i=S.size()-1;i>=0;i--){
  date[i]=(power(10,index)*(S[i]-'0'))%2019; 
  index++;
}
  
  ll now=0;
  ll sum=0;
  
  for(ll i=S.size()-1;i>=0;i--){
    now+=date[i];
    now%=2019;
 pile[i]=now;
    
}
  
sort(all(pile));

  
   for(ll i=S.size()-1;i>=0;i--){
     if(i!=0){
     rep(j,S.size()){
       
   if(pile[lower_bound(all(pile),date[i+1])-pile.begin()]==date[i+1]){
     ans+=lower_bound(all(pile),date[i+1]+1)-lower_bound(all(pile),date[i+1]);
   }
     }
     }
else{
  if(pile[lower_bound(all(pile),0)-pile.begin()]==0){
     ans+=lower_bound(all(pile),1)-lower_bound(all(pile),0);
   }

}

   }
  
  
  cout<<ans<<endl;
}



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

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





typedef long long ll;
typedef long double ld;


ll a[2][2019];


solve(int x){
	int t = 1;
	while(t){
		x = (x*10) % 2019;
		t--;
	}
	return x;
}


int main(){
	ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    string s;
    cin>>s;
    ll ans = 0;
    int n = s.size();
    for(int x = 0;x < n;x++){
    	for(int i = 0;i < 2019;i++){
    		a[1][(i*10 + s[x]-'0' + 2019) % 2019] += a[0][i];
		}
		a[1][s[x]-'0']++;
		for(int i = 0;i < 2019;i++){
			a[0][i] = a[1][i];
			a[1][i] = 0;
		}
		ans += a[0][0];
	}
	cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc:15:1: error: ISO C++ forbids declaration of 'solve' with no type [-fpermissive]
   15 | solve(int x){
      | ^~~~~
Language: C++

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace std;
using namespace __gnu_pbds;   
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 
#define ll long long int
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define pll pair<ll,ll>
#define all(x) x.begin(),x.end()
#define sz(x) (ll)x.size() 

ll power(ll x,ll y,ll p) 
{ 
    ll res = 1;      
    x = x % p;  
    while (y > 0) 
    { 
        if (y & 1) 
            res = (res*x) % p; 
        y = y>>1; 
        x = (x*x) % p;   
    } 
    return res; 
} 
ll a[200005],inv[200005],sm[200005];
vector<ll>c[2050];
int main()
{
    ios_base::sync_with_stdio(false);
	ll n,i,j,k,x,y,t,m;

	string s;
	cin >> s;
	ll md=673;
	for(i=0;i<sz(s);i++)
	{
		x=s[i]-'0';
		if(i)
			a[i]=((a[i-1]*10)%md+x)%md;
		else
			a[i]=x;
	}

	x=0;
	for(i=0;i<sz(s);i++)
	{
		x+=(s[i]-'0');
		x%=3;
		sm[i]=x;
		// cout<<sm[i]<<" ";
	}
	// cout<<endl;

	y=1;
	for(i=0;i<=200000;i++)
		inv[i]=power(y,md-2,md),y*=10,y%=md;

	for(i=0;i<sz(s);i++)
	{
		a[i]=(a[i]*inv[i])%md;
		c[a[i]].pb(i);
	}
		
	ll ans=0;	
	for(i=0;i<=2019;i++)
	{
		if(i==0)
		{
			ll r0=1,r2=0,r3=0;
			for(j=0;j<sz(c[i]);j++)
			{
				x=c[i][j];
				if(sm[x]==0)
				{
					ans+=r0;
				}
				if(sm[x]==1)
				{
					ans+=r1;	
				}
				if(sm[x]==2)
				{
					ans+=r2;
				}
				if(sm[x]==0)r0++;
				if(sm[x]==1)r1++;
				if(sm[x]==2)r2++;
			}
		}
		else
		{
			ll r0=0,r1=0,r2=0;
			for(j=0;j<sz(c[i]);j++)
			{
				x=c[i][j];

				if(sm[x]==0)
				{
					ans+=r0;
				}
				if(sm[x]==1)
				{
					ans+=r1;	
				}
				if(sm[x]==2)
				{
					ans+=r2;
				}
				if(sm[x]==0)r0++;
				if(sm[x]==1)r1++;
				if(sm[x]==2)r2++;
			}	
		}
	}
	cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:83:46: error: 'r1' was not declared in this scope; did you mean 'r3'?
   83 |                                         ans+=r1;
      |                                              ^~
      |                                              r3
a.cc:90:45: error: 'r1' was not declared in this scope; did you mean 'r3'?
   90 |                                 if(sm[x]==1)r1++;
      |                                             ^~
      |                                             r3
Language: C

#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp> 
using namespace std;
//using namespace __gnu_pbds;
#define rep(i,a,b) for(i=(a);i<=(b);i++)
#define ll long long
#define pll pair<ll, ll>
#define pii pair<int,int>
#define pb push_back
#define F first
#define S second
#define mod 1000000007
#define maxn 100005
#define inf 1e18
#define boost ios::sync_with_stdio(false);cin.tie(0)
#define fr freopen("source.txt","r",stdin),freopen("output.txt","w",stdout)
#define SET(a,b) memset(a,b,sizeof(a))
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define all(x) x.begin(), x.end()
//template<typename T>
//using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
template<class A, class B> ostream& operator << (ostream& out, const pair<A, B> &a) {
	return out <<  "(" << a.F << ", " << a.S << ")";
}
 
template<class A> ostream& operator << (ostream& out, const vector<A> &a) {
	out << "[";
	for (auto it = a.begin(); it != a.end(); ++it) {
		if (it != a.begin())
			out << ", ";
		out << *it;
	}
	return out << "]";
}
ll powermod(ll x,ll y){
	ll res=1;
	while(y>0){
		if(y&1)
		res=(res*x)%mod;

		y/=2;
		x=(x*x)%mod;
	}
	return res;
}
int main()
{
    boost;
    ll n,i,j,x,t,y,p;
	string s;
	cin>>s;
	n=s.size();
	p=2019;
	vector<ll>v(p+5,0);
	ll cur=1,sum=0;
	for(i=n-1;i>=0;i--){
		x=s[i]-'0';
		x%=p;
		x=(x*cur)%p;
		x=(x+sum)%p;
		v[x]++;
		sum=x%p;
		cur=(cur*10)%p;
	}
	ll ans=v[0];
	cur=1;
	sum=0;
	for(i=n-1;i>=0;i--){
		x=s[i]-'0';
		x%=p;
		x=(x*cur)%p;
		x=(x+sum)%p;
		v[x]--;	
		v[x]=max(v[x],0LL);
		ans+=v[x];
		sum=x%p;
		cur=(cur*10)%p;
	}
	ans=min(ans,n*(n+1)/2);
	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>
using namespace std;
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
 
const int N = 1e5 + 5;
 
int pow(int a, int b, int m)
{
    int ans=1;
    while(b)
    {
        if(b&1)
            ans=(ans*a)%m;
        b/=2;
        a=(a*a)%m;
    }
    return ans;
}
 
int n;
int m[2050];
string s;
 
int32_t main()
{
    IOS;
   //  freopen("inputf.in", "r", stdin);
    cin >> s;
    n = s.size();
    int cur = 0, ans = 0, pref = 0;
    for(int i = 0; i < n; i++)
    {
        int rem = 0, pref = 0;
        memset(m, 0, sizeof(m));
        for(int j = i; j < n; j++)
        {
            rem = (rem * 10 + s[j] - '0') % 2019;
            if(rem == 0)
                ans++;
        }
       
    }
    cout << ans;
    return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long
 
const int N = 1e5 + 5;
 
int pow(int a, int b, int m)
{
    int ans=1;
    while(b)
    {
        if(b&1)
            ans=(ans*a)%m;
        b/=2;
        a=(a*a)%m;
    }
    return ans;
}
 
int n;
int m[2050];
string s;
 
int32_t main()
{
    IOS;
     freopen("inputf.in", "r", stdin);
    cin >> s;
    n = s.size();
    int cur = 0, ans = 0, pref = 0;
    for(int i = 0; i < n; i++)
    {
        int rem = 0, pref = 0;
        memset(m, 0, sizeof(m));
        for(int j = i; j < n; j++)
        {
            rem = (rem * 10 + s[j] - '0') % 2019;
            if(rem == 0)
                ans++;
        }
       
    }
    cout << ans;
    return 0;
}

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

#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp> 
using namespace std;
//using namespace __gnu_pbds;
#define rep(i,a,b) for(i=(a);i<=(b);i++)
#define ll long long
#define pll pair<ll, ll>
#define pii pair<int,int>
#define pb push_back
#define F first
#define S second
#define mod 1000000007
#define maxn 100005
#define inf 1e18
#define boost ios::sync_with_stdio(false);cin.tie(0)
#define fr freopen("source.txt","r",stdin),freopen("output.txt","w",stdout)
#define SET(a,b) memset(a,b,sizeof(a))
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define all(x) x.begin(), x.end()
//template<typename T>
//using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
template<class A, class B> ostream& operator << (ostream& out, const pair<A, B> &a) {
	return out <<  "(" << a.F << ", " << a.S << ")";
}
 
template<class A> ostream& operator << (ostream& out, const vector<A> &a) {
	out << "[";
	for (auto it = a.begin(); it != a.end(); ++it) {
		if (it != a.begin())
			out << ", ";
		out << *it;
	}
	return out << "]";
}
ll powermod(ll x,ll y){
	ll res=1;
	while(y>0){
		if(y&1)
		res=(res*x)%mod;

		y/=2;
		x=(x*x)%mod;
	}
	return res;
}
int main()
{
    boost;
    ll n,i,j,x,t,y,p;
	string s;
	cin>>s;
	n=s.size();
	ll p=2019;
	vector<ll>v(p+5,0);
	ll cur=1,sum=0;
	for(i=n-1;i>=0;i--){
		x=s[i]-'0';
		x%=p;
		x=(x*cur)%p;
		x=(x+sum)%p;
		v[x]++;
		sum=x%p;
		cur=(cur*10)%p;
	}
	ll ans=v[0];
	cur=1;
	sum=0;
	for(i=n-1;i>=0;i--){
		x=s[i]-'0';
		x%=p;
		x=(x*cur)%p;
		x=(x+sum)%p;
		v[x]--;	
		v[x]=max(v[x],0LL);
		ans+=v[x];
		sum=x%p;
		cur=(cur*10)%p;
	}
	ans=min(ans,n*(n+1)/2);
	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 ll long long

using namespace std;

ll dp[2][2020];
ll rst[2000002];
int main () {
  string s;
  getline (cin, s);
  for (int i = 1; i <= 100000; ++i) {
    rst[i] = i % 2019;
  }
  dp[0][s[0] - '0'] = 1;
  ll ans = 0;
  int ans = 0;
  int n = s.size ();
  for (int i = 1; i < n; ++i) {
    for (int j = 0; j <= 2018; ++j) {
      int nxt = rst[j * 10 +  (s[i] - '0')];
      dp[i][nxt] += dp[0][j];
    }
    ans += dp[1][0];
    memcpy (dp[0], dp[1], sizeof (dp[1]));
    dp[0][(s[i] - '0')]++;
    memset (dp[1], 0, sizeof (dp[1]));
  }
  cout << ans << '\n';
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:7: error: conflicting declaration 'int ans'
   16 |   int ans = 0;
      |       ^~~
a.cc:15:6: note: previous declaration as 'long long int ans'
   15 |   ll ans = 0;
      |      ^~~
Language: C

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

//using Graph = vector<vector<edge>>;
using dou =long double;
string yes="yes";
string Yes="Yes";
string YES="YES";
string no="no";
string No="No";
string NO="NO";

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 rep(i, n)         for(int i = 0; i < (int)(n); i++)
#define brep(n)           for(int bit=0;bit<(1<<n);bit++)
#define erep(i,container) for (auto i : container)
#define irep(i, n)        for(int i = n-1; i >= (int)0; i--)
#define rrep(i,m,n) for(ll i = m; i < (ll)(n); i++)
#define reprep(i,j,h,w) rep(i,h)rep(j,w)
#define all(x) (x).begin(),(x).end()
#define VEC(type,name,n) std::vector<type> name(n);rep(i,n)std::cin >> name[i];
#define pb push_back
#define pf push_front
#define query int qq;std::cin >> qq;rep(qqq,qq)
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define itn int
#define mp make_pair
#define sum(a) accumulate(all(a),0ll)
#define keta fixed<<setprecision
#define vvector(name,typ,m,n,a)vector<vector<typ> > name(m,vector<typ> (n,a))
#define vvvector(name,t,l,m,n,a) vector<vector<vector<t> > > name(l, vector<vector<t> >(m, vector<t>(n,a)));
#define vvvvector(name,t,k,l,m,n,a) vector<vector<vector<vector<t> > > > name(k,vector<vector<vector<t> > >(l, vector<vector<t> >(m, vector<t>(n,a)) ));
#define case std::cout <<"Case #" <<qqq+1<<": "
#define res resize
#define as assign
#define ffor for(;;)
#define ppri(a,b) std::cout << a<<" "<<b << std::endl
#define pppri(a,b,c) std::cout << a<<" "<<b <<" "<< c<<std::endl
#define aall(x,n) (x).begin(),(x).begin()+(n)
#define ssum(a) accumulate(a,0ll) 

typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
//typedef long long T;
const int INF = 1000000000;
const ll INF64 = 922337203685477580ll;
const ll MOD = 1000000007ll;
const dou pi=3.141592653589793;

int main(){
    string s;
    std::cin >> s;
    int n=s.size();
    int ans=0;
   // std::cout << n << std::endl;
    ans=0;
    std::vector<int> a(2019);
    rep(i,n){
        std::vector<int> aa(2019);
        rep(j,2019){
           aa[(j*10+(s[i]-'0'))%2019]+=a[j];
        }
        ans+=aa[0];
     //   std::cout << a[0] << std::endl;aa[s[i]-'0']++;
        rep(j,2019)a[j]=aa[j];
       // std::cout << s[i]-'0' << std::endl;
    }
    
    std::cout << ans << std::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 ll MOD = 1e9 + 7;
const int inf = 1e9;
const ll INF = 1e18;
const double pi = 3.14159265358979323846;
#define rep(i,n) for(ll i=0;i<n;i++)

int main(){
	string s;cin>>s;
	int n=s.size();int keep[2019]={};
	//余りを累積和すればいける
	keep[0]=1;
	int a[n+1];a[0]=0;//その桁が追加されるといくつ余りが増えるか
	ll md=2019;
	int ans=0;
	int j=1;
	for(int i=0;i<n;i++){//下から何桁取るか考える
		ll t=s[n-i-1]-'0',tt=s[n-i-1]-'0';
		t=t*j%md;
		a[i+1]=(t+a[i])%md;
		//数え上げ
		int l=a[i+1];
		keep[l]++;
		//cout<<keep[l]<<" "<<keep0[l]<<"\n";
		
		if(tt!=0) ans+=keep[l]-1;
		//cout<<a[i+1]<<"\n";
		j*=10;
	}

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

int main() {
  int N,B,C,D;
  long long ans;
  strings S;
  ans=0;
 long long a[2019];
  for(int i=0;i<2019;i++){
    a[i]=0;
  }
  cin >>S;
  N=S.length();
  for(int i=0;i<N;i++){
    C+=S[i]-'0';
    C%=2019;
    a[C]++;
    C*=10;
  }
    for(int i=0;i<2019;i++){
    ans+=a[i]*(a[i]-1);
  }
  cout <<ans<< endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'strings' was not declared in this scope; did you mean 'stdin'?
    7 |   strings S;
      |   ^~~~~~~
      |   stdin
a.cc:13:9: error: 'S' was not declared in this scope
   13 |   cin >>S;
      |         ^
Language: C

#include<iostream>
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define mx 100000000


int md=1e9+7;
int __gcd(int a, int b) {if(b==0) return a; return __gcd(b, a%b);}
int poww(int a, int b) {int res=1;while(b) {if(b&1){res*=a;res%=md;}a*=a;a%=md;b>>=1;}return res;}
void ainp(int arr[], int n) {for(int i=1;i<=n;i++) cin>>arr[i];}
void vinp(vector<int> v,int n){for(int i=0;i<n;i++){int a;cin>>a;v.push_back(a);}}
map<int, int> mapp;
set<int> s;vector<int> v;

void fun()
{ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);}



signed main()
{  fun();
	string s;
	cin>>s;
	int rem=0,pref,nmul=0;
	int n=s.size();
	
set<int> rema[n];
	for(int i=0;i<n;i++)
	{
		rem=0;pref=0;
		for(int j=i;j<n;j++)
		{
			rem=(10*rem+s[j]-'0')%2019;
			//cout<<rem<<"\n";
			if(rema[j].find(rem)!=rema[j].end())
			{
				break;
			}
			rema[j].insert(rem);
			if(rem==0)
			{
				pref++;
			}
		}
		nmul+=pref*(pref+1)/2;
	}
	cout<<nmul<<"\n";
}



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