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

#include <bits/stdc++.h>
using namespace std;
 
int main(){
    string S;
    cin >> S;
    int ans = 0;
    for(int i = 0; i < S.size()-1; i++){
        for(int j = 0; j < S.size()-1; j++){
            if((std::stoi(i,j)%2019 == 0) && (i < j)){
                ans = ans + 1;
            }
        }
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:26: error: no matching function for call to 'stoi(int&, int&)'
   10 |             if((std::stoi(i,j)%2019 == 0) && (i < j)){
      |                 ~~~~~~~~~^~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:22: note:   no known conversion for argument 1 from 'int' to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:4432:3: note: candidate: 'int std::__cxx11::stoi(const std::wstring&, std::size_t*, int)'
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4432:23: note:   no known conversion for argument 1 from 'int' to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~~^~~~~
Language: C

s=input()
k=0
l=len(s)

for i in range(4,l+1):
    for j in range(0,l-i+1):
        ss=s[j:j+i]
        ss_n=int(ss)
        #if ss_n%2019==0:
        #    k+=1

print(k)

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | s=input()
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
main.c:1:3: error: implicit declaration of function 'input' [-Wimplicit-function-declaration]
    1 | s=input()
      |   ^~~~~
main.c:1:3: error: initializer element is not constant
main.c:2:1: error: expected ',' or ';' before 'k'
    2 | k=0
      | ^
main.c:9:25: error:  ':' without preceding '?'
    9 |         #if ss_n%2019==0:
      |                         ^
main.c:9: error: unterminated #if
    9 |         #if ss_n%2019==0:
Language: C

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <stack>
#include <algorithm>
#include <string>
#include <map>
#include <iterator>
#include <set>

using namespace std;


int main() {


    string S;
    cin >> S;

    int N = S.size();

    int cnt = 0;

    for (int i = 0; i < N; ++i) {

        for (int j = i + 4; j <= N; ++j) {

            if (stol(S.substr(i, j - i)) % 2019 == 0) {
                cnt += 1;
                break;
            }
        }
    }


    cout << cnt << endl;

    return 0;

}

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

#include <bits/stdc++.h>

using namespace std;
#define forr(i, n) for(ll i = n-1; i >= 0; i--)
#define forn(i, n) for(ll i = 0; i < n; i++)
#define forab(i, a, n) for(ll i = a; i < n; i++)
#define forabr(i, a, b) for(ll i = a; i >= b; i--)
#define endl '\n'
#define f first
#define s second
#define fast_io ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout.precision(7); cout.setf(ios::fixed);
#define pb push_back
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()

typedef long long ll;
typedef string S;

const ll mod = 1e9 + 7;
const ll Inf = LONG_LONG_MAX;
const double long PI = 3.1415926535;

ll sqr(ll a) { return a * a; }
ll qb(ll a) { return a * a * a; }
ll max(ll a, ll b){if(a > b)return a;return b;}
ll gcd (ll a, ll b) {while (b) {a %= b;swap (a, b);}return a;}
ll binpow(ll a, ll b, ll mod) { return b ? (b % 2 ? (a * (sqr(binpow(a, b / 2, mod)) % mod)) % mod : sqr(binpow(a, b / 2, mod)) % mod) : 1; }
ll binmult(ll a, ll b, ll mod) { return b ? (b % 2 ? (2 * binmult(a, b / 2, mod) + a) % mod : (2 * binmult(a, b / 2, mod)) % mod) : 0; }

int n, ans;
S s;

int main(){
    fast_io;
    cin >> s;
    n = s.size();
    forn(i, n){
        int a = 0;
        forn(j, i, n){
            a = 10*a + (s[j] - 'a');
            if(a%2019 == 0)ans++;
        }
    }
    cout << ans;
	return 0;
}


Compiler output:
a.cc:39:21: error: macro "forn" passed 3 arguments, but takes just 2
   39 |         forn(j, i, n){
      |                     ^
a.cc:5:9: note: macro "forn" defined here
    5 | #define forn(i, n) for(ll i = 0; i < n; i++)
      |         ^~~~
a.cc: In function 'int main()':
a.cc:39:9: error: 'forn' was not declared in this scope
   39 |         forn(j, i, n){
      |         ^~~~
Language: C

#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i) 
#define PI acos(-1)
#define pcnt __builtin_popcountll
#define rng(a) a.begin(), a.end()
#define sz(x) (int)(x).size()
#define v(T) vector<T>
#define vv(T) v(v(T))
#define fi first
#define se second

using namespace std;
using ll = long long;
using P = pair<int, int>;
using LP = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;

template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
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; }

ll INF = 1001001001;
ll LINF = 1001001001001001001ll;

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

    string s;
    cin>>s;
    int n = sz(s);

    map<int, int> mod;
    mod[0]++;
    ll ss = 0;
    ll ten = 1;
    rep(i, n) {
        ss = (ss + (s[n - i - 1] - '0') * ten) % 2019;
        ten = (ten * 10) % 2019;
        mod[ss]++;
    }
    ll ans = 0;
    for (auto i : mod) {
        ans += i.se * (i.se - 1) / 2;
    }
    cout<<ans<<endl;
}

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

import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    Long A = sc.nextLong();
    Long L =  String.valueOf(A).length();   
    String S = A.toString();  
    Long c = 0;
    for (Long i=0; i < L -3; i++) {
      for (Long j=i+3; j < L; j++) {
        String tmp = S.substring(i, j+1);
        if(Long.parseLong(tmp)%2019==0){
          c++;
        }
      }

    }
    System.out.println(c);
    return;
  }
  
}



Compiler output:
Main.java:7: error: incompatible types: int cannot be converted to Long
    Long L =  String.valueOf(A).length();   
                                      ^
Main.java:9: error: incompatible types: int cannot be converted to Long
    Long c = 0;
             ^
Main.java:10: error: incompatible types: int cannot be converted to Long
    for (Long i=0; i < L -3; i++) {
                ^
Main.java:12: error: incompatible types: Long cannot be converted to int
        String tmp = S.substring(i, j+1);
                                 ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
4 errors
Language: C

#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL_DEBUG
  #include "LOCAL_DEBUG.hpp"
#endif
#define int long long

signed main(){

  string s; cin >> s;

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

  int ans = 0;
  map<int, int> mp;
  for(int i = 0; i < n+1; i++){
    ans += mp[imos[i]];
    mp[imos[i]]++;
  }
  cout << ans << endl;

  return 0;
}

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

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

#define mp make_pair
#define pb push_back

#define int int64_t
#define ld long double

const int MOD = 1e9+7;
const int N = 1e6+5;

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    string s;
    cin>>s;
    if(s.length()<4)
    {
        cout<<0;
        return 0;
    }
    vector<string> mults;
    map<string,int> ma;
    for(int i=1;i<10000;i++) {
        ma[to_string(2019*i)]++;
    }
    vector<int> meh(s.length());
    int ans = 0;
    for(int i=3;i<(int)s.length();i++) {
        for(int j=4;j<=min(i+1, 9LL);j++) {
            if(ma[s.substr(i-j+1, j)]) {
                if(i-j<0) {
                    meh[i]+=1;
                }
                else {
                    meh[i]+=meh[i-j]+1;
                }
            }
        }
        // cout<<meh[i]<<"\n";
        ans+=meh[i];
        // s2=st;
    }

    cout<<ans;

    return 0;
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:33:27: error: no matching function for call to 'min(int64_t, long long int)'
   33 |         for(int j=4;j<=min(i+1, 9LL);j++) {
      |                        ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:33:27: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
   33 |         for(int j=4;j<=min(i+1, 9LL);j++) {
      |                        ~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:33:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   33 |         for(int j=4;j<=min(i+1, 9LL);j++) {
      |                        ~~~^~~~~~~~~~
Language: C

#include <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <bitset>
#include <complex>
#include <unistd.h>
#include <cassert>
#include <cctype>
#include <random>
#include <time.h>
#define _USE_MATH_DEFINES
#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;
typedef complex<double> xy_t;
typedef vector<ll> vll;
typedef vector< vector<ll> > matrix;
#define REP(i, x, y) for(ll i = (ll)x; i < (ll)y; i++)
#define DREP(i, x, y, d) for(ll i = (ll)x; i < (ll)y; i += (ll)d)
#define PER(i, x, y) for(ll i = (ll)x; i > (ll)y; i--)
#define DPER(i, x, y, d) for(ll i = (ll)x; i > (ll)y; i -= (ll)d)
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
ll mod = 1000000007;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;
int iinf = intmax / 8;
ll inf = llmax / 8;
double eps = 1e-12;

ll modadd(ll x, ll y) {
    return ((x + y) % mod + mod) % mod;
}

ll modminus(ll x, ll y) {
    return (x - y + mod) % mod;
}

ll multiply(ll x, ll y) {
    return (x % mod) * (y % mod) % mod;
}

ll dp[2][10000];

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll P = 2019;
    mod = P;
    string S;
    cin >> S;
    ll ans = 0;
    if (P == 2 || P == 5) {
        REP(i, 0, S.size()) {
            ll num = S[i] - '0';
            if (num % P == 0) {
                ans += i + 1;
            }
        } 
    } else {
        reverse(S.begin(), S.end());
        ll ten = 1;
        map<ll, ll> mp;
        ll now = 0;
        REP(i, 0, S.size()) {
            ll num = S[i] - '0';
            now = modadd(now, multiply(num, ten));
            if (now == 0) {
                ans++;
            }
            ans += mp[now];
            mp[now]++;
            ten = multiply(ten, 10);
        }
    }
    cout << ans << endl;
}


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

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

#define mp make_pair
#define pb push_back

#define int int64_t
#define ld long double

const int MOD = 1e9+7;
const int N = 1e6+5;

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    string s;
    cin>>s;
    if(s.length()<4)
    {
        cout<<0;
        return 0;
    }
    vector<string> mults;
    map<string,int> ma;
    for(int i=1;i<10000;i++) {
        ma[to_string(2019*i)]++;
    }
    vector<int> meh(s.length());
    int ans = 0;
    for(int i=3;i<s.length();i++) {
        for(int j=4;j<=min(i+1, 9LL);j++) {
            if(ma[s.substr(i-j+1, j)]) {
                if(i-j<0) {
                    meh[i]+=1;
                }
                else {
                    meh[i]+=meh[i-j]+1;
                }
            }
        }
        // cout<<meh[i]<<"\n";
        ans+=meh[i];
        // s2=st;
    }

    cout<<ans;

    return 0;
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:33:27: error: no matching function for call to 'min(int64_t, long long int)'
   33 |         for(int j=4;j<=min(i+1, 9LL);j++) {
      |                        ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:33:27: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
   33 |         for(int j=4;j<=min(i+1, 9LL);j++) {
      |                        ~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:33:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   33 |         for(int j=4;j<=min(i+1, 9LL);j++) {
      |                        ~~~^~~~~~~~~~
Language: C++

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

int time10(int n) {
  int x = 1
  if (n = 0) {
    return 1;
  }
  else {
    for (int i = 0; i < N; i++) {
      x *= 10;
    }
  }
  return x;
}

int devid10(int x, int n) {
  int ans = 0;
  while (true) {
    while (true) {
      if (x % 2019 == 0) {
          ans++;
      }
      x /= 10;
      if (x < 2019) {
        break;
      }
    }
    x = x % time10(n);
    n--;
    if (n < 3) {
      break;
    }
  }
  return ans;
}

int top_delete(int x) {
  int n = 0;
  while (true) {
    if (x > 10) {
      x /= 10;
      n++;
    }
  }
  return n;
}



int main() {
  int S;
  cin >> S;
  if (S < 2019) {
    cout << 0 << endl;
  }
  else {
    int n = top_delete(S);
    int ans = devid10(S,n);
    cout << ans << endl;
  }
}
  

Compiler output:
a.cc: In function 'int time10(int)':
a.cc:6:3: error: expected ',' or ';' before 'if'
    6 |   if (n = 0) {
      |   ^~
a.cc:9:3: error: 'else' without a previous 'if'
    9 |   else {
      |   ^~~~
a.cc:10:25: error: 'N' was not declared in this scope
   10 |     for (int i = 0; i < N; i++) {
      |                         ^
Language: Java

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    String s = br.readLine();
    int result = 0;
    for (int i=0; i<s.length(); i++) {
      for (int j=i+1; j<=s.length(); j++) {
        String sb = s.substring(i, j);
        if (isMultiple(sb, 10, 2019)) result++;
      }
    }
    System.out.println(result);
  }
  static boolean isMultiple (String s, int base, int m) {
    int temp = 0;
    for (int i=0; i<s.length(); i++) {
      temp = (temp*base+Character.getNumericValue(s.charAt(i)))%m;
    }
    if (temp==0) {return true;}
    return false;
  }
}


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

#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
constexpr int MOD = 1000000007;
constexpr int INF = numeric_limits<int>::max() / 2;
typedef pair<int,int> P;
using Graph = vector<vector<int>>;



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

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

    int ans = 0;
    map<int, int> mp{};
    int num = 0, kai = 1;
    mp[0]++;
    int P = 2019;
    for(int i=N-1;i>=0;i--){
        num += (S[i]-'0') * kai;
        num %= P;
        mp[num]++;
        kai = (kai * 10) % P;
    }
    for(auto p : mp){
        int n = p.second;
        ans += n * (n-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;

int main(){
	string S;
	cin >> S;
	int s=S.size();
	vector<int> N(s);
	for(int i=0;i<s;i++)N[i]=S[i]-'0';
	
	vector<long long> p(2019,0);
	
	int b=1;
	int c=0;
	for(int i=0;i<s;i++){
		c+=N[s-i-1]*b;
		c%=2019;
		p[c]++;
		b*=10;
		b%=2019;
	}
	
	long long ans=0;
	for(int i=0;i<2019;i++){
		if(i==0)ans+=p[i]*(p[i]+1)/2;
		else ans+=p[i]*(p[i]-1)/2;
	}
	cout << ans << endl;
	return 0;
}

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

#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <utility>
#include <vector>

#define MOD 1000000007
using namespace std;
typedef long long ll;
ll sum[200001];
vector<ll> v[2019];
int main() {
  ll ans = 0LL;
  int n;
  string s;
  cin >> s;
  n = s.length();
  reverse(s.begin(), s.end());
  int x = 1;
  v[0].push_back(0);
  for (int i = 0; i < n; i++) {
    sum[i + 1] = sum[i] + x * (s[i] - '0');
    sum[i + 1] %= 2019;
    v[sum[i + 1]].push_back(1 + i);
    x *= 10;
    x %= 2019;
  }
  for (int i = 0; i < 2019; i++) {
    if (!v[i].empty()) {
      for (int j = 0; j < v[i].size(); j++) {
        for (int k = j + 1; k < v[i].size(); k++) {
          if (v[i][k] - v[i][j] >= 4) {
            ans += v[i].size() - k;
          }
        }
      }
    }
  }
  cout << ans << endl;
}

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

#include <iostream>
#include <vector>
#include <string>
#include <list>
#include <queue>
#include <algorithm>
#define rep(i, n) for(i = 0; i < (n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define MOD 1000000007
#define PI 3.14159265358979323846
#define INF 1 << 30

using namespace std;
typedef long long ll;
typedef pair<int, int> pp;

int main(void) {
	int num, i, j, a;
	ll ans = 0;
	string s;
	cin >> s;
	vector<vector<ll>> dp(s.size() + 1, vector<ll>(2019, 0));
	rep(i, s.size()) {
		a = s[i] - '0';
		rep(j, 2019) {
			if (dp[i][j]) {
				dp[i + 1][(j * 10 + a) % 2019] += dp[i][j];
			}
		}
		dp[i + 1][a]++;
	}
	rep(i, dp.size()) {
		ans += dp[i][0];
	}
	cout << ans << "\n";
	return 0;
}

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

#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
using namespace std;
#define a_macro(args...) sum(args)
#define mp make_pair
#define eb emplace_back
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))

typedef long long ll;
const ll mod = 1e9+7;

typedef tuple<int,int,int> State; // operator< defined
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
typedef double ld;

/*---------------Matrix Multiplication-------------------
struct matrix {
  // N is the size of the matrix
  int m[N][N];
  matrix()
  {
     memset(m,0,sizeof(m));
  }
  matrix operator * (matrix b)
  {
     matrix c = matrix();
     for (int i = 0; i < N; ++i)
       for (int j = 0; j < N; ++j)
         for (int k = 0; k < N; ++k) 
           c.m[i][j] = (c.m[i][j] + 1LL * m[i][k] * b.m[k][j]) % M;
     return c;
  }
};
// Note that this multiplication method can be used to multiplying numbers,matrixes,etc....
matrix modPow(matrix m,int n)
{
  if ( n == 0 )
    return unit; // the unit matrix - that is 1 for principal diagonal , otherwise 0
  matrix half = modPow(m,n/2);
  matrix out = half * half;
  if ( n % 2 )
    out = out * m;
  return out; 
}
-----------------END-----------------------------------*/
int sum() { return 0; }

template<typename T, typename... Args>
auto sum(T a, Args... args) { return a + sum(args...); }
template<class T> bool uin(T &a,T b) {return a > b ? (a == b, true) : false; }
template<class T> bool uax(T &a,T b) {return a < b ? (a == b, true) : false; }

int main(int argc, const char** argv) {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.precision(10);
    cout << fixed;
#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	freopen("error.txt","w",stderr);
#endif

	string s;
	cin>>s;
	vector<int> multiple(101);
	for(i=1;i<=100;++i)
		multiple[i] = 2019*i;
	int ans = 0;
	for(i=1;i<=100;++i){
		string t = stoi(multiple[i]);
		size_t found = str.find(t, 0, t.length());
    	if (found != string::npos) 
        	ans ++;
	}
	cout<<ans<<"\n";
    
#ifndef LOCAL_DEFINE
    cerr << "Time elapsed: "<< 1e1 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif // LOCAL_DEFINE
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:80:13: error: 'i' was not declared in this scope
   80 |         for(i=1;i<=100;++i)
      |             ^
a.cc:83:13: error: 'i' was not declared in this scope
   83 |         for(i=1;i<=100;++i){
      |             ^
a.cc:85:32: error: 'str' was not declared in this scope; did you mean 'std'?
   85 |                 size_t found = str.find(t, 0, t.length());
      |                                ^~~
      |                                std
Language: C

#include<iostream>
#include<string>
#include<set>
#include<map>
#include<vector>
#include<queue>
#include<stack>
#include<deque>
#include<tuple>
#include<algorithm>
#include<numeric>
#include<limits>
#include<boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
using namespace std;
#define BEGIN ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define END return EXIT_SUCCESS
#define up(I,A,B) for(auto I=(A);I<=(B);++I)
#define dw(I,A,B) for(auto I=(A);I>=(B);--I)
#define rep(I,N) up(I,0,N-1)
#define all(C) (C).begin(),(C).end()
#define rall(C) (C).rbegin(),(C).rend()
#define ft first
#define sd second
#define mp make_pair
#define mt make_tuple
#define pf push_front
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define rs resize
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>inline void                                      in(T &p){cin>>p;}
template<class T1,class T2>inline void                            in(T1 &p1,T2 &p2){cin>>p1>>p2;}
template<class T1,class T2,class T3>inline void                   in(T1 &p1,T2 &p2,T3 &p3){cin>>p1>>p2>>p3;}
template<class T1,class T2,class T3,class T4>inline void          in(T1 &p1,T2 &p2,T3 &p3,T4 &p4){cin>>p1>>p2>>p3>>p4;}
template<class T1,class T2,class T3,class T4,class T5>inline void in(T1 &p1,T2 &p2,T3 &p3,T4 &p4,T5 &p5){cin>>p1>>p2>>p3>>p4>>p5;}
template<class T>inline void                                      ins(T &p){for_each(all(p),in<decltype(p[0])>);}
template<class T>inline void                             out(T p){cout<<p<<"\n";}
template<class T1,class T2>inline void                   out(T1 p1,T2 p2){cout<<p1<<" "<<p2<<"\n";}
template<class T1,class T2,class T3>inline void          out(T1 p1,T2 p2,T3 p3){cout<<p1<<" "<<p2<<" "<<p3<<"\n";}
template<class T1,class T2,class T3,class T4>inline void out(T1 p1,T2 p2,T3 p3,T4 p4){cout<<p1<<" "<<p2<<" "<<p3<<" "<<p4<<"\n";}
inline void                                              out(ld p){printf("%.12Lf\n",p);}
template<class T>inline void outml(T p){for_each(all(p),out<decltype(p[0])>);}//ml=multi line
template<class T>inline void outol(T V){auto n=V.size();rep(i,n)cout<<V[i]<<" \n"[i==n-1];}//ol=one line
ull T[2<<17],mod,ans,cnt[2<<17];
inline void solve(void){
  string S;
  in(S);
  ull N=S.size();
  T[N-1]=1;
  for(ull i=N-1;i--;)T[i]=T[i+1]*10;
  cnt[0]=1;
  for(ull i=0;i<N;i++){
    mod=(mod+(S[i]-'0')*T[i])%2019;
    ans+=cnt[mod]++;
  }
  out(ans);
}
int main(void){
  BEGIN;
  solve();
  END;
}


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

#include<cstdio>
#include<iostream>
#include<string>
#include<set>
#include<map>
#include<vector>
#include<queue>
#include<stack>
#include<deque>
#include<tuple>
#include<algorithm>
#include<numeric>
#include<limits>
#include<boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
using namespace std;
#define BEGIN ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define END return EXIT_SUCCESS
#define up(I,A,B) for(auto I=(A);I<=(B);++I)
#define dw(I,A,B) for(auto I=(A);I>=(B);--I)
#define rep(I,N) up(I,0,N-1)
#define all(C) (C).begin(),(C).end()
#define rall(C) (C).rbegin(),(C).rend()
#define ft first
#define sd second
#define mp make_pair
#define mt make_tuple
#define pf push_front
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define rs resize
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>inline void                                      in(T &p){cin>>p;}
template<class T1,class T2>inline void                            in(T1 &p1,T2 &p2){cin>>p1>>p2;}
template<class T1,class T2,class T3>inline void                   in(T1 &p1,T2 &p2,T3 &p3){cin>>p1>>p2>>p3;}
template<class T1,class T2,class T3,class T4>inline void          in(T1 &p1,T2 &p2,T3 &p3,T4 &p4){cin>>p1>>p2>>p3>>p4;}
template<class T1,class T2,class T3,class T4,class T5>inline void in(T1 &p1,T2 &p2,T3 &p3,T4 &p4,T5 &p5){cin>>p1>>p2>>p3>>p4>>p5;}
template<class T>inline void                                      ins(T &p){for_each(all(p),in<decltype(p[0])>);}
template<class T>inline void                             out(T p){cout<<p<<"\n";}
template<class T1,class T2>inline void                   out(T1 p1,T2 p2){cout<<p1<<" "<<p2<<"\n";}
template<class T1,class T2,class T3>inline void          out(T1 p1,T2 p2,T3 p3){cout<<p1<<" "<<p2<<" "<<p3<<"\n";}
template<class T1,class T2,class T3,class T4>inline void out(T1 p1,T2 p2,T3 p3,T4 p4){cout<<p1<<" "<<p2<<" "<<p3<<" "<<p4<<"\n";}
inline void                                              out(ld p){printf("%.12Lf\n",p);}
template<class T>inline void outml(T p){for_each(all(p),out<decltype(p[0])>);}//ml=multi line
template<class T>inline void outol(T V){auto n=V.size();rep(i,n)cout<<V[i]<<" \n"[i==n-1];}//ol=one line
ull T[2<<17],mod,ans,cnt[2<<17];
inline void solve(void){
  string S;
  in(S);
  ull N=S.size();
  T[N-1]=1;
  for(ull i=N-1;i--;)T[i]=T[i+1]*10;
  cnt[0]=1;
  for(ull i=0;i<N;i++){
    mod=(mod+(S[i]-'0')*T[i])%2019;
    ans+=cnt[mod]++;
  }
  out(ans);
}
int main(void){
  BEGIN;
  solve();
  END;
}


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

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

// macro
#define rep(i,n) for(i=0;i<n;i++)
#define ll long long
#define all(v) v.begin(), v.end()

// code starts
int main()
{
  string s;cin>>s;
  int n=s.size();
  vector<int> num(n);
  int i;
  rep(i,n)num[i]=s[i]-'0';
  vector<int> us(n+1,0);
  vector<int> count(2019,0);
  int ans=0;
  count[0]=1;
  int ks=1;
  for(i=n-1;i>=0;i--)
  {
    us[i]=(us[i+1]+num[i]*ks)%2019;
    ans+=count[us[i]];
    count[us[i]]++;
    ks=(ks*10)%2019;
  }
  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 <iostream>
#include <string>
#include <cstdlib>
using namespace std;
int main()
{
  string str;
  cin >> str;
  int size = str.size();
  int result = 0;
  for(int i = 0; i < size; i++) {
  	for(int j = i; j < size; j++) {
      string n = str.substr(i, j - i);
      int k = atoi(n);
      if(!(k % 2019)) result++;
    }
  }
  cout << result;
}

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

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

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int64 i = 0;i < (n);i++)
#define FOR(i, a, b) for(int64 i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
	return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value!=0>::type
fill_v(U &u,const V... v){u=U(v...);}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_v(U &u,const V... v){
	for(auto &e:u) fill_v<T>(e,v...);
}

int64 N, P;
int64 mpow(int64 a, int64 b, int64 P) {
  if (b == 0) return 1;
  if (b % 2) return a * mpow(a, b-1)%P;
  int64 ret = mpow(a, b/2);
  return ret*ret%P;
}

int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  int64 P1 = 3, P2 = 673;
  cin >> s;
  int64 now1 = 0, now2 = 0, res = 0;
  map<pair<int64, int64>, int64> cnt;
  cnt[{0, 0}]++;
  int64 div = 1;
  int64 d101 = mpow(10%P1, P1-2, P1);
  int64 d102 = mpow(10%P2, P2-2, P2);
  REP(i, s.size()) {
    now1 = now1 * 10 + s[i]-'0';
    now2 = now2 * 10 + s[i]-'0';

    now1 %= P1; now2 %= P2;
    res += cnt[{now1*mpow(d101, i, P1)%P1, now2*mpow(d102, i, P2)%P2}];
    cnt[{now1*mpow(d101, i, P1)%P1, now2*mpow(d102, i, P2)%P2}]++;
  }
  cout << res << endl;
}


Compiler output:
a.cc: In function 'int64 mpow(int64, int64, int64)':
a.cc:45:29: error: too few arguments to function 'int64 mpow(int64, int64, int64)'
   45 |   if (b % 2) return a * mpow(a, b-1)%P;
      |                         ~~~~^~~~~~~~
a.cc:43:7: note: declared here
   43 | int64 mpow(int64 a, int64 b, int64 P) {
      |       ^~~~
a.cc:46:19: error: too few arguments to function 'int64 mpow(int64, int64, int64)'
   46 |   int64 ret = mpow(a, b/2);
      |               ~~~~^~~~~~~~
a.cc:43:7: note: declared here
   43 | int64 mpow(int64 a, int64 b, int64 P) {
      |       ^~~~
Language: C

#define _USE_MATH_DEFINES
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <string>
#include <vector>
#include <utility>
#include <complex>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <tuple>
#include <bitset>
#include <limits>
#include <algorithm>
#include <array>
#include <random>
#include <complex>
#include <regex>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define fcout cout << fixed << setprecision(10)
#define rep(i,n)    for(int i=0; i<(int)n; i++)
#define mp(a,b) make_pair(a,b)
#define pb push_back
const ll inf = 1e18;
const ll mod = 1e9 + 7;

ll pow (ll x, ll n){
    ll ans = 1;
    while(n>0){
        if(n & 1 == 1){
            ans *= x;
        }
        x = x * x;
        n >>= 1;
    }
    return ans;
}


int main(){
    string s;
    cin >> s;
    int n=s.size();
    int ans=0;
    rep(i,n){
        for(int j=1; j<=n-i; j++){
            string slice_s = s.substr(i, j);
            int num_s = atoi(slice_s.c_str());
            if(num_s % 2019 == 0) {
                printf("num_s=%d i=%d j=%d\n", num_s, i, j );
                ans++;
            }
        }
    }
    cout << ans << endl;
}


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

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned long long ULL;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

#define MP make_pair
#define EACH(i,c) for(auto i: c)
#define SORT(c) sort((c).begin(),(c).end())

#define ALL(a)  (a).begin(),(a).end()

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	const int P = 2019;
	string s;
	cin >> s;
	int N = s.size();

	LL ret = 0;
	LL a = 0, b = 1;
	vector<int> count(P + 1, 0);
	count[0] = 1;
	REP(i, N){
		a += (s[N - 1 - i] - '0') * b;
		a %= P;
		b *= 10;
		b %= P;
		ret += count[a]++;
	}
	cout << ret << endl;

	return 0;
}


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

import java.util.*;
 
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    int len = s.length();
    int ans = 0;
    for(int i = 0; i < len-3; i++){
      for(int j = i+3; j < len ; j++){
        int sub = s.substring(i,j+1).parseInt();
        if(sub%2019 == 0) ans++;
      }
    }
    System.out.println(ans);
  }
}

Compiler output:
Main.java:11: error: cannot find symbol
        int sub = s.substring(i,j+1).parseInt();
                                    ^
  symbol:   method parseInt()
  location: class String
1 error
Language: C++

#include<iostream>
#include<cmath>
#include<numeric>
#include<functional>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<n;i++)
#define ll long long
using namespace std;

int main(){
  string s;
  cin>>s;
  int n=s.length();
  int mod=2019;
  int rui10[200020];
  rui10[0]=1;
  for(int i=1;i<200020;i++){
    rui10[i]=(10*rui10[i-1])%mod;
  }
  int x[n+1];
  x[0]=0; x[1]=atoi(s[n-1]);
  for(int i=2;i<=n;i++){
    x[i]=(x[i-1]+atoi(s[n-i])*rui10[i-1])%mod;
  }
  map<int,ll> mp;
  ll ans=0;
  rep(i,n+1){
    mp[x[i]]++;
  }
  for(auto p:mp){
    ans+=p.second*(p.second-1)/2;
  }
  cout<<ans;
}

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

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll 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;
  
  ll ans=0;
  
  rep(i,S.size()){
    rep(j,S.size()-i){
      
      string now=S.substr(j,i+1);
      
      ll num=atoi(now.c_str());
      if(num%2019==0){
        ans++;
      }
    }
  }

  cout<<ans<<endl;
}


  
  

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

def Int():
    return int(input())
def Ints():
    return map(int,input().split())
def IntList():
    return list(Ints())
def IntMat(N):
    return [IntList() for i in range(N)]

S = input()
L = len(S)
S = S[::-1]

T = [-1]*L
mod = 2019
now = 0
for i in range(L):
    s = S[i]
    now += int(s)*pow(10,i,mod)
    T[i] = now%mod
    
Nlist = [0]*2019
Nlist[0] = 1

for i in T:
    Nlist[i] += 1
    
ans = 0
for i in Nlist:
    ans += i*(i-1)//2
print(ans)

Compiler output:
main.c:1:1: error: unknown type name 'def'
    1 | def Int():
      | ^~~
main.c: In function 'Int':
main.c:1:10: error: expected declaration specifiers before ':' token
    1 | def Int():
      |          ^
Language: C

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

#define ll long long
#define rep(i,x,y) for(int i=x;i<y;i++)
#define rel(i,x,y) for(int i=x-1;i>=y;i--)
#define all(x) x.begin(),x.end()

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n,p;
    string s; cin >> s;
    n = s.length();
    p = 2019;
    ll ans = 0;
    if(p==5 || p==2){
        ll cnt = 1;
        rep(i,0,n)if((s[i]-'0')%p==0)ans +=i+1;
    }else{
        vector<int> pnum(p,0);
        pnum[0] = 1;
        int base = 1;
        int sum=0;
        rel(i,n,0){
            sum = (sum + base * (s[i]-'0')) % p;
            ans += pnum[sum]++;
            base = base * 10 % p;
        }
    }
    cout << ans << endl;

}


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

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define LL long long
#define pii pair <int,int>
#define fi first
#define se second
#define pb push_back
#define mpr make_pair

using namespace std;

const LL MOD=1e9+7;

string s;
LL dp[2][2030],ne[2030][20],ans=0;

int main()
{
	cin>>s;
	rep(i,2019) repn(j,9) ne[i][j]=(i*10+j)%2019;
	dp[0][0]=1;
	rep(i,s.size())
	{
		int tmp=(i&1),tmp2=tmp^1;
		memset(dp[tmp2],0,sizeof(dp[tmp2]));
		dp[tmp2][0]=1;
		rep(j,2020) dp[tmp2][ne[j][s[i]-'0']]+=dp[tmp][j];
		ans+=dp[tmp2][0]-1;
	}
	cout<<ans<<endl;
	return 0;
}

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

#include <iostream>
#include <cstdio>
#include <vector>
#include <iomanip>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
using namespace std;

const int MAXS = 300000;
char str[MAXS];

int main() {
    scanf("%s", str);

    int N = strlen(str);
    const int MOD = 2019;

    int mul = 1;
    int prefixSum = 0;
    long long ans = 0;
    unordered_map <int, int> remainMap;

    for (int i = N-1; i >= 0; --i) {
        prefixSum += (str[i]-'0') * mul;
        prefixSum %= MOD;

        if (prefixSum == 0) {
            ++ans;
        }

        // int target = prefixSum;
        ans += remainMap[prefixSum];
        ++remainMap[prefixSum];

        mul *= 10;
        mul %= MOD;
    }

    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:13: error: 'strlen' was not declared in this scope
   19 |     int N = strlen(str);
      |             ^~~~~~
a.cc:11:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   10 | #include <cmath>
  +++ |+#include <cstring>
   11 | using namespace std;
Language: C

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <map>
using namespace std;
typedef long long LL;

string s;
LL n,cnt[2025] = {0},now = 0,tot = 0;

LL kpw(LL x,LL y){
	LL ans = 1,tmp = x;
	while(y){
		if(y & 1) ans = (ans * tmp) % 2019;
		tmp = (tmp * tmp) % 2019;
		y >>= 1;
	}
	return ans;
}

int main(){
	ios::sync_with_stdio(false);
	cin >> s; n = s.length(); s = ' ' + s;
	cnt[0] = 1;
	for(LL i = n;i >= 1;i --){
		now += kpw(10,n - i) * (s[i] - '0');
		now %= 2019;
		tot += cnt[now];
		cnt[now] ++;
//		cout << now << endl;
	}
	cout << tot << '\n';
	return 0;
}

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