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

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

long long tot[2015],z[200010];

int main()
{
	string s;
    
	int i;
    
	long long x=1,ans;
    
	cin>>s;
    
	for(i=s.size()-1;i>=0;i--)
	{
		z[i]=(z[i+1]+(s[i]-'0')*x)%2019;
        
		x=x*10%2019;
        
		tot[z[i]]++;
	}
    
	ans=tot[0];
    
	for(i=0; i<2019; i++)
    {
        ans+=tot[i]*(tot[i]-1)/2;
    }
	
	cout<<an<<endl;
    
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:15: error: 'an' was not declared in this scope; did you mean 'ans'?
   32 |         cout<<an<<endl;
      |               ^~
      |               ans
Language: C++

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

using ll = long long;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = (n-1); i >= 0; i--)
#define all(n) n.begin(), n.end()
#define print(n) cout << n << endl

ll maxpow(ll a){
    ll ans = 1;
    rep(i,a) ans *= 10;
    return ans;
}

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    
    string s;
    cin >> s;
    vector<ll> mod(2020);
    int sum=0;

    rrep(i,s.size()){
        sum = sum + (s.at(i)-'0') * pow(10,i) % 2019;
        mod[sum]++;
    }
    ll ans=0;
    rep(i,2020){
        ans += mod[i]*(mod[i]-1)/2;
    }

    print(ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:47: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
   26 |         sum = sum + (s.at(i)-'0') * pow(10,i) % 2019;
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~
      |                                   |             |
      |                                   |             int
      |                                   __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

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

using ll = long long;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = (n); i > 0; i--)
#define all(n) n.begin(), n.end()
#define print(n) cout << n << endl

