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

#include<bits/stdc++.h>
using namespace std;
int main(){string S;cin>>S;int b=S.size();int x=0;
           for(int i=0;i<b-3;i++)for(int j=4;j<b-i+1;j++){string p=S.substr(i,j);const char *q =p;if(atoi(q)%2019==0)x++;}
           cout<<x<<endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:4:97: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*' in initialization
    4 |            for(int i=0;i<b-3;i++)for(int j=4;j<b-i+1;j++){string p=S.substr(i,j);const char *q =p;if(atoi(q)%2019==0)x++;}
      |                                                                                                 ^
      |                                                                                                 |
      |                                                                                                 std::string {aka std::__cxx11::basic_string<char>}
a.cc:5:26: error: expected '}' at end of input
    5 |            cout<<x<<endl;
      |                          ^
a.cc:3:11: note: to match this '{'
    3 | int main(){string S;cin>>S;int b=S.size();int x=0;
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll  long long
#define FASTINOUT ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const int N=2e5+9;
ll dp[N][2019];
ll ls;
string s;
ll f(ll i,ll m){
    if (i==ls)
        return 0;
    if (dp[i][m]!=-1)
        return dp[i][m];
    ll x=s[i]-'0';
    ll ans=((m*10+x)%673==0&&(m*10+x)%3==0)+f(i+1,(m*10+x)%2019);
    return dp[i][m]=ans;
}
int main()
{
    FASTINOUT;
    cin>>s;
    ls=s.length();
    memset(dp,-1,sizeof dp);
    ll ans=0;
    for (ll i=0;i<ls;i++){
        if (s[i]=='0')
            ans++;
        else
            ans+=f(i,0);
    }
    cout<<ans;
    return 0;
}


Compiler output:
/tmp/ccxFJJP5.o: in function `f(long long, long long)':
a.cc:(.text+0x14): relocation truncated to fit: R_X86_64_PC32 against symbol `ls' defined in .bss section in /tmp/ccxFJJP5.o
a.cc:(.text+0x87): relocation truncated to fit: R_X86_64_PC32 against symbol `s[abi:cxx11]' defined in .bss section in /tmp/ccxFJJP5.o
/tmp/ccxFJJP5.o: in function `main':
a.cc:(.text+0x240): relocation truncated to fit: R_X86_64_PC32 against symbol `s[abi:cxx11]' defined in .bss section in /tmp/ccxFJJP5.o
a.cc:(.text+0x259): relocation truncated to fit: R_X86_64_PC32 against symbol `s[abi:cxx11]' defined in .bss section in /tmp/ccxFJJP5.o
a.cc:(.text+0x268): relocation truncated to fit: R_X86_64_PC32 against symbol `ls' defined in .bss section in /tmp/ccxFJJP5.o
a.cc:(.text+0x2a4): relocation truncated to fit: R_X86_64_PC32 against symbol `s[abi:cxx11]' defined in .bss section in /tmp/ccxFJJP5.o
a.cc:(.text+0x2e0): relocation truncated to fit: R_X86_64_PC32 against symbol `ls' defined in .bss section in /tmp/ccxFJJP5.o
/tmp/ccxFJJP5.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x30e): relocation truncated to fit: R_X86_64_PC32 against symbol `s[abi:cxx11]' defined in .bss section in /tmp/ccxFJJP5.o
a.cc:(.text+0x327): relocation truncated to fit: R_X86_64_PC32 against symbol `s[abi:cxx11]' defined in .bss section in /tmp/ccxFJJP5.o
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <vector>
#include<algorithm>
#include <string>
#include <cassert>
using namespace std;

int N;
vector<int> vec;
string S;

int solve() {

    int ans = 0;

    vec.resize(S.size());

    auto pc1 = S.c_str();

    for (int i = 0; i < (int)S.size(); i++) {

        char temp = pc1[i];

        int num = atoi(&temp);

        vec[i] = num;
    }


    for (int i = 0; i < vec.size(); i++) {

        for (int j = 0; j < vec.size(); j++) {

            if (j - i < 3) {

                continue;
            }

            int pow10 = (int)std::pow(10, j - i);

            int temp = 0;
            for (int k = i; k <= j; k++) {

                temp += pow10 * vec[k];

                pow10 /= 10;
            }

            if (temp % 2019 == 0) {
                ans++;
            }
        }
    }



    return ans;

}

int main() {

    cin >> S;


    //vec.resize(N);
    //for (int i = 0; i < N; i++) {
    //    cin >> vec.at(i);
    //}
    
    cout << solve() << endl;


    return 0;
}



Compiler output:
a.cc: In function 'int solve()':
a.cc:39:35: error: 'pow' is not a member of 'std'
   39 |             int pow10 = (int)std::pow(10, j - i);
      |                                   ^~~
Language: C++

//Test
#include<ncurses.h>
#include<iostream>
int main()
{
  char c;
  c = getch;
  cout << c << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: invalid conversion from 'int (*)()' to 'char' [-fpermissive]
    7 |   c = getch;
      |       ^~~~~
      |       |
      |       int (*)()
a.cc:8:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |   cout << c << endl;
      |   ^~~~
      |   std::cout
In file included from a.cc:3:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:8:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    8 |   cout << c << endl;
      |                ^~~~
      |                std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;
const int maxn = 2e5 + 10;
char s[maxn];
int num(int a, int b)
{
	int ans = 0;
	for (int i = a; i <= b; i++)
	{
		ans = ans * 10 + (s[i] - '0');
	}
	return ans;
}
int main()
{
	cin >> s;
	int res = 0;
	int len = strlen(s);
	for (int i = 1; i <= len; i++)
	{
		for (int j = i + 1; j <= len; j++)
		{
			
			if (num(i - 1, j - 1) % 2019 == 0)
				res++;
		}
	}
	cout << res << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:19: error: 'strlen' was not declared in this scope
   19 |         int len = strlen(s);
      |                   ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

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

using namespace std;

int main()
{
  string s;
  cin>>s;
  
  int buf1=0;
  
  string buf={};
  
  int ans=0;
  
  for(int i=0;i<(int)s.length()-1;i++)
  {
    for(int j=i+1;j<=(int)s.length();j++)
    {
      buf1=i;
      
		while(buf1!=j)
        {
          buf.push_back(s[buf1]);
          buf1++;
        }
      
      if((int)buf%2019==0)
        ans++;
      
      buf={};
      
    }
  }
  
  cout<<ans<<endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:10: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int'
   30 |       if((int)buf%2019==0)
      |          ^~~~~~~~
Language: C

s = input()
if(len(s) < 5):
    print(0)
else:
    p = 0
    for i in range(5,len(s)+1):
        for j in range(len(s)-i+1):
            if(int(s[j:j+i])%2019 == 0):
                p += 1
print(p)

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

#include <iostream>
#include <vector>
#include<algorithm>
#include <string>
#include <cassert>
using namespace std;

int N;
vector<int> vec;
string S;

int solve() {

    int ans = 0;

    vec.resize(S.size());

    auto pc1 = S.c_str();

    for (int i = 0; i < (int)S.size(); i++) {

        char temp = pc1[i];

        int num = atoi(&temp);

        vec[i] = num;
        int a = 0;
    }


    for (int i = 0; i < vec.size(); i++) {

        for (int j = 0; j < vec.size(); j++) {

            if (j - i < 3) {

                continue;
            }

            int pow10 = (int)pow(10, j - i);

            int temp = 0;
            for (int k = i; k <= j; k++) {

                temp += pow10 * vec[k];

                pow10 /= 10;
            }

            if (temp % 2019 == 0) {
                ans++;
            }
        }
    }



    return ans;

}

int main() {

    cin >> S;


    //vec.resize(N);
    //for (int i = 0; i < N; i++) {
    //    cin >> vec.at(i);
    //}
    
    cout << solve() << endl;


    return 0;
}



Compiler output:
a.cc: In function 'int solve()':
a.cc:40:30: error: 'pow' was not declared in this scope; did you mean 'pow10'?
   40 |             int pow10 = (int)pow(10, j - i);
      |                              ^~~
      |                              pow10
Language: C

#include <bits/stdc++.h>
#define ll long long
#define double long double
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define mod (ll)(1e9+7)
#define inf (ll)(3e18+7)
#define pi (double) acos(-1)
#define P pair<int,int>
#define PiP pair<int,pair<int,int>>
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
using namespace std;

int main() {
    string s;
    cin >> s;
    vector<vector<int>> dp(s.size(), vector<int>(2019, 0));
    int now;
    dp[0][s[0]-'0']++;
    REP(i, s.size()-1){
        now = s[i] - '0';
        dp[i][now]++;
        rep(j, 2019){
            dp[i][(j*10+now) % 2019] += dp[i-1][j];
        }
    }
    int ans = 0;
    rep(i, s.size())ans += dp[i][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;
using ll = long long;
using pll = pair<ll, ll>;
using vl = vector<ll>;

/* short */
#define pb push_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) begin(v), end(v)
#define RALL(v) rbegin(v), rend(v)

/* REPmacro */
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define FORR(i, a, b) for(int i = (a); i >= (b); i--)
#define REP(i, n) for(int i = 0; i < (n); i++)
#define FOREACH(x, a) for(auto x : a)

/* exchange */
#define CHMIN(a, b) (a) = min((ll)(a), (ll)(b))
#define CHMAX(a, b) (a) = max((ll)(a), (ll)(b))

/* function */
#define IN(x) cin >> x
#define DEBUG(x) cerr << (x) << " "
#define LN() cerr << "\n"
#define PRINT(x) cout << (x) << endl
#define BR cout << endl

/* const */
const int ARRAY = 100005;
const int INF = 1001001001; // 10^9
const ll LINF = 1001001001001001001; // 10^18
const int MOD = 1e9 + 7;

ll N = 0;
ll ret = 0;
string s;

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

int main(void){
  
  IN(s);
  N = s.length();

  vl r(2019, 0);

  ll n = 0;
  FOR(i, 0, N) {
    n += (s[N-1-i] - '0') * modPow(10, i);
    n %= 2019;
    r[n] += 1;
  }

  ret += r[0];
  FOR(i, 0, 2019) {
    ret += r[i] * (r[i] - 1) / 2;
  }

  PRINT(ret);

}


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

S = input()
count = 0
S_len = len(S)
for i in range(S_len):
    for j in range(i+4,S_len+1):
        if int(S[i:j]) % 2019 == 0:
            count += 1

print(count)

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

#include <iostream>
#include <string>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll,ll> llP;

int mod(int a,int b){
  int res=a%b;
  if(res<0) res+=b;
  return res;
}

int main() {
  string s;
  cin>>s;
  map<int,int> memo;
  vector<int> res;
  int b=1;
  for(int i=0;i<=20005;i++){
    if(i==0){
      res.push_back(1);
      continue;
    }
    b*=10;
    b=mod(b,2019);
    res.push_back(b);
  }
  memo[0]++;
  int a=0;
  for(int i=0;i<s.size();i++){
    a+=res[i]*(s[s.size()-1-i]-'0');
    a=mod(a,2019);
    memo[a]++;
  }
  ll ans=0;
  for(auto itr=memo.begin();itr!=memo.end();itr++){
    ans+=itr->second*(itr->second-1)/2;
  }
  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:3: error: 'map' was not declared in this scope
   17 |   map<int,int> memo;
      |   ^~~
a.cc:2:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
    1 | #include <iostream>
  +++ |+#include <map>
    2 | #include <string>
a.cc:17:7: error: expected primary-expression before 'int'
   17 |   map<int,int> memo;
      |       ^~~
a.cc:18:3: error: 'vector' was not declared in this scope
   18 |   vector<int> res;
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | #include <string>
a.cc:18:10: error: expected primary-expression before 'int'
   18 |   vector<int> res;
      |          ^~~
a.cc:22:7: error: 'res' was not declared in this scope
   22 |       res.push_back(1);
      |       ^~~
a.cc:27:5: error: 'res' was not declared in this scope
   27 |     res.push_back(b);
      |     ^~~
a.cc:29:3: error: 'memo' was not declared in this scope
   29 |   memo[0]++;
      |   ^~~~
a.cc:32:8: error: 'res' was not declared in this scope
   32 |     a+=res[i]*(s[s.size()-1-i]-'0');
      |        ^~~
Language: C++

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

string s;
int a[200005];
int i,j;
long long x;
int p;

int main()
{
	getline(cin,s);
	for(int i=1;i<=s.size())
		a[i]=s[i]-'0';
	
	for(i=1;i<=n-4;i++)
		for(j=i+4;j<=n;j++)
		{
			for(int k=i;k<=j;k++)
			{
				x*=10;
				x+=a[i];
			}
			if(x%2019ll==0) p++;
		}
	
	cout<<p;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:32: error: expected ';' before ')' token
   13 |         for(int i=1;i<=s.size())
      |                                ^
      |                                ;
a.cc:16:20: error: 'n' was not declared in this scope; did you mean 'yn'?
   16 |         for(i=1;i<=n-4;i++)
      |                    ^
      |                    yn
Language: C++

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

using namespace std;

int main()
{
  string s;
  cin>>s;
  
  int buf1=0;
  
  vector<char> buf;
  
  int ans=0;
  
  for(int i=0;i<s.length()-1;i++)
  {
    for(int j=i+1;j<=s.length();j++)
    {
      buf1=i;
      
		while(buf1!=j)
        {
          buf.push_back(s[buf1]);
          buf1++;
        }
      
      if((int)buf%2019==0)
        ans++;
      
    }
  }
  
  cout<<ans<<endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:10: error: invalid cast from type 'std::vector<char>' to type 'int'
   30 |       if((int)buf%2019==0)
      |          ^~~~~~~~
Language: C

S = input()
res = 0

for i in range(3, len(S)):
  last = S[i]
  for j in range(i-3):
    product = int(S[j:i+1])

    if product % 2019 == 0:
      res += 1

print(res)

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

// #include <bits/stdc++.h>
#include "stdc++.h"

using namespace std;

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

	int count = 0;
	for (int i = 0; i < S.size() - 3; i++)
	{
		for (int j = i + 3; j < S.size(); j++)
		{
			string tmp_s(S, i, j);
			
			if (stoll(tmp_s) % 2019 == 0)
			{
				count++;
			}
			
		}
	}

	cout << count;
}

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

#define range(a) (a).begin(),(a).end()
const int inf = 2147483647;

int main (){
    int Ans = 0;
    string s,ss;cin >> s;
    rep(i,0,s.size()){
        rep(j,4,s.size()-i+1){
            ss=s.substr(i,j);
            if(ss=="");
            else if(stoll(ss)%2019==0)Ans++;
        }
    }
    cout << Ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'string' was not declared in this scope
    6 |     string s,ss;cin >> s;
      |     ^~~~~~
a.cc:6:17: error: 'cin' was not declared in this scope
    6 |     string s,ss;cin >> s;
      |                 ^~~
a.cc:6:24: error: 's' was not declared in this scope
    6 |     string s,ss;cin >> s;
      |                        ^
a.cc:7:9: error: 'i' was not declared in this scope
    7 |     rep(i,0,s.size()){
      |         ^
a.cc:7:5: error: 'rep' was not declared in this scope
    7 |     rep(i,0,s.size()){
      |     ^~~
a.cc:14:5: error: 'cout' was not declared in this scope
   14 |     cout << Ans << endl;
      |     ^~~~
a.cc:14:20: error: 'endl' was not declared in this scope
   14 |     cout << Ans << endl;
      |                    ^~~~
Language: C

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

int main() {
  string S;
  cin >> S;
  ll ans = 0;
  ll N = S.size();
  //iは桁数
  for (ll i = 4; i <= N; i++) {
    //jは最初の場所
    for (ll j = 0; j <= N-i; j++) {
      ll num;
      num = stoll(S.substr(j, i));
      if (num % 2019 == 0) {
        ans++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}



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

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

int main() {
  string S;
  cin >> S;
  ll ans = 0;
  ll N = S.size();
  //iは桁数
  for (ll i = 4; i <= N; i++) {
    //jは最初の場所
    for (ll j = 0; j <= N-i; j++) {
      ll num;
      num = stoll(S.substr(j, i));
      if (num % 2019 == 0) {
        ans++;
      }
    }
  }
  cout << ans << endl;
}
return 0;


Compiler output:
a.cc:24:1: error: expected unqualified-id before 'return'
   24 | return 0;
      | ^~~~~~
Language: C

#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define print(x)cout<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;

int main() {
  string s;
  cin >> s;
  int p=2019;
  int n = sz(s);
  reverse(s.begin(),s.end());
  vl S(n+1,0);
  map<ll,ll> nums;
  ll ten = 1;
  rep(i,n){
    S[i+1] = (S[i] +(s[i]-'0')*ten)%p;
    ten = (ten*10)%p; 
  }
  ll ans = 0;
  if(p == 2 || p == 5){
    rep(i,n){
      if((s[i]-'0')%p==0)ans+=n-i;
    }
    cout<<ans<<endl;
    return 0;
  }
  rep(i,n+1){
    ll q = S[i]%p;
    nums[q]++;
  }
  for(auto it: nums){
    ll a = it.se;
    ans+=a*(a-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

//Author : Sidiq Tri Pratikto
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define all(v) v.begin(), v.end()

using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> new_data_set;
//order_of_key(x) = number of elements stricly smaller than x
//find_by_order(x) = return x-th largest element
typedef long long LL;
const LL MOD = 1e9 + 7;
const double PI = 2 * acos(0);
LL dp[2020];

int main() {
	string s;
	cin >> s;
	LL tmp = 1;
	int l1 = s.length();
	vector<int> v;
	for (int i = l1 - 1; i >= 0; i--) {
		LL x = (tmp * (s[i] - '0')) % 2019;
		v.pb(x);
		tmp *= 10;
		tmp %= 2019;
	}
	dp[0] = 1;
	LL pre = 0, ans = 0;
	while (!v.empty()) {
		pre += v.back();
		pre %= 2019;
		v.pop_back();
		ans += dp[pre];
		dp[pre]++;
	}
	printf("%lld\n", ans);
}

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

#include <bits/stdc++.h>

using namespace std;

int main(){
	string s;
	long long sol = 0;
	cin >> s;
	for(int i = 0; i + 4 <= s.size(); i++){
		for(int j = 4; i + j <= s.size(); j++){
			string sub;
			sub = s.substr(i, j);
			stringstream fn(sub);
			int x;
			fn >> x;
			if(x % 2019 == 0)
				sol++;
		}
	}
	cout << sol << '\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(){string S;cin>>S;int b=S.size();int x=0;
           for(int i=0;i<b-3;i++)for(int j=4;j<b-i+1){string p=S.substr(i,j);if(atoi(const char*p)%2019==0)x++;}
           cout<<x<<endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:4:53: error: expected ';' before ')' token
    4 |            for(int i=0;i<b-3;i++)for(int j=4;j<b-i+1){string p=S.substr(i,j);if(atoi(const char*p)%2019==0)x++;}
      |                                                     ^
      |                                                     ;
a.cc:4:86: error: expected primary-expression before 'const'
    4 |            for(int i=0;i<b-3;i++)for(int j=4;j<b-i+1){string p=S.substr(i,j);if(atoi(const char*p)%2019==0)x++;}
      |                                                                                      ^~~~~
a.cc:5:26: error: expected '}' at end of input
    5 |            cout<<x<<endl;
      |                          ^
a.cc:3:11: note: to match this '{'
    3 | int main(){string S;cin>>S;int b=S.size();int x=0;
      |           ^
Language: C

// 桁dpでmod2019を状態として管理する？
// abc159のeみたいな感じ
#include <bits/stdc++.h>
using namespace std;

const int MAX_N = 200010;
const long long mod = 2019;
long long C[MAX_N];

int main() {
    string S;
    cin >> S;
    int N = S.size();
    reverse(S.begin(),S.end());
    long long base = 1;
    map<long long, long long> Map;
    for(int i = 1; i <= N; ++i) {
        C[i] = (long long)(S[i-1] - '0')*base%mod;
        base *= 10LL;
        base %= mod;
    }
    for(int i = 1; i <= N; ++i) {
        C[i] += C[i-1];
        C[i] %= mod;
    }
    for(int i = 0; i <= N; ++i) {
        ++Map[C[i]];
    }
    long long res = 0LL;
    for(auto &p : Map) {
        long long num = p.second;
        res += num*(num-1)/2;
    }
    cout << res << endl;
    return 0;
}

Compiler output:
main.c:3:10: fatal error: bits/stdc++.h: No such file or directory
    3 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
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();i++){
    for(int j=i+4;j<s.size();j++){
      const char *t=s.substr(i,j-i);
      int m=atoi(t);
      if(m%2019==0) ans++;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:29: error: cannot convert 'std::__cxx11::basic_string<char>' to 'const char*' in initialization
   10 |       const char *t=s.substr(i,j-i);
      |                     ~~~~~~~~^~~~~~~
      |                             |
      |                             std::__cxx11::basic_string<char>
Language: C

import math
s = input()
l = len(s)
cnt = 0
for i in range(l-1):
    for j in range(i+1, l):
        if eval(s[i:j+1]+'/2019') - math.floor(eval(s[i:j+1]+'/2019')) == 0:
            cnt += 1

print(cnt)


Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import math
      | ^~~~~~
main.c:2:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 's'
    2 | s = input()
      | ^
main.c:7:26: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
    7 |         if eval(s[i:j+1]+'/2019') - math.floor(eval(s[i:j+1]+'/2019')) == 0:
      |                          ^~~~~~~
main.c:7:62: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
    7 |         if eval(s[i:j+1]+'/2019') - math.floor(eval(s[i:j+1]+'/2019')) == 0:
      |                                                              ^~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

using ll = long long;

const ll MOD = 1000000007;

#ifndef ONLINE_JUDGE
template <class T, class U>ostream &operator<<(ostream &o, const map<T, U>&obj) {o << "{"; for (auto &x : obj) o << " {" << x.first << " : " << x.second << "}" << ","; o << " }"; return o;}
template <class T>ostream &operator<<(ostream &o, const set<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const multiset<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const vector<T>&obj) {o << "{"; for (int i = 0; i < (int)obj.size(); ++i)o << (i > 0 ? ", " : "") << obj[i]; o << "}"; return o;}
template <class T, class U>ostream &operator<<(ostream &o, const pair<T, U>&obj) {o << "{" << obj.first << ", " << obj.second << "}"; return o;}
template <template <class tmp>  class T, class U> ostream &operator<<(ostream &o, const T<U> &obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr)o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
void print(void) {cout << endl;}
template <class Head> void print(Head&& head) {cout << head;print();}
template <class Head, class... Tail> void print(Head&& head, Tail&&... tail) {cout << head << " ";print(forward<Tail>(tail)...);}
#else
#define print(...)
#endif


int main(void){

    string s;
    ll ans = 0;

    cin >> s;

    for(ll it = 4; it < s.length() && i<21; it++){
        for(ll i=0; i<s.length()-it+1; i++){
            ll num = stoll(s.substr(i,it));
            if(num%2019ll == 0ll){
                ans++;
            }
        }
    }

    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:39: error: 'i' was not declared in this scope; did you mean 'it'?
   31 |     for(ll it = 4; it < s.length() && i<21; it++){
      |                                       ^
      |                                       it
Language: C++

num=input()
counter=0
for y in range(len(num)):
  for x in range(y):
    if int(num[x:y])%2019==0 and
      counter=counter+1
print(counter)


Compiler output:
a.cc:1:1: error: 'num' does not name a type; did you mean 'enum'?
    1 | num=input()
      | ^~~
      | enum
Language: C

#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<ll,ll> P;
typedef vector<P> vp;
typedef vector<string> vs;
typedef vector<bool> vb;

const ll mod=1e9+7;
const ll inf=1e16;

#define rep(i,m,n) for(ll i=m;i<n;i++)
#define repr(i,m,n) for(ll i=m-1;i>=n;i--)
#define fi first
#define se second
#define chmax(x,y) x=max(x,y)
#define chmin(x,y) x=min(x,y)
#define eb(x) emplace_back(x)
#define all(x) x.begin(),x.end()
#define gll greater<ll>()

string s;

void solve(){
 cin >> s;
 ll n=s.length();
 reverse(all(s));
  vll sum(n+1,0);
  ll pow=1;
 rep(i,0,n){  
  sum[i+1]=sum[i]+pow*(s[i]-'0');
  sum[i+1]%=2019; 
  pow*=10;
  pow%=2019; 
 }
  map<ll,ll> mp;
 for(auto a:sum) mp[a]++;  
  ll res=0;
 for(auto p:mp) res+=p.se*(p.se-1)/2; 
 cout << res << endl;
}

int main(){
   cin.tie(nullptr);
  ios::sync_with_stdio(false);
  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

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

#define ll long long
#define vecll vector<long long>
#define vec2ll vector<vector<long long>>
#define vecbool vector<bool>
#define vecpairll vector<pair<long long,long long>>
#define forll(s,a,b) for(long long s = a;s < b;s++)
#define forllde(s,a) for(long long s = a;s > 0;s--)


int main(){
  ll c=0, x=2019, i=1;
  string s, xs;
  istringstream ss;
  cin >> s;
  while(true){
	xs = to_string(x * i);
	i++;
	ll xs_size = (ll)xs.size();
	if(xs.size() > s.size())
	  break;
	ll pos = s.find(xs);
	while(pos!=string::npos){
	  pos = s.find(xs, pos + xs_size);
	  c++;
	}  
  }
  cout << c << endl;
}

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

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
# define mod 1000000007
# define INF (1 << 29)
# define MAX_N 1000010
/* ちゃんと考えてわかって実装 */

int main(void){
    string s;
    cin >> s;
    int len = s.length();

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

    vector<int> cnt(2019);
    ll ans = 0;
    for(int i=len; i>=0; i--){
        ans += cnt[d[i]];
        cnt[d[i]]++;
    }
    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;
using ll = long long;
using pll = pair<ll, ll>;
using vl = vector<ll>;

/* short */
#define pb push_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) begin(v), end(v)
#define RALL(v) rbegin(v), rend(v)

/* REPmacro */
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define FORR(i, a, b) for(int i = (a); i >= (b); i--)
#define REP(i, n) for(int i = 0; i < (n); i++)
#define FOREACH(x, a) for(auto x : a)

/* exchange */
#define CHMIN(a, b) (a) = min((ll)(a), (ll)(b))
#define CHMAX(a, b) (a) = max((ll)(a), (ll)(b))

/* function */
#define IN(x) cin >> x
#define DEBUG(x) cerr << (x) << " "
#define LN() cerr << "\n"
#define PRINT(x) cout << (x) << endl
#define BR cout << endl

/* const */
const int ARRAY = 100005;
const int INF = 1001001001; // 10^9
const ll LINF = 1001001001001001001; // 10^18
const int MOD = 1e9 + 7;

ll N = 0;
ll ret = 0;
string s;

int main(void){
  
  IN(s);
  N = s.length();

  vl r(2019, 0);

  REP(i, N) {
    ll n = s[i] - '0';
    FOR(j, i+1, N) {
      n *= 10;
      n += s[j] - '0';
      n %= 2019;
    }
    r[n] += 1;
    // DEBUG(n);
  }

  ret += r[0];
  FOR(i, 0, 2019) {
    ret += r[i] * (r[i] - 1) / 2;
  }

  PRINT(ret);

}


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 i, x, count = 0;
  string s;
  cin >> s;
  for(i = 0; i <= s.size() - 4 && s[i] >= '2'; i++)
  {
    for(j = 4; j <= s.size() - 1; j++)
    {
      string ss = s.substr(i, j);
      int x = stoi(ss);
      if(x % 2019)
      {
        count++;
      }
    }
  }
  cout << count << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'j' was not declared in this scope
   10 |     for(j = 4; j <= s.size() - 1; j++)
      |         ^
Language: C

#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<map>
#include<tuple>
#include<algorithm>
#include<cmath>
#include<limits>
#include<set>
#include<deque>
#include<queue>
using namespace std;
#define int long  long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
typedef pair<int, int>P;
const int MOD = 1e9 + 7;
//const int MOD = 998244353;
const int INF = 1e11;
const long double PI = (acos(-1));

int f(int n) {
	int res = 1;
	rep(i, n)res *= 10;
	return res;
}

signed main() {
	string S;
	cin >> S;
	vector<vector<int>>v(3); //桁数 4 5 6
	rep(i, 100) {
		int num = 2019 * (i + 1);
		int keta = log10(num) + 1 - 4;
		v[keta].push_back(num);
	}
	int ans = 0;
	for (int i = 4; i <= 6; i++) {
		for (int j = 0; j + i - 1 < S.size(); j++) {
			int num = 0;
			rep(l, i)num += (S[j + l] - '0') * f(i - 1 - l);
			bool can = false;
			rep(l, v[i - 4].size()) {
				if (v[i - 4][l] == num)can = true;
			}
			if (can)ans++;
		}
	}
	cout << ans;
}

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

#include <iostream>
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
using graph = vector<vector<ll>>;

// 多倍長テンプレ
/* ---------------------- ここから ---------------------- */
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
using Real = mp::number<mp::cpp_dec_float<1024>>;
/* ---------------------- ここまで ---------------------- */

int main() {
	Bint s,mems,keta=1,count = 0,mem;
	cin >> s;
	mems = s;
	while (mems / 10 != 0) {
		keta++;
		mems = mems / 10;
	}
	for (Bint i = 1; i < keta; i++) {
		for (Bint j = i; j < keta+1; j++) {
			mem = s / pow(10, j);
			mem = mem * pow(10, j);
			mems = s - mem;
			mems = mems / pow(10, i - 1);
			cout << mems << endl;
			if (mems % 2019 == 0)count++;
		}
	}
	/*cout << count << endl;*/
	return 0;
}

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

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

int read(){
	int x=0,f=1;
	char c=getchar();
	while(!isdigit(c)){if(c=='-')f=-1;c=getchar();}
	while(isdigit(c)){x=(x<<3)+(x<<1)+c-48;c=getchar();}
	return x*f;
}

int k,m,n,mod=2019;
char c[200010];
map<int,int> M;
vector<pair<int,int> > ans;
int fpm(int x,int y){
	int sum=1;
	while(y){
		if(y&1)sum=1ll*sum*x%mod;
		x=1ll*x*x%mod;
		y>>=1;
	}
	return sum;
}
int main(){
	scanf("%s",c+1);
	n=strlen(c+1);
	int num=0;
	M[0]=n+1;
	for(register int i=n;i>=1;i--){
		(num=num+(c[i]-'0')*fpm(10,n-i))%=mod;
		//cout<<i<<" "<<num<<" "<<M[num]<<endl;
		if(M[num])ans.push_back(make_pair(i,M[num]-1));
		M[num]=i;
	}
	sort(ans.begin(),ans.end());
	m=0;long long anss=0;
	for(register int i=0;i<ans.size();i++){
		if(!i){m++;continue;}
		if(ans[i].first==ans[i-1].second+1)m++;
		else anss+=1ll*m*(m+1)/2;
	}
	anss+=1ll*m*(m+1)/2;
	printf("%lld\n",anss);
	return 0;
}

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

#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <vector>

using namespace std;
using LLONG = long long;
const LLONG MOD = 1000000007;

int main()
{
    string s; cin >> s; // |S| <= 2*1e5
    int ans = 0;
    for (int l = 0; l < s.length(); ++l)
    {
        int value = 0;
        for (int i = l; i < s.length(); ++i)
        {
            value *= 10;
            value += static_cast<int>(s[i] - '0');
            value %= 2019;
            if (value == 0)
            {
                ++ans;
                l = i - 1;
                break;
            }
        }
    }
    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 rep(i,n) for(int i=0;i<n;i++)
using ll = long long;

int main(){
	string s;
	cin >> s;
	int s_size = s.size();
	ll count = 0;
	ll test = 0;
  rep(i,s_size){
		rep(j,s_size-i){
		test = stoll(s.substr(i,j+1));
		if(test != 0 && test % 2019 == 0)count++;
		}
	}
	cout << count << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:18:31: error: expected '}' at end of input
   18 |         cout << count << endl;
      |                               ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

#include<iostream>
using namespace std;

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

	char a[2*(1<<5)];
	strcpy(a, S.c_str());

	int len = sizeof(S);
	int num = 0;
	for (int i = 0; i < len - 3; i++) {
		for (int j = i+3; j < len; j++) {
			int sum = 0;
			for (int k = i; k <= j; k++) {
				sum = sum * 10 + (int)(a[k]-'0');
			}
			if (sum % 2019 == 0) {
				num++;
			}
		}
	}

	cout << num << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'strcpy' was not declared in this scope
    9 |         strcpy(a, S.c_str());
      |         ^~~~~~
a.cc:2:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#include <bits/stdc++.h> 
using namespace std; 
int countSubStr(string str, int len, int k) 
{ 
	int count = 0; 

	for (int i = 0; i < len; i++) { 
		int n = 0; 

		for (int j = i; j < len; j++) { 
			n = n * 10 + (str[j] - '0'); 

			if (n % k == 0) 
				count++; 
		} 
	} 
 
	return count; 
} 


int main() 
{ 
	string s;
   	cin>>s;
  	int k = 2019;
	cout << countSubStr(str, s.length(), k); 

	return 0; 
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:27:29: error: 'str' was not declared in this scope; did you mean 'std'?
   27 |         cout << countSubStr(str, s.length(), k);
      |                             ^~~
      |                             std
Language: C

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

public class CP {

    public static void main(String[] args) {

        BigInteger two = BigInteger.valueOf(2019);
        Scanner in = new Scanner(System.in);
        String s = in.next();
        int ans = 0;
        for(int l = 4; l < s.length(); l++) {
            for(int i = 0; i <= s.length() - l; i++) {
                String sub = s.substring(i, i + l);
                BigInteger b = new BigInteger(sub);
                if(b.mod(two).equals(BigInteger.ZERO)) {
                    ++ans;
                }
            }
        }
        System.out.println(ans);
    }
}


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 CP {
      | ^~~~~~
main.c:4:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'CP'
    4 | public class CP {
      |              ^~
Language: C

#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<utility>//pair
#include<list>
#include<vector>//可変長配列
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define all(a) (a).begin(),(a).end()
#define mp make_pair
#define pb push_back
#define ll __int64
#define __int64 long long
#define P pair<int,int>
#define PP pair<ll,ll>
#define F first
#define S second
int dx[8] = { 1,0,-1,0,1,-1,-1,1 };
int dy[8] = { 0,1,0,-1,1,1,-1,-1 };


string s;
int a[222222];
int t[222222];
int n;
const int m = 2019;
map<int, int>ta;
int main() {
	cin >> s;
	n = s.size();
	rep(i, n)t[i] = s[i] - '0';

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

	int ans = 0;
	vector<int>cnt(m);
	for (int i = n; i >= 0; i--) {
		ans += cnt[a[i]];
		cnt[a[i]]++;
	}


	cout << ans << endl;
	return 0;
}


Compiler output:
main.c:1:9: fatal error: algorithm: No such file or directory
    1 | #include<algorithm>//sort,二分探索,など
      |         ^~~~~~~~~~~
compilation terminated.
Language: C++


#include <iostream>
#include <numeric>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)




int main() {
	long long an = 0;
	long long S;
	cin >> S;
	long long N = log10(S) + 1;
	long long co = S;
	vector<int> vec(N);
	for (int i = 0; i < N; i++) {
		vec.at(i)=co%10;
		co = co / 10;
	}
	reverse(vec.begin(), vec.end());
	long long suu = 0;
	for (long long i=0; i < N; i++){
		
		suu = 0;
			for (long long j = i; j < N; j++) {
				suu = suu * 10 + vec.at(j);
				if (suu % 2019 == 0) {
					an++;
				}
				
			}
	
	}
	cout << an << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:23: error: 'log10' was not declared in this scope
   30 |         long long N = log10(S) + 1;
      |                       ^~~~~
Language: C

#include<bits/stdc++.h>
#include<boost/variant.hpp>
using namespace std;
typedef long long ll;
typedef vector<boost::variant<bool, ll, int, string, double, char*, const char*>> anys;
template<typename T> inline void pr(const vector<T> &xs){
	for(int i=0; i<xs.size()-1; i++) cout<<xs[i]<<" ";
	(xs.empty()?cout:(cout<<xs[xs.size()-1]))<<endl;
}
#ifdef DEBUG
#define debug(...) pr(anys{__VA_ARGS__})
#define debugv(x) pr((x))
#else
#define debug(...)
#define debugv(x)
#endif

int main(){
	string S;
	cin >> S;
	vector<int> cnt1(2019), cnt2(2019);
	ll ans = 0;

	for(int i=0; i<S.size(); i++){
		for(int j=0; j<2019; j++){
			cnt2[(10*j+S[i]-'0')%2019] = cnt1[j];
		}
		cnt2[S[i]-'0']++;
		ans += cnt2[0];
		cnt1=cnt2;
	}
	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>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
 #define int long long
#define all(X) (X).begin(), (X).end()
#define reset(X) memset(X, 0, sizeof(X))
#define mp(a, b) make_pair(a, b)
#define pb push_back
#define endl '\n'
#define fi first
#define se second

 
 
using namespace __gnu_pbds;
using namespace std;
 const int mod=1e9+7;
 // const int mod=998244353;
const int INF=4e18+10;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
#define read(n) int n; cin>>n;
#define readv(x, n) vector<int> x(n); for(auto &i:x) cin>>i; 
int multiply(int a, int b, int in_mod){return (a*b)%in_mod;} 
int mult_identity(int a){return 1;}


auto power(auto a, int b, int in_mod)
{
    auto prod=mult_identity(a);
    auto mult=a%in_mod;
    while(b!=0)
    {
        if(b%2)
        {
            prod=multiply(prod,mult, in_mod);
        }
        mult=multiply(mult, mult,in_mod);
        b/=2;
    }
    return prod;
}
int mod_inv(int q, int in_mod)
{

    return power(q, in_mod-2,in_mod);
}


 
void solve()
{     
    string s;
    cin>>s;
    const int mod =2019;
    int n=s.size();
    reverse(all(s));
    vector<int> pref(n+1);
    int magic = power(10, n-1, mod);
    int cons = mod_inv(10, mod);
    for(int i=1;i<=n;i++)
    {
        pref[i] = (pref[i-1] + (s[i-1]-'0')*magic)%mod;
        magic = (magic*cons)%mod;
    }    

    int pairs =0;

    map<int, int> good_guys;
    int cnt=0;
    for(int i=0;i<=n;i++)
    {
        int rower = (pref[i])%mod;
        cnt += good_guys[rower];
        good_guys[pref[i]]++;

    } 
    cout<<cnt<<endl;
}

 
 
signed main()
 
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);  
    cout.tie(NULL);
    #ifndef ONLINE_JUDGE
        if(fopen("INPUT.txt","r"))
        {
            freopen ("INPUT.txt" , "r" , stdin);
            freopen ("OUTPUT.txt" , "w" , stdout);
        }
    #endif
    auto clk=clock(); 
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    // -------------------------------------Code starts here---------------------------------------------------------------------     
 
    int t=1;
    // cin>>t;
    for(int test=1;test<=t;test++)
    {
        // cout<<"Case #"<<test<<": ";
        solve();
        // cout<<endl;
 
    }
 
    // -------------------------------------Code ends here------------------------------------------------------------------
 
 
    clk = clock() - clk;
    cerr << fixed << setprecision(6) << "Time: " << ((double)clk)/CLOCKS_PER_SEC << "\n";
    return 0;
 }


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

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

int main(){
    string s;
    cin >> s;
    
    int ans = 0;
    rep(i, s.size() - 4){
        int x = stoi(s.substr(i, 5));
        int y = stoi(s.substr(i, 4));
        cout << x << endl;
        if(x % 2019 == 0){
            ans++;
        }
    }
    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.