ll maxpow(ll a){
    ll ans = 1;
    rep(i,a) ans *= 10;
    return ans;
}

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    
    string s;
    cin >> s;
    vector<ll> mod(2020);
    int sum=0,temp;

    rep(i,s.size()){
        sum = sum + (s.at(s.size()-i-1)-'0') * pow(10,i) % 2019;
        mod[sum]++;
    }
    ll ans=0;
    rep(i,2020){
        ans += mod[i]*(mod[i]-1)/2;
    }

    print(ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:58: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
   26 |         sum = sum + (s.at(s.size()-i-1)-'0') * pow(10,i) % 2019;
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~
      |                                              |             |
      |                                              |             int
      |                                              __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

#include <iostream>
#include <cmath>
#include <string>

// TODO big decimal
std::string div(std::string& str)
{
	if (str.size() > 10)
	{
		std::string str2 = str.substr(0, 10);
		std::string res = div(str2);
		std::string next = res + str.substr(10, str.size() - 10);
		return div(next);
	}
	else
	{
		unsigned long long ext = std::stoull(str);
		unsigned long long res = ext % 2019;
		if (res == 0) {
			return "";
		}
		else
		{
			return std::to_string(res);
		}
	}
}

int main()
{
	std::string S;
	std::cin >> S;
	unsigned int digit = S.size();
	int sum = 0;
	for (unsigned int i = 0; i < digit; i++)
	{
		for (unsigned int j = i + 1; j <= digit; j++)
		{
			std::string str = S.substr(i, j - i);
			if (str.size <= 4) continue;
			std::string res = div(str);
			/*
			unsigned long long ext = std::stoull(str);
			unsigned long long res = ext % 2019;
			if (res == 0) {
				sum++;
			}
			*/
			if(res == "")
			{
				sum++;
			}			
		}
	}
	std::cout << sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:33: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   40 |                         if (str.size <= 4) continue;
      |                             ~~~~^~~~
      |                                     ()
Language: C++

#include <array>
#include <cstdint>
#include <iostream>
#include <string>
#include <unordered_set>
#if _WIN32
#include <locale>
#endif

using i32 = std::int32_t;
using u32 = std::uint32_t;
using i64 = std::int64_t;
using u64 = std::uint64_t;

void strsub(std::string a, const std::string b) {}


bool is2019(const std::string &s) {
  using namespace std;
  static unordered_set<string> multiples_2019 = {
    "0",     "2019",  "4038",  "6057",  "8076",
    "10095", "12114", "14133", "16152", "18171"};
  if (multiples_2019.find(s) != multiples_2019.end()) return true;
  if (s.length() <= 4) return false;
  string buf(s);
  vector<string> history;
  while (buf.length() > 4) {
    history.push_back(buf);
    i32 len = stoi(buf.substr(0, 4)) < 2019 ? 5 : 4;
    auto head = stoi(buf.substr(0, len));
    auto tail = buf.substr(len, buf.length() - len);
    buf = to_string(head - (head / 2019) * 2019) + tail;
    if (multiples_2019.find(buf) != multiples_2019.end()) {
      multiples_2019.insert(history.cbegin(), history.cend());
      return true;
    }
  }
  return false;
}

int main() {
  using namespace std;
#if _WIN32
  locale::global(locale(""));
#endif
  string s;
  getline(cin, s);
  size_t n_multiples_total = 0;
  for (size_t substrlen = 4; substrlen <= s.length(); ++substrlen) {
    unordered_set<string> multiples, coprimes;
    for (size_t start = 0; start + substrlen <= s.length(); ++start) {
      const string ss = s.substr(start, substrlen);
      if (coprimes.find(ss) != coprimes.end()) {
        continue;
      }
      if (multiples.find(ss) != multiples.end()) {
        n_multiples_total++;
        continue;
      }
      if (is2019(ss)) {
        multiples.insert(ss);
        n_multiples_total++;
        continue;
      }
      coprimes.insert(ss);
    }
  }
  cout << n_multiples_total << '\n';
  return 0;
}


Compiler output:
a.cc: In function 'bool is2019(const std::string&)':
a.cc:26:3: error: 'vector' was not declared in this scope
   26 |   vector<string> history;
      |   ^~~~~~
a.cc:6:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    5 | #include <unordered_set>
  +++ |+#include <vector>
    6 | #if _WIN32
a.cc:26:16: error: expected primary-expression before '>' token
   26 |   vector<string> history;
      |                ^
a.cc:26:18: error: 'history' was not declared in this scope
   26 |   vector<string> history;
      |                  ^~~~~~~
Language: C

#include <iostream>
#include <string>
#include <map>
#include <set>
#include <cstdlib>
using namespace std;
 
int main(){
  int count=0;
  long mod=0;
  string s;
  cin >> s;
  int flag[2019];
  
  int sz=s.size();
  for(int i=0; i<2019; i++){
    flag[i]=0;
  }
  flag[0]=1;
  long val=0;
  // long mod calc
  for (int leftmost=0; leftmost<sz; leftmost++) {
    mod=0;
    for (int pos=leftmost; pos<sz; pos+=8) {
      if (sz-pos>8){
        val=atoi(s.substr(pos, 8).c_str());
        mod=mod*1e8+val;
//        cout << val;
      }else{
        val=atoi(s.substr(pos, sz-pos).c_str());
        if (val>=1e7) {
          mod=mod*1e8+val;
        } else if (val>=1e6) {
          mod=mod*1e7+val;
        } else if (val>=1e5) {
          mod=mod*1e6+val;
        } else if (val>=1e4) {
          mod=mod*1e5+val;
        } else if (val>=1e3) {
          mod=mod*1e4+val;
        } else if (val>=1e2) {
          mod=mod*1e3+val;
        } else if (val>=1e1) {
          mod=mod*1e2+val;
        } else if (val>0){
          mod=mod*10+val;
        } else {
          mod=mod+val;
        }
      }
      mod=mod%2019;     
    }
    mod=mod%2019;      
    flag[mod]++;
  }
  for(int i=0; i<2019; i++){
    if(flag[i]>=2){
      count +=(flag[i] * (flag[i]-1)) /2;
    }
  }
  cout << count << endl;
  return 0;
}



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

#include <iostream>
#include <cmath>
#include <string>
int main()
{
	std::string S;
	std::cin >> S;
	unsigned int zero = 0;
	int digit = std::log10(std::stoll(S, &zero, 10)) + 1;
	int sum = 0;
	for (int i = 0; i < digit; i++)
	{
		for (int j = i + 1; j <= digit; j++) 
		{
			std::string str = S.substr(i, j - i);
			long long ext = std::stoll(str, &zero, 10);
			if (ext == 0) continue;
			long long res = ext % 2019;
			if (res == 0) {
				sum++;
			}
			
		}
	}
	std::cout << sum;
}

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;

int main(){
  string S;
  
  cin >> S;
  
  int count = 0;
  //vector<char> emp(int N=0);
  string emp;
  
  for(int h=0; h<S.size(); h++){
    for(int i=h; i<S.size(); i++){
      emp.push_back(S.at(i));
      if(emp.size() >= 4){
        int mod = stoi(emp) % 2019;
        if(mod == 0){
          count++;
        }
        string emp = null;
      }
    }    
  }

  cout << count << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:21:22: error: 'null' was not declared in this scope
   21 |         string emp = null;
      |                      ^~~~
Language: C++

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

int main(){
  string S;
  
  cin >> S;
  
  int count = 0;
  vector<char> emp(int N=0);
  
  for(int h=0; h<S.size()-4; h++){
    for(int i=h; i<S.size()-1; i++){
      emp.push_back(S.at(i));
      if(emp.size() >= 4){
        int mod = stoi(emp) % 2019;
        if(mod == 0){
          count++;
        }
        vector<int> emp(int N=0);
      }
    }    
  }

  cout << count << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: request for member 'push_back' in 'emp', which is of non-class type 'std::vector<char>(int)'
   14 |       emp.push_back(S.at(i));
      |           ^~~~~~~~~
a.cc:15:14: error: request for member 'size' in 'emp', which is of non-class type 'std::vector<char>(int)'
   15 |       if(emp.size() >= 4){
      |              ^~~~
a.cc:16:23: error: no matching function for call to 'stoi(std::vector<char> (&)(int))'
   16 |         int mod = stoi(emp) % 2019;
      |                   ~~~~^~~~~
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 'std::vector<char>(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 'std::vector<char>(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)
      |        ~~~~~~~~~~~~~~~^~~~~
a.cc: At global scope:
a.cc:20:21: error: ambiguating new declaration of 'std::vector<int> emp(int)'
   20 |         vector<int> emp(int N=0);
      |                     ^~~
a.cc:10:16: note: old declaration 'std::vector<char> emp(int)'
   10 |   vector<char> emp(int N=0);
      |                ^~~
Language: C++

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

int main(){
  string S;
  
  cin >> S;
  
  int count = 0;
  vector<int> emp(int N=0);
  
  for(int h=0; h<S.size()-4; h++){
    for(int i=h; i<S.size()-1; i++){
      emp.push_back(S.at(i));
      if(emp.size() >= 4){
        int mod = emp % 2019;
        if(mod == 0){
          count++;
        }
        vector<int> emp(int N=0);
      }
    }    
  }

  cout << count << endl;
}


  


Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: request for member 'push_back' in 'emp', which is of non-class type 'std::vector<int>(int)'
   14 |       emp.push_back(S.at(i));
      |           ^~~~~~~~~
a.cc:15:14: error: request for member 'size' in 'emp', which is of non-class type 'std::vector<int>(int)'
   15 |       if(emp.size() >= 4){
      |              ^~~~
a.cc:16:23: error: invalid operands of types 'std::vector<int>(int)' and 'int' to binary 'operator%'
   16 |         int mod = emp % 2019;
      |                   ~~~ ^ ~~~~
      |                   |     |
      |                   |     int
      |                   std::vector<int>(int)
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:18:14: error: expected ';' before '}' token
   18 |     flag[i]=0
      |              ^
      |              ;
   19 |   }
      |   ~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:28:40: error: expected ')' before ';' token
   28 |       count +=(flag[i] * (flag[i]-1) /2;
      |               ~                        ^
      |                                        )
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 ull = unsigned long long;
using p  = pair<int, int>;
using vec_int = vector<int>;
using vec_str = vector<string>;
#define INF (1<<29)
ll ans = 0;

ll gcd(ll x, ll y) {
  return y ? gcd(y, x % y) : x;
}

ll lcm(ll a, ll b)
{
   return a * b / gcd(a, b);
}

void debug_input(vec_str& argv)
{
    // デバッグ用引数読み込み
    ifstream file("./input.txt");
    string str;
    while( getline(file, str) ) {
        argv.push_back(str);
    }
}

void debug_split_string(const string& str, vec_str& v)
{
    stringstream ss{str};
    string buf;
    while (getline(ss, buf, ' ')) {
        v.push_back(buf);
    }
}

void debug_split_int(const string& str, vec_int& v)
{
    stringstream ss{str};
    string buf;
    while (getline(ss, buf, ' ')) {
        istringstream ss(buf);
        int temp;
        ss >> temp;
        v.push_back(temp);
    }
}

int main()
{
    string S;
	cin >> S;
    int n = s.size();
    reverse(s.begin(), s.end());
    int x = 1, tot = 0;
    const int m = 2019;
    std::vector<int> cnt(m);

    rep(i, n) {
        cnt[tot]++;
        tot += (S[i] - '0')*x;
        tot %= m;
        ans += cnt[tot];
        x = (x*10) % m;
        //cout << v[i] << endl;
    }
    
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:13: error: 's' was not declared in this scope
   57 |     int n = s.size();
      |             ^
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <climits>
#include <vector>
#include <cstring>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <string.h>
#include <iomanip>
using namespace std;
#define int long long
#define ull unsigned long long
#define F first
#define S second
#define nl "\n"
#define ld long double
#define div 1000000007
#define pi 3.14159265358979323846

int power(int a,int b,int p)
{
    if(b==0)
        return 1;
    else if(b%2==0)
        return power((a*a)%p,b/2,p);
    else
        return (a*power((a*a)%p,(b-1)/2,p))%p;
}

void solve()
{
    string s;cin>>s;
    int n=s.length();
    int p=2019;
    int d[p];memset(d,0,sizeof(d));
    d[0]=1;
    int r=0;
    for(int i=0;i<n;i++)
    {
        int d=s[i]-'0';
        r=r+d*power(10,n-1-i,p)%p;
        r%=p;d[r]++;
    }
    int ans=0;
    for(int i=0;i<p;i++)
    {
        ans+=d[i]*(d[i]-1)/2;
    }
    cout<<ans<<nl;
}
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

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


Compiler output:
a.cc: In function 'void solve()':
a.cc:47:15: error: invalid types 'long long int[long long int]' for array subscript
   47 |         r%=p;d[r]++;
      |               ^
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public final class D {

    public static void main(String[] args) {
        final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        final int P = 2019;
        final char[] str = in.nextLine().toCharArray();
        final int N = str.length;
        final int[] digits = new int[N];
        for (int i = 0; i < N; i++) {
            digits[i] = Character.getNumericValue(str[i]);
        }
        final int[] remainders = new int[P];
        remainders[0] = 1;
        int sum = 0;
        int shift = 1;
        long ans = 0;
        for (int pos = N - 1; pos >= 0; pos--) {
            sum = (sum + shift * digits[pos]) % P;
            ans += remainders[sum];
            remainders[sum]++;
            shift = (shift * 10) % P;
        }
        System.out.println(ans);
    }
}


Compiler output:
Main.java:5: error: class D is public, should be declared in a file named D.java
public final class D {
             ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define loop(i,a,n) for (ll i=a;i<n;i++)
#define loopm(i,a,n) for (ll i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define Graph(n) vector < vector < ll > > (n,vector < ll >(0,0)) 
#define tr(container,it)\
for(auto it=container.begin();it!=container.end();it++)
#define SZ(x) ((int)(x).size())
typedef vector<long long> VI;
typedef long long ll;
typedef vector < vector < ll > > VII;
typedef pair<ll,ll> PII;
typedef double db;
ll ans=0;
void computeLPSArray(char* pt, ll m, ll* lps)
{
   lps[0]=0;
   len=0;
   i=1;
   while(i<m)
   {
           if(pt[len]==pt[i])
           {
               len++;
               pt[i]=len;
               i++;
           }
           else
           {
               if(len!=0)//ajeeb if else hn bhai!!
               {
                   len=lps[len-1];
               }
               else
                   lps[i++]=0;
           }
   }
}
void KMPSearch(char* pat,char* txt)
{
     ll m=strlen(pat);
     ll n=strlen(txt);
     ll lps[m];
     computeLPSArray(pat,m,lps);
     ll i=0,j=0;
     while(i<n)
     {
          if(txt[i]==pat[j])
          {
              i++;
              j++;
          }
          if(j==m)
          {
              ans++:
              j=lps[j-1];
          }
          else if(i<n&&pat[j]!=txt[i])
          {
                  if(j!=0)//ajeed if else hn bhai!!
                   j=lps[j-1];
                else
                    i++;
          }
    }
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    string s="";
    cin>>s;
    for(int i=1;i<1000;i++)
    {
        string txt=to_string(2019*i);
        ll flag=1;
        loop(i,0,txt.size())
        {
              if(txt[i]=='0')
              {
                flag=0;
                break;
              }
        }
        if(flag==1)
        {
            KMPSearch(s,txt);
        }
    }
    cout<<ans<<"\n";

}

Compiler output:
a.cc: In function 'void computeLPSArray(char*, ll, ll*)':
a.cc:23:4: error: 'len' was not declared in this scope
   23 |    len=0;
      |    ^~~
a.cc:24:4: error: 'i' was not declared in this scope
   24 |    i=1;
      |    ^
a.cc: In function 'void KMPSearch(char*, char*)':
a.cc:60:20: error: expected ';' before ':' token
   60 |               ans++:
      |                    ^
      |                    ;
a.cc: In function 'int main()':
a.cc:93:23: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'char*'
   93 |             KMPSearch(s,txt);
      |                       ^
      |                       |
      |                       std::string {aka std::__cxx11::basic_string<char>}
a.cc:44:22: note:   initializing argument 1 of 'void KMPSearch(char*, char*)'
   44 | void KMPSearch(char* pat,char* txt)
      |                ~~~~~~^~~
Language: C++

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

int main() {
    string S;
    cin >> S;
    int64_t S_size = S.size()
    if (S_size < 4) {
        cout << 0;
        return 0;
    }
    string str_num;
    int count = 0;
    int64_t num;
    for (int64_t i=0; i<S_size-3; i++) {
        for (int64_t j=i+3; j<S_size; j++) {
            int clip_len = j + 1;
            str_num = S.substr(i, clip_len);
            num = stol(str_num);
            if (num % 2019 == 0) {
                count++;
            }
        }
   }
    cout << count;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: expected ',' or ';' before 'if'
    8 |     if (S_size < 4) {
      |     ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define fr(i,k,n) for(int i=k;i<n;i++)
#define read(x) cin>>x
#define ll long long int
#define mod 1000000007 
#define print(x) cout<<x<<endl
#define pb(x) push_back(x)
#define fastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main() { 
    fastIO;
     int t=1,n;
     //cin>>t;
     while(t--){
     string s;
       cin>>s;
       unordered_map<int,int>m;
       int ans=0;
       int number=0,rem=0;
       m[0]++;
       int j=0;
       reverse(s.begin(),s.end());
       for(char i:s){
         number=((number% 2019 )+(((int)pow(10,j)% 2019)*(i-48))%2019) )%2019)% 2019  ;
         rem=number% 2019;
          //cout<<rem<<endl;
         j++;
         if(m.find(rem)!=m.end() && j>3)
         {  ans+=m[rem];
         m[rem]++;}
         else m[rem]++;
       }
       cout<<ans<<endl;  
     }
	 
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:71: error: expected ';' before ')' token
   24 |          number=((number% 2019 )+(((int)pow(10,j)% 2019)*(i-48))%2019) )%2019)% 2019  ;
      |                                                                       ^~
      |                                                                       ;
Language: C++

#include<iostream>
#include<cstdio>
#include<string.h>
#include<stdlib.h>
#include<algorithm>
#include <map>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <limits.h>
#include <string>
#include<functional>
#include <set>
#include <utility>
#include <iomanip>
#include <string>
#define INF 1<<30
#define inf 0x3f3f3f3f3f3f3f3f
#define MO 1000000007
#define MI 998244353
#define ll long long
#define woo 140737488355327
using namespace std;
char str[210010];
int vis[3000];
int main()
{
   gets(str);
   int l=strlen(str);ll cnt=0,ans=0,k=1;vis[0]=1;
   while(l--)
   {
      ans=((str[l]-'0')*k%2019+ans)%2019;
      k=k*10%2019;vis[ans]++;
      cnt+=vis[ans]-1;
   }
   printf("%lld\n",cnt);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:4: error: 'gets' was not declared in this scope; did you mean 'getw'?
   30 |    gets(str);
      |    ^~~~
      |    getw
Language: C


#include<string.h>
#include<stdlib.h>
char str[210010];
int vis[3000];
int main()
{
   gets(str);
   int l=strlen(str);ll cnt=0,ans=0,k=1;vis[0]=1;
   while(l--)
   {
      ans=((str[l]-'0')*k%2019+ans)%2019;
      k=k*10%2019;vis[ans]++;
      cnt+=vis[ans]-1;
   }
   printf("%lld\n",cnt);
}


Compiler output:
main.c: In function 'main':
main.c:8:4: error: implicit declaration of function 'gets' [-Wimplicit-function-declaration]
    8 |    gets(str);
      |    ^~~~
main.c:9:22: error: unknown type name 'll'
    9 |    int l=strlen(str);ll cnt=0,ans=0,k=1;vis[0]=1;
      |                      ^~
main.c:16:4: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   16 |    printf("%lld\n",cnt);
      |    ^~~~~~
main.c:4:1: note: include '<stdio.h>' or provide a declaration of 'printf'
    3 | #include<stdlib.h>
  +++ |+#include <stdio.h>
    4 | char str[210010];
main.c:16:4: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   16 |    printf("%lld\n",cnt);
      |    ^~~~~~
main.c:16:4: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

#include<bits/stdc++.h>



#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)

using namespace std;

template <class T>
using vec = std::vector<T>;
typedef long long ll;
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; }

const long long INF = 1LL<<60;

int lcm(int a,int b){
    //最小公倍数
    return a/__gcd(a,b) * b;
}

const int m=2019;
string S;

int main(){
    cin>>S;
    reverse(S.begin(),S.end());
    int x=1,tot=0;
    int n=S.size();
    //cnt(2019):累積和(mod2019)が何個有るかを数える。(0-2018)
    //同じ値のものが２つあれば、そのセットでmod2019が0になる
    vec<ll> cnt(m);
    ll ans=0;
    rep(i,n){　
        cnt[tot]++;
        tot+=(S[i]-'0')*x;//各桁の数を取得
        tot%=m; //modにする
        ans+=cnt[tot];
        x=x*10%m; 
    }
    cout<<ans<<endl;
    return 0;

}


Compiler output:
a.cc:35:14: error: extended character 　 is not valid in an identifier
   35 |     rep(i,n){　
      |              ^
a.cc: In function 'int main()':
a.cc:35:14: error: '\U00003000' was not declared in this scope
   35 |     rep(i,n){　
      |              ^~
Language: C++

#include<bits/stdc++.h>



#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)

using namespace std;

template <class T>
using vec = std::vector<T>;
typedef long long ll;
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; }

const long long INF = 1LL<<60;

int lcm(int a,int b){
    //最小公倍数
    return a/__gcd(a,b) * b;
}

const int m=2019;
string S;

int main(){
    cin>>S;
    reverse(S.begin(),S.end());
    int x=1,tot=0;
    int n=S.size();
    //cnt(2019):累積和(mod2019)が何個有るかを数える。(0-2018)
    //同じ値のものが２つあれば、そのセットでmod2019が0になる
    vec<ll> cnt(m);
    ll ans=0;
    rep(i,n){　
        cnt[tot]++;
        tot+=(s[i]-'0')*x;//各桁の数を取得
        tot%=m; //modにする
        ans+=cnt[tot];
        x=x*10%m; 
    }
    cout<<ans<<endl;
    return 0;

}


Compiler output:
a.cc:35:14: error: extended character 　 is not valid in an identifier
   35 |     rep(i,n){　
      |              ^
a.cc: In function 'int main()':
a.cc:35:14: error: '\U00003000' was not declared in this scope
   35 |     rep(i,n){　
      |              ^~
a.cc:37:15: error: 's' was not declared in this scope
   37 |         tot+=(s[i]-'0')*x;//各桁の数を取得
      |               ^
Language: C++

#include<bits/stdc++.h>



#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)

using namespace std;

template <class T>
using vec = std::vector<T>;
typedef long long ll;
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; }

const long long INF = 1LL<<60;

int lcm(int a,int b){
    //最小公倍数
    return a/__gcd(a,b) * b;
}

const int m=2019;
string S;

int main(){
    cin>>S;
    reverse(S.begin(),S.end());
    int x=1,tot=0;
    int n=S.size();
    //cnt(2019):累積和(mod2019)が何個有るかを数える。(0-2018)
    //同じ値のものが２つあれば、そのセットでmod2019が0になる
    vec<ll> cnt(m);
    ll ans=0;
    loop(i,n){　
        cnt[tot]++;
        tot+=(s[i]-'0')*x;//各桁の数を取得
        tot%=m; //modにする
        ans+=cnt[tot];
        x=x*10%m; 
    }
    cout<<ans<<endl;
    return 0;

}

Compiler output:
a.cc:35:13: error: macro "loop" requires 3 arguments, but only 2 given
   35 |     loop(i,n){　
      |             ^
a.cc:5:9: note: macro "loop" defined here
    5 | #define loop(i,a,b) for(int i=a;i<b;i++)
      |         ^~~~
a.cc:35:15: error: extended character 　 is not valid in an identifier
   35 |     loop(i,n){　
      |               ^
a.cc: In function 'int main()':
a.cc:35:5: error: 'loop' was not declared in this scope
   35 |     loop(i,n){　
      |     ^~~~
Language: C++

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

ll solve(const string &S){
    int N = S.size();
    std::vector<ll> val(2019,0);
    ll fac = 1;
    ll cur = 0;
    val[cur]++;
    rep(i,N){
        ll add = S[N-1-i] -'0';
        cur = (cur+fac*add)%2019;
        val[cur]++;
        fac = (fac*10)%2019;
    }
    ll res = 0;
    rep(i,val.size()){
        res += val[i]*(val[i]-1)/2;
    }
    return res;
}

int main(){
    string S;
    cin >> S;
    cout << solve(S) << endl;
}


Compiler output:
a.cc:5:7: error: expected nested-name-specifier before 'll'
    5 | using ll long long;
      |       ^~
a.cc:7:1: error: 'll' does not name a type
    7 | ll solve(const string &S){
      | ^~
a.cc: In function 'int main()':
a.cc:29:13: error: 'solve' was not declared in this scope
   29 |     cout << solve(S) << endl;
      |             ^~~~~
Language: C

#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i < (int)(n); i++)
#define Sort(a) sort(a.begin(), a.end())
typedef long long int ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
template <class T> inline bool chmax(T& a,T b){if(a<b){a=b;return true;} return false;}
template <class T> inline bool chmin(T& a,T b){if(a>b){a=b;return true;} return false;}

int sum[200200];

int main(){
    string s;
    cin >> s;
    map<int, int> m;
    int fac = 1;
    m[0]++;
    rep(i, s.length()){
        sum[i+1] = sum[i] + fac*(s[s.length()-i-1] - '0');
        sum[i+1] = sum[i+1] % 2019;
        m[sum[i+1]]++;
        fac = (fac*10) % 2019;
    }
    ll ans = 0;
    for(auto p: m){
        auto a = p.second;
        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++

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

int main()
{
	string s;
  	cin >> s;
  	int n = s.size();
  	vector<int> sum(n);
  	reverse(s.begin(), s.end());
  	for(int i = 0; i < n; i++)
    {
      	
    	sum[i] = pow(10, i) * (s.at(i) + '0');
      	if(i > 0)
        {
        	sum[i] += sum[i - 1];
        }
      	pow10 *= 10;
      	sum[i] %= 2019;
    }
  	sort(sum.begin(), sum.end());
  	int ans = 0;
  	for(int i = 0; i < n; i++)
    {
    	int cnt = 1;
      	if(sum[i] == sum[i+1] && i < n - 1)
        {
        	cnt++;
        }
      	else
        {
        	ans += cnt * (cnt - 1) / 2;
          	cnt = 1;
        }
    }
  	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'pow10' was not declared in this scope
   19 |         pow10 *= 10;
      |         ^~~~~
Language: C++

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

int main()
{
	string s;
  	cin >> s;
  	int n = s.size();
  	int sum[n];
  	int pow10 = 1;
  	reverse(s.begin(), s.end());
  	for(int i = 0; i < n; i++)
    {
      	
    	sum[i] = pow10 * (s.at(i) + '0');
      	if(i > 1)
        {
        	sum[i] += sum[i - 1];
        }
      	pow10 *= 10;
    }
  	for(int i = 0; i < n; i++)
    {
    	sum[i] %= 2019;
    }
  	sort(sum.begin(), sum.end());
  	int ans = 0;
  	for(int i = 0; i < n; i++)
    {
    	int cnt = 1;
      	if(sum[i] == sum[i+1] && i < n - 1)
        {
        	cnt++;
        }
      	else
        {
        	ans += cnt * (cnt - 1) / 2;
          	cnt = 1;
        }
    }
  	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:18: error: request for member 'begin' in 'sum', which is of non-class type 'int [n]'
   26 |         sort(sum.begin(), sum.end());
      |                  ^~~~~
a.cc:26:31: error: request for member 'end' in 'sum', which is of non-class type 'int [n]'
   26 |         sort(sum.begin(), sum.end());
      |                               ^~~
Language: C++

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

int main()
{
	string s;
  	cin >> s;
  	int n = s.size();
  	int sum[n];
  	int pow10 = 1;
  	reverse(s.begin(), s.end());
  	for(int i = 0; i < n; i++)
    {
      	
    	sum[i] = pow10 * (s.at(i) + '0');
      	if(i > 1)
        {
        	sum[i] += sum[i - 1];
        }
      	pow *= 10;
    }
  	for(int i = 0; i < n; i++)
    {
    	sum[i] %= 2019;
    }
  	sort(sum.begin(), sum.end());
  	int ans = 0;
  	for(int i = 0; i < n; i++)
    {
    	int cnt = 1;
      	if(sum[i] == sum[i+1] && i < n - 1)
        {
        	cnt++;
        }
      	else
        {
        	ans += cnt * (cnt - 1) / 2;
          	cnt = 1;
        }
    }
  	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:16: error: overloaded function with no contextual type information
   20 |         pow *= 10;
      |                ^~
a.cc:26:18: error: request for member 'begin' in 'sum', which is of non-class type 'int [n]'
   26 |         sort(sum.begin(), sum.end());
      |                  ^~~~~
a.cc:26:31: error: request for member 'end' in 'sum', which is of non-class type 'int [n]'
   26 |         sort(sum.begin(), sum.end());
      |                               ^~~
Language: C++

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

int main()
{
	string s;
  	cin >> s;
  	int n = s.size()
  	int sum[n];
  	int pow10 = 1;
  	reverse(s.begin(), s.end());
  	for(int i = 0; i < n; i++)
    {
      	
    	sum[i] = pow10 * (s.at(i) + '0');
      	if(i > 1)
        {
        	sum[i] += sum[i - 1];
        }
      	pow *= 10;
    }
  	for(int i = 0; i < n; i++)
    {
    	sum[i] %= 2019;
    }
  	sort(sum.begin(), sum.end());
  	int ans = 0;
  	for(int i = 0; i < n; i++)
    {
    	int cnt = 1;
      	if(sum[i] == sum[i+1] && i < n - 1)
        {
        	cnt++;
        }
      	else
        {
        	ans += cnt * (cnt - 1) / 2;
          	cnt = 1;
        }
    }
  	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: expected ',' or ';' before 'int'
    9 |         int sum[n];
      |         ^~~
a.cc:15:9: error: 'sum' was not declared in this scope
   15 |         sum[i] = pow10 * (s.at(i) + '0');
      |         ^~~
a.cc:20:16: error: overloaded function with no contextual type information
   20 |         pow *= 10;
      |                ^~
a.cc:24:9: error: 'sum' was not declared in this scope
   24 |         sum[i] %= 2019;
      |         ^~~
a.cc:26:14: error: 'sum' was not declared in this scope
   26 |         sort(sum.begin(), sum.end());
      |              ^~~
Language: C++

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

int main()
{
	string s;
  	cin >> s;
  	vector<int> sum(s.size());
  	int pow10 = 1;
  	reverse(s.begin(), s.end());
  	for(int i = 0; i < s.size(); i++)
    {
      	
    	sum[i] = pow10 * (s.at(i) + '0');
      	if(i > 1)
        {
        	sum[i] += sum[i - 1];
        }
      	pow *= 10;
    }
  	for(int i = 0; i < s.size(); i++)
    {
    	sum[i] %= 2019;
    }
  	sort(sum.begin(), sum.end());
  	int ans = 0;
  	for(int i = 0; i <= s.size(); i++)
    {
    	int cnt = 1;
      	if(sum[i] == sum[i+1] && i < s.size() - 1)
        {
        	cnt++;
        }
      	else
        {
        	ans += cnt * (cnt - 1) / 2;
          	cnt = 1;
        }
    }
  	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:16: error: overloaded function with no contextual type information
   19 |         pow *= 10;
      |                ^~
Language: C++

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

int main()
{
	string s;
  	cin >> s;
  	int sum[s.size()];
  	int pow10 = 1;
  	reverse(s.begin(), s.end());
  	for(int i = 0; i < s.size(); i++)
    {
      	
    	sum[i] = pow10 * (s.at(i) + '0');
      	if(i > 1)
        {
        	sum[i] += sum[i - 1];
        }
      	pow *= 10;
    }
  	for(int i = 0; i < s.size(); i++)
    {
    	sum[i] %= 2019;
    }
  	sort(sum.begin(), sum.end());
  	int ans = 0;
  	for(int i = 0; i <= s.size(); i++)
    {
    	int cnt = 1;
      	if(sum[i] == sum[i+1] && i < s.size() - 1)
        {
        	cnt++;
        }
      	else
        {
        	ans += cnt * (cnt - 1) / 2;
          	cnt = 1;
        }
    }
  	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:16: error: overloaded function with no contextual type information
   19 |         pow *= 10;
      |                ^~
a.cc:25:18: error: request for member 'begin' in 'sum', which is of non-class type 'int [<anonymous>]'
   25 |         sort(sum.begin(), sum.end());
      |                  ^~~~~
a.cc:25:31: error: request for member 'end' in 'sum', which is of non-class type 'int [<anonymous>]'
   25 |         sort(sum.begin(), sum.end());
      |                               ^~~
Language: C++

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

int main()
{
	string s;
  	cin >> s;
  	int sum[s.size()];
  	int pow10 = 1;
  	for(int i = s.size() - 1; i >= 0; i--)
    {
      	
    	sum[s.size() - 1 - i] = pow10 * (s.at(i) + '0');
      	if(i < s.size() - 1)
        {
        	sum[s.size() - 1 - i] += sum[s.size() - i];
        }
      	pow *= 10;
    }
  	for(int i = 0; i < s.size(); i++)
    {
    	sum[i] %= 2019;
    }
  	sort(sum.begin(), sum.end());
  	int ans = 0;
  	for(int i = 0; i <= s.size(); i++)
    {
    	int cnt = 1;
      	if(sum[i] == sum[i+1] && i < s.size() - 1)
        {
        	cnt++;
        }
      	else
        {
        	ans += cnt * (cnt - 1) / 2;
          	cnt = 1;
        }
    }
  	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:16: error: overloaded function with no contextual type information
   18 |         pow *= 10;
      |                ^~
a.cc:24:18: error: request for member 'begin' in 'sum', which is of non-class type 'int [<anonymous>]'
   24 |         sort(sum.begin(), sum.end());
      |                  ^~~~~
a.cc:24:31: error: request for member 'end' in 'sum', which is of non-class type 'int [<anonymous>]'
   24 |         sort(sum.begin(), sum.end());
      |                               ^~~
Language: C++

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

int k[2020],f[2000005],a[2000005],g[2000005];
l sum;

int main()
{
	string s;
	cin>>s;
	int n=s.size();
	for(int i=0; i<n; i++)
		a[i+1]=s[i]-48;
	
	int l=1;
	for(int i=n; i>=1; i--)
	{
		g[i]=l;
		l*=10;
		l%=2019;
	}
	
	for(int i=n; i>=1; i--)
	{
		f[i]=(f[i+1]+a[i]*g[i])%2019;
		k[f[i]]++;
	}
	
	sum=k[0];
	sum+=(k[0]*(k[0]-1)/2);
	
	for(int i=1; i<=2018; i++)
		sum+=(k[i]*(k[i]-1)/2);
	
	cout<<sum<< endl;
	return 0;
}


Compiler output:
a.cc:6:1: error: 'l' does not name a type; did you mean 'll'?
    6 | l sum;
      | ^
      | ll
a.cc: In function 'int main()':
a.cc:30:9: error: 'sum' was not declared in this scope
   30 |         sum=k[0];
      |         ^~~
Language: C++

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

int main()
{
	string s;
  	cin >> s;
  	int sum[s.size()];
  	int pow10 = 1;
  	for(int i = s.size() - 1;	i >= 0;	i--)
    {
      	
    	sum[s.size() - 1 - i] = pow10 * (s.at(i) + '0');
      	if(i < s.size() - 1)
        {
        	sum[s.size() - 1 - i] += sum[s.size() - i];
        }
      	pow *= 10;
    }
  	for(int i = 0; i < s.size(); i++)
    {
    	sum[i] %= 2019;
    }
  	sort(sum.begin(), sum.end());
  	int ans = 0;
  	for(int i = 0; i <= s.size(); i++)
    {
    	int cnt = 1;
      	if(sum[i] == sum[i+1] && i < s.size() - 1)
        {
        	cnt++;
        }
      	else
        {
        	ans += cnt * (cnt - 1) / 2;
          	cnt = 1;
        }
    }
  	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:16: error: overloaded function with no contextual type information
   18 |         pow *= 10;
      |                ^~
a.cc:24:18: error: request for member 'begin' in 'sum', which is of non-class type 'int [<anonymous>]'
   24 |         sort(sum.begin(), sum.end());
      |                  ^~~~~
a.cc:24:31: error: request for member 'end' in 'sum', which is of non-class type 'int [<anonymous>]'
   24 |         sort(sum.begin(), sum.end());
      |                               ^~~
Language: C++

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

int main()
{
	string s;
  	cin >> s;
  	int sum[s.size()];
  	int pow10 = 1;
  	for(int i = s.size() - 1;	i >= 0;	i--)
    {
      	
    	sum[s.size() - 1 - i] = pow10 * (s.at(i) + '0');
      	if(i < s.size() - 1)
        {
        	sum[s.size() - 1 - i] += sum[s.size() - i];
        }
      	pow *= 10;
    }
  	for(int i = 0; i < s.size(); i++)
    {
    	sum[i] %= 2019;
    }
  	sort(sum.begin(), sum.end());
  	int ans = 0;
  	for(int i = 0; i <= s.size(); i++)
    {
    	int cnt = 1;
      	if(sum[i] == sum[i+1] && i < s.size() - 1)
        {
        	cnt++;
        }
      	else
        {
        	ans += cnt * (cnt - 1) / 2;
          	cnt = 1;
        }
    }
  	cout << ans << endl;
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:9: error: 'string' was not declared in this scope
    6 |         string s;
      |         ^~~~~~
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin >> s;
      |         ^~~
a.cc:7:16: error: 's' was not declared in this scope
    7 |         cin >> s;
      |                ^
a.cc:13:9: error: 'sum' was not declared in this scope
   13 |         sum[s.size() - 1 - i] = pow10 * (s.at(i) + '0');
      |         ^~~
a.cc:18:9: error: 'pow' was not declared in this scope; did you mean 'pow10'?
   18 |         pow *= 10;
      |         ^~~
      |         pow10
a.cc:22:9: error: 'sum' was not declared in this scope
   22 |         sum[i] %= 2019;
      |         ^~~
a.cc:24:14: error: 'sum' was not declared in this scope
   24 |         sort(sum.begin(), sum.end());
      |              ^~~
a.cc:24:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   24 |         sort(sum.begin(), sum.end());
      |         ^~~~
      |         short
a.cc:39:9: error: 'cout' was not declared in this scope
   39 |         cout << ans << endl;
      |         ^~~~
a.cc:39:24: error: 'endl' was not declared in this scope
   39 |         cout << ans << endl;
      |                        ^~~~
Language: C++

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

int main()
{
	string s;
  	cin >> s;
  	int sum[s.size()];
  	int pow10 = 1;
  	for(int i = s.size() - 1;	i >= 0;	i--)
    {
      	
    	sum[s.size() - 1 - i] = pow10 * (s.at(i) + '0');
      	if(i < s.size() - 1)
        {
        	sum[s.size() - 1 - i] += sum[s.size() - i];
        }
      	pow *= 10;
    }
  	for(int i = 0; i < s.size(); i++)
    {
    	sum[i] %= 2019;
    }
  	sort(sum.begin(), sum.end());
  	int ans = 0;
  	for(int i = 0; i <= s.size(); i++)
    {
    	int cnt = 1;
      	if(sum[i] == sum[i+1] && i < s.size() - 1)
        {
        	cnt++;
        }
      	else
        {
        	ans += cnt * (cnt - 1) / 2;
          	cnt = 1;
        }
    }
  	cout << ans << endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:9: error: 'string' was not declared in this scope
    6 |         string s;
      |         ^~~~~~
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin >> s;
      |         ^~~
a.cc:7:16: error: 's' was not declared in this scope
    7 |         cin >> s;
      |                ^
a.cc:13:9: error: 'sum' was not declared in this scope
   13 |         sum[s.size() - 1 - i] = pow10 * (s.at(i) + '0');
      |         ^~~
a.cc:18:9: error: 'pow' was not declared in this scope; did you mean 'pow10'?
   18 |         pow *= 10;
      |         ^~~
      |         pow10
a.cc:22:9: error: 'sum' was not declared in this scope
   22 |         sum[i] %= 2019;
      |         ^~~
a.cc:24:14: error: 'sum' was not declared in this scope
   24 |         sort(sum.begin(), sum.end());
      |              ^~~
a.cc:24:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   24 |         sort(sum.begin(), sum.end());
      |         ^~~~
      |         short
a.cc:39:9: error: 'cout' was not declared in this scope
   39 |         cout << ans << endl;
      |         ^~~~
a.cc:39:24: error: 'endl' was not declared in this scope
   39 |         cout << ans << endl;
      |                        ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  string s,a;
  int t=0,b;
  for(int i=0;i<s.size();i++){
    for(int j=1;j+i<s.size()+1;j++){
      a=substr(i,i+j);
      b=stoi(a);
      if(b%2019==0) t++;
    }
  }
  cout<<t<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'substr' was not declared in this scope; did you mean 'strstr'?
    8 |       a=substr(i,i+j);
      |         ^~~~~~
      |         strstr
Language: C

#include <bits/stdc++.h>
#define X first
#define Y second
#define pb push_back
#define pii pair<int, int>
typedef long long ll;
using namespace std;

const int MOD = 1e9 + 7;
const ll INF = 1e18;
const int OFF = (1 << 20);

string s;
int pot[200002];
int post[3000];

int main () {

	cin >> s;
	int n = s.size();
	pot[0] = 1;
	for (int i = 1; i <= n; i++) {
		pot[i] = pot[i-1] * 10;
		pot[i] %= 2019;
	}
	
	ll sol = 0;
	int zbr = 0;
	post[0] = 1;
	for (int i = n-1; i >= 0; i--) {
		zbr += pot[n-1-i]*(s[i]-'0');
		zbr %= 2019;
		//14282668646cout << zbr << " " << post[zbr] << endl;
		sol += post[zbr];
		post[zbr] ++;
	}
	
	cout << sol;

	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++

from collections import defaultdict

s = input()
n = len(s)
t = defaultdict(int)
f = 0
t[0] = 1
for i in range(n, -1, -1):
	v = (f + (10**((n-i)%2019) * int(s[i-1]))%2019) % 2019
	t[v] += 1
	f = v
	
res = 0
for v in t.values():
	res += (v * (v - 1) // 2)

print(res)

Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from collections import defaultdict
      | ^~~~
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(void){
    string s;
    cin >> s;
    reverse(s.begin(), s.end());
    vector<int> cnt(2019);
    int x = 1, tot = 0;
    ll ans = 0;
    rep(i, s.size()){
        cnt[tot]++;
        tot = (tot + (s[i] - '0') * x) % 2019;
        ans += cnt[tot];
        x = x * 10 % 2019;
    }
    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.