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

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

#define int long long
#define MOD 1000000007

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define all(i) (i).begin(), (i).end()
#define rall(i) (i).begin(), (i).end(), greater<int>()
#define elif else if
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fst first
#define sec second
template <typename T>
void print(T x)
{
    std::cout << x << '\n';
}
typedef long long ll;

int _index[200000][200000];
string s;

int cToi(char x)
{
    return x - '0';
}

int ans = 0;

int fun(int a, int b)
{

    if (a == b)
    {
        return cToi(s[a]);
    }
    if (_index[a][b] != 0)
    {

        return _index[a][b];
    }
    else
    {
        int temp = fun(a, b - 1) * 10 + cToi(s[b]);
        if (temp % 2019 == 0)
        {

            ans++;
        }

        return temp;
    }
}

signed main()
{
    cin >> s;

    int len = s.size();

    if (len < 4)
    {
        cout << "0" << endl;
        return 0;
    }

    for (int i = 0; i < len; i++)
    {
        fun(i, len - 1);
    }

    cout << ans << endl;
}


Compiler output:
/tmp/ccWkoLw1.o: in function `fun(long long, long long)':
a.cc:(.text+0x39): relocation truncated to fit: R_X86_64_PC32 against symbol `s[abi:cxx11]' defined in .bss section in /tmp/ccWkoLw1.o
a.cc:(.text+0xdf): relocation truncated to fit: R_X86_64_PC32 against symbol `s[abi:cxx11]' defined in .bss section in /tmp/ccWkoLw1.o
a.cc:(.text+0x13a): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccWkoLw1.o
a.cc:(.text+0x145): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccWkoLw1.o
/tmp/ccWkoLw1.o: in function `main':
a.cc:(.text+0x15e): relocation truncated to fit: R_X86_64_PC32 against symbol `s[abi:cxx11]' defined in .bss section in /tmp/ccWkoLw1.o
a.cc:(.text+0x177): relocation truncated to fit: R_X86_64_PC32 against symbol `s[abi:cxx11]' defined in .bss section in /tmp/ccWkoLw1.o
a.cc:(.text+0x1f3): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccWkoLw1.o
/tmp/ccWkoLw1.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x229): relocation truncated to fit: R_X86_64_PC32 against symbol `s[abi:cxx11]' defined in .bss section in /tmp/ccWkoLw1.o
a.cc:(.text+0x242): relocation truncated to fit: R_X86_64_PC32 against symbol `s[abi:cxx11]' defined in .bss section in /tmp/ccWkoLw1.o
collect2: error: ld returned 1 exit status
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);if(!(atoi(p.c_str()))%2019)x++;}
           cout<<x<<endl;}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:12: error: expected unqualified-id before 'for'
    4 |            for(int i=0;i<b-3;i++)for(int j=4;j<b-i+1;j++){string p=S.substr(i,j);if(!(atoi(p.c_str()))%2019)x++;}
      |            ^~~
a.cc:4:24: error: 'i' was not declared in this scope
    4 |            for(int i=0;i<b-3;i++)for(int j=4;j<b-i+1;j++){string p=S.substr(i,j);if(!(atoi(p.c_str()))%2019)x++;}
      |                        ^
a.cc:4:46: error: 'j' was not declared in this scope
    4 |            for(int i=0;i<b-3;i++)for(int j=4;j<b-i+1;j++){string p=S.substr(i,j);if(!(atoi(p.c_str()))%2019)x++;}
      |                                              ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define FOR(i,l,r) for(i=l;i<r;i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define P pair<ll,ll>
#define F first
#define S second
signed main(){
  string s;cin>>s;
  ll N=s.size(),i,j,ans=0;
  vector<vector<ll>>DP(N,vector<ll>(2019,0));
  vector<ll>S(N);
  REP(i,N)S.at(i)=s.at(i)-'0';
  REP(i,N)DP.at(i).at(S.at(i))=1;
  REP(i,N-1)REP(j,2019)DP.at(i+1).at((S.at(i+1)+10*j)%2019)+=DP.at(i).at(j);
  REP(i,N)ans+=DP.at(i)(0);
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:24: error: no match for call to '(__gnu_cxx::__alloc_traits<std::allocator<std::vector<long long int> >, std::vector<long long int> >::value_type {aka std::vector<long long int>}) (int)'
   18 |   REP(i,N)ans+=DP.at(i)(0);
      |                ~~~~~~~~^~~
Language: C

#include <stdio.h>
#include <iostream>
#include <sstream>
using namespace std;

int main()
{
  string s;
  int ans = 0, i, j;
  istringstream ss1;
  int p1;
  cin >> s;
  for(i = 0; i < s.size()-3; i++) {
    for(j = i+3; j < s.size(); j++) {
      ss1 = istringstream(s.substr(i,j-i+1));
  	  ss1 >> p1;
      if(p1 % 2019 == 0) {
        ans++;
      }
    }
  }
  cout << ans << "\n";
  return 0;
}

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

#include <bits/stdc++.h>
#define ALL(a)  (a).begin(),(a).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<long long, long long> Pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
template <typename T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template <typename T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
const int INT_INF = 1 << 30;
#define MOD 1000000007LL
#define endl "\n"

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  string S;
  cin >> S;
  int N = S.size();
  vvll dp(N+1, vll(2019, 0));
  ll initial = S.at(0) - '0';
  dp.at(1).at(initial) = 1;
  for(int i = 1; i < N; i++){
    ll num = S.at(i) - '0';
    for(int j = 0; j < 2019; j++){
      dp.at(i+1).at((10*j + num) % 2019) += dp.at(i).at(j);
    }
    dp.at(i+1).at(num)++;
  }
  ll ans = 0;
  for(int i = 1; i <= N; i++){
    ans += dp.at(i).at(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 <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <numeric>
#include <set>
#include <cstdlib>
#include <queue>

using namespace std;

typedef long long llint;
typedef long double ld;
#define inf 1e18
#define mod 1000000007
priority_queue<llint,vector<llint>,greater<llint>> que;
priority_queue<llint> q;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

string s;

bool judge(llint x){
	if(x%2019==0)return true;
	else return false;
}

void solve(){
	cin >> s;
	llint n=s.size();
	llint ans=0;
	for(int i=0;i<n-3;i++){
		for(int j=4;j<n-i+1;j++){
			string ss;
			ss=s.substr(i,j);
			if(ss.size()>20)break;
			llint x=atoll(ss.c_str());
			x%=mod;
			if(judge(x))ans++;
		}
	}
	cout << ans << endl;
}

int main() {
  solve();
  return 0;
}


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

#include <stdio.h>
#include <string>
#include <iostream>
#include <sstream>
using namespace std;

int main()
{
  string s;
  int ans = 0, i, j;
  istringstream ss1;
  int p1;
  cin >> s;
  for(i = 0; i < s.size()-3; i++) {
    for(j = i+3; j < s.size(); j++) {
      ss1 = istringstream(s.substr(i,j-i+1));
  	  ss1 >> p1;
      if(p1 % 2019 == 0) {
        ans++;
      }
    }
  }
  cout << ans << "\n";
  return 0;
}

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

#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
    string cad; cin >> cad;
    ll i, j, nn = 0, ans = 0;
    for(i = 0; i < cad.size(); i++){
        nn = 0;
        for(j = i; j < cad.size(); j++){
            nn = (nn * 10) + (cad[j] - '0');
            if(nn % 2019 == 0){
                ans ++;
                i = j - 1
            }
        }
    }
    cout << ans << "\n";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:26: error: expected ';' before '}' token
   13 |                 i = j - 1
      |                          ^
      |                          ;
   14 |             }
      |             ~
Language: C++

#include <iostream>
#include <cstring>
using namespace std;

int main(){
  string num;
  cin >> num;
  int i,j;
  int counter=0;
  for(j=0;j<strlen(num);j++){
    for(i=0;i<j;i++){
      if(stoi(num.substr(i,j))%2019==0){
        counter++;
      }
    }
  }
  return 0;
}
      


Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   10 |   for(j=0;j<strlen(num);j++){
      |                    ^~~
      |                    |
      |                    std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstring:43,
                 from a.cc:2:
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
Language: C

// https://atcoder.jp/contests/abc164/tasks/abc164_d
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) FOR(i, 0, n)
#define REPR(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()
#define DIV(a, b) ((a - 1) / b + 1)

unordered_set<string> st;
bool judge(string s) {
    int cnt = 0;
    string str = s;
    reverse(ALL(str));

    REP(i, (str.length() + 1) / 4) {
        string t = str.substr(i, i + 4);
        reverse(ALL(t));
        if (st.count(t) > 0) {
            cnt++;
        }
    }
    return (cnt > 0);
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    string S;
    cin >> S;
    int n = 0;
    while (n <= 100000000) {
        n += 2019;
        string s = to_string(n);
        if (s.find('0') == string::npos) {
            st.insert(s);
        }
    }

    int len = S.length();
    int ans = 0;
    REP(i, len) {
        for (int j = 4; i + j <= len; j++) {
            string y = S.substr(i, j);
            if (judge(y)) {
                ans++;
            }
        }
    }
    cout << ans << endl;

    return 0;
}


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

int main(){
  string num;
  cin >> num;
  int i,j;
  int counter=0;
  for(j=0;j<strlen(num);j++){
    for(i=0;i<j;i++){
      if(stoi(num.substr(i,j))%2019==0){
        counter++;
      }
    }
  }
  return 0;
}
      


Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: 'strlen' was not declared in this scope
    9 |   for(j=0;j<strlen(num);j++){
      |             ^~~~~~
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 | using namespace std;
Language: C++

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

int main() {
  string S;
  cin >>S;
  int a=0;
  for(int i=0;i < S.size();i++){
    for(int j=0;i <= j && j < S.size();j++){
      string sss = S.substr(i,j-i+1);
      int num;
      num = atoi(sss);
      if(num%2019 == 0){
        a++;
      }
  cout << a << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   12 |       num = atoi(sss);
      |                  ^~~
      |                  |
      |                  std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
a.cc:17:2: error: expected '}' at end of input
   17 | }
      |  ^
a.cc:8:32: note: to match this '{'
    8 |   for(int i=0;i < S.size();i++){
      |                                ^
a.cc:17:2: error: expected '}' at end of input
   17 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define rep(i, a, b) for(int ll = a; i < b; i++)
const int mod = 1e9 + 7;
int main()
{

  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  string s;
  cin >> s;
  ll n=s.size();
  string f;
  ll c=0;
  rep(i,0,n-4)
  {
      rep(j,4,n+1){
          f=s.substr(i,j);
          ll a=stoll(f);
         // cout<<a<<" ";
          if(a%2019==0){c++;}
          if(i+j==n)break;
      }
  }
  cout<<c;
  

} 

Compiler output:
a.cc: In function 'int main()':
a.cc:16:7: error: 'i' was not declared in this scope
   16 |   rep(i,0,n-4)
      |       ^
a.cc:5:38: note: in definition of macro 'rep'
    5 | #define rep(i, a, b) for(int ll = a; i < b; i++)
      |                                      ^
a.cc:18:11: error: 'j' was not declared in this scope
   18 |       rep(j,4,n+1){
      |           ^
a.cc:5:38: note: in definition of macro 'rep'
    5 | #define rep(i, a, b) for(int ll = a; i < b; i++)
      |                                      ^
a.cc:20:13: error: expected ';' before 'a'
   20 |           ll a=stoll(f);
      |             ^~
      |             ;
a.cc:22:14: error: 'a' was not declared in this scope
   22 |           if(a%2019==0){c++;}
      |              ^
Language: C++

#include<bits/stdc++.h>
#define io ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define PI atan(1)*4
typedef long long int ll;
using namespace std;
char s[200005];
char str[105][200005];
int fun2(char* str,char* sub)
{
int num = 0;
for (char* pstr=str; *pstr && (pstr=strstr(pstr,sub)); pstr++,num++);
return num;
}
int main(){
	io;
	cin >> s;
	int l = strlen(s);
	int t;
	for(int i = 1;i <= 100;++i){
		t = i*2019;
		itoa(t,str[i],10);
	}
	int ans = 0;
	for(int i = 1;i <= 100;++i){
		if(strstr(s,str[i]) != NULL){
			ans += fun2(s,str[i]);
		//	cout << str[i] << endl;
		}
	}
	cout << ans;
	return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: 'itoa' was not declared in this scope
   21 |                 itoa(t,str[i],10);
      |                 ^~~~
Language: C

#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<string.h>
#include<math.h>
#include<map>

#define MOD 1e9+7;
#define INF 1e17+9;
#define PI acos(-1);

typedef long long LL;

using namespace std;

int main(){
	
	string s;
	cin >> s;
	
	LL cnt=0;
	LL num=0;
	
	for(LL i=0;i<s.size();i++){
		num=0;
		for(LL j=i;j<s.size();j++){
			num*=10;
			num+=(s[j]-'0');
			if(num%2019==0){
				cnt++;
				i=j-1;
				break;
			}
		}
	}

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


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

import java.util.*;
import java.lang.*;

public class Main4{

    public static long solve(String str){//healt , str
        long num = 0;
        long ans = 0;
        for(int i = 0 ; i < str.length() - 2 ; i++){
            num = 0;
            for(int j = i ; j < str.length(); j++){
                num = num*10 + (int)(str.charAt(j)-'0');
                // System.out.println(num);
                if((num % 2019) == 0){
                    ans++;
                    // num %= 2019;
                } 
                
            }
        }

        return ans;
    }

    public static void gora(){
        Scanner scn = new Scanner(System.in);

        // long test = scn.nextLong();

        // long n = scn.nextLong();

        // String[] arr = new String[(int)n];
        // long b = scn.nextLong();


        // long c = scn.nextLong();

        // long d = scn.nextLong();
        // long arr[] = new long[n];
        String str = scn.nextLine();
        // for(int i = 0 ; i < arr.length ; i++){
        //     arr[i] = scn.nextLine();
        // }

        System.out.println(solve(str));
    }

    public static void main(String args[]){
        gora();
    }
}




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

using namespace std;
using ll = long long;
int main(){
    string s;
    cin >> s;
    ll sum=0;
    ll sik=0;
    ll size=s.size();
    ll i,j,k;
    for(i=0;i+4<=size;i++){
        for(j=4;i+j<size;j++){
            string sd;
            for(k=i;k<=i+j;k++){
                sd+=s.at(k);
                sik++;
            }
            ll num=atoll(sd.c_str());
            if(num%2019==0){
                sum++;
                cout << i << " " << i+j << endl;
                }
        }
    }

    cout <<sum << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'string' was not declared in this scope
    4 |     string s;
      |     ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | using namespace std;
a.cc:5:5: error: 'cin' was not declared in this scope
    5 |     cin >> s;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:5:12: error: 's' was not declared in this scope
    5 |     cin >> s;
      |            ^
a.cc:12:19: error: expected ';' before 'sd'
   12 |             string sd;
      |                   ^~~
      |                   ;
a.cc:14:17: error: 'sd' was not declared in this scope; did you mean 'std'?
   14 |                 sd+=s.at(k);
      |                 ^~
      |                 std
a.cc:17:26: error: 'sd' was not declared in this scope; did you mean 'std'?
   17 |             ll num=atoll(sd.c_str());
      |                          ^~
      |                          std
a.cc:17:20: error: 'atoll' was not declared in this scope
   17 |             ll num=atoll(sd.c_str());
      |                    ^~~~~
a.cc:20:17: error: 'cout' was not declared in this scope
   20 |                 cout << i << " " << i+j << endl;
      |                 ^~~~
a.cc:20:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:20:44: error: 'endl' was not declared in this scope
   20 |                 cout << i << " " << i+j << endl;
      |                                            ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
a.cc:25:5: error: 'cout' was not declared in this scope
   25 |     cout <<sum << endl;
      |     ^~~~
a.cc:25:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:25:19: error: 'endl' was not declared in this scope
   25 |     cout <<sum << endl;
      |                   ^~~~
a.cc:25:19: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include <bits/stdc++.h>
using namespace std;
long long int A[200100][2030];
string S;
int main(){
    long long int i, j, p=0;
    cin >> S;
    A[0][S[0]-'0']=1;
    for(i=1;i<S.size();i++){
        //if(A[i-1][0]>0) cout << i <<' '<< A[i-1][0]<< '\n';
        A[i][S[i]-'0'] +=1;
        for(j=0;j<2019;j++){
            if(A[i-1][j]){
                A[i][((j*10)+S[i]-'0')%2019] += A[i-1][j];
            }

        }
        //for(j=0;j<2019;j++) cout <<i<<' '<<j<<' '<< A[i+1][j] <<endl;
        p = p+A[i][0];
    }
    cout << p;
}


Compiler output:
/tmp/ccYeOEpJ.o: in function `main':
a.cc:(.text+0x14): relocation truncated to fit: R_X86_64_PC32 against symbol `S[abi:cxx11]' defined in .bss section in /tmp/ccYeOEpJ.o
a.cc:(.text+0x32): relocation truncated to fit: R_X86_64_PC32 against symbol `S[abi:cxx11]' defined in .bss section in /tmp/ccYeOEpJ.o
a.cc:(.text+0x77): relocation truncated to fit: R_X86_64_PC32 against symbol `S[abi:cxx11]' defined in .bss section in /tmp/ccYeOEpJ.o
a.cc:(.text+0x13a): relocation truncated to fit: R_X86_64_PC32 against symbol `S[abi:cxx11]' defined in .bss section in /tmp/ccYeOEpJ.o
a.cc:(.text+0x226): relocation truncated to fit: R_X86_64_PC32 against symbol `S[abi:cxx11]' defined in .bss section in /tmp/ccYeOEpJ.o
/tmp/ccYeOEpJ.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x26c): relocation truncated to fit: R_X86_64_PC32 against symbol `S[abi:cxx11]' defined in .bss section in /tmp/ccYeOEpJ.o
a.cc:(.text+0x285): relocation truncated to fit: R_X86_64_PC32 against symbol `S[abi:cxx11]' defined in .bss section in /tmp/ccYeOEpJ.o
collect2: error: ld returned 1 exit status
Language: C

#include<bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> P;
typedef long long ll;
#define rep(i,a,n) for(int i=a;i<n;i++)
#define rrep(i,n,a) for(int i=n;i>=a;i--)
#define FOR(i,n) for(int i=0;i<n;i++)
#define all(s) s.begin(),s.end()
#define vi vector<int>
#define vvi vector<vector<int>>
#define pcnt(n) __builtin_popcount(n)
const int MOD = 2019;

int pw(int a, int x) {
    if (x == 0) return 1;
    int b = pw(a, x / 2);
    b = (b * b) % MOD;
    if (x % 2)
        return (a * b) % MOD;
    return b;
}

string s;
vector<int>r(200010,0);

void mod2019(){
    rep(i,1,200010){
        r[i] = r[i]*pw(10,i-1);
        r[i]%=MOD;
    }
}

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cin>>s;
    int n = s.length();
    int ans = 0;
    rep(i,1,n+1){
        r[n+1-i] = (int)(s[i-1]-'0');
    }
    mod2019();
    for(int i=1;i<n+1;i++){
        r[i]+=r[i-1];
        r[i]%=MOD;
    }
    map<int,int>resi;
    rep(i,0,n+1){
        resi[r[i]]++;
    }
    for(auto x:resi){
        ans += x.second*(x.second-1)/2;
    }
    cout<< ans <<endl;
}

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

#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)n; i++)
#define REPvec(itr, mp) for (auto itr = mp.begin(); itr != mp.end(); itr++)
#define all(x) x.begin(), x.end()
#define MOD 1000000007  // 1e9+7
using namespace std;
typedef long long int ll;
typedef vector<int> vecint;
typedef vector<ll> vecll;
typedef vector<double> vecd;
typedef vector<string> vecstr;
typedef vector<char> vecchar;
typedef vector<bool> vecbool;
typedef vector<vector<bool>> vec2bool;
typedef vector<vector<int>> vec2int;
typedef vector<vector<double>> vec2d;
////////////////////////////////////////////////
void init() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}
////////////////////////////////////////////////
int main() {
  init();
  string s;
  cin >> s;
  int n = s.size();
  vec2int dp(n, vecint(2019, 0));
  REP(i, n) {
    int tmp = s[i] - '0';
    dp[i][tmp] = 1;
    REP(k, 2019) {
      if (i == 0) continue;
      dp[i][(10 * k + tmp) % 2019] += dp[i - 1][k];
    }
  }
  int ans = 0;
  REP(i, n) {
    // cout << dp[i][0] << endl;
    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

/************************************
/ AUTHOR : YATHARTH GOSWAMI         /  
/ ALIAS : hacker_yg                 /
/ INSTITUTE : IIT Kanpur            /
************************************/
//          TEMPLATE                //

#include <bits/stdc++.h>

#define ll long long
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define F first
#define S second

using namespace std;

int power(int x, int y, int p)
{
    int res = 1;     // Initialize result

    x = x % p; // Update x if it is more than or
                // equal to p

    if (x == 0) return 0; // In case x is divisible by p;

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res*x) % p;

        // y must be even now
        y = y>>1; // y = y/2
        x = (x*x) % p;
    }
    return res;
}

int main(){
    int p = 2019;
    string s;
    getline(cin, s);
    int n = s.length();
    vector <int> rem(n+1);
    rem[n] = 0;
    for (int i = n-1; i >= 0; i--){
        rem[i] = (((s[i]-'0')%p)*power(10, n-1-i, 2019) + rem[i+1])%p;
    }
    map <int, int> m;
    set <int> q;
    for (int i = 0; i < n; i++){
        m[rem[i]]++;
        //cout << m[rem[i]] << endl;
        q.insert(rem[i]);
    }
    ll ans = 0;
    for (auto i = q.begin(); i != q.end(); i++){
        if (*i == 0){
            ans += (m[*i]*(m[*i]+1))/2;
        }
        ans += (m[*i]*(m[*i]-1))/2;
    }
    cout << ans;
    return 0;
}




Compiler output:
main.c:8:10: fatal error: bits/stdc++.h: No such file or directory
    8 | #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;j++){string p=S.substr(i,j);if(atoi(p.c_str)%2019==0)x++;}
           cout<<x<<endl;}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:92: error: invalid use of non-static member function 'const _CharT* std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::c_str() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
    4 |            for(int i=0;i<b-3;i++)for(int j=4;j<b-i+1;j++){string p=S.substr(i,j);if(atoi(p.c_str)%2019==0)x++;}
      |                                                                                          ~~^~~~~
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:2640:7: note: declared here
 2640 |       c_str() const _GLIBCXX_NOEXCEPT
      |       ^~~~~
Language: C

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

// #define int long long
#define rep(i, n) for (long long i = (long long)(0); i < (long long)(n); ++i)
#define reps(i, n) for (long long i = (long long)(1); i <= (long long)(n); ++i)
#define rrep(i, n) for (long long i = ((long long)(n)-1); i >= 0; i--)
#define rreps(i, n) for (long long i = ((long long)(n)); i > 0; i--)
#define irep(i, m, n) for (long long i = (long long)(m); i < (long long)(n); ++i)
#define ireps(i, m, n) for (long long i = (long long)(m); i <= (long long)(n); ++i)
#define SORT(v, n) sort(v, v + n);
#define REVERSE(v, n) reverse(v, v+n);
#define vsort(v) sort(v.begin(), v.end());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) long long(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vs = vector<string>;
using vpll = vector<pair<ll, ll>>;
using vtp = vector<tuple<ll,ll,ll>>;
using vb = vector<bool>;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const ll INF = 1e9;
const ll MOD = 1e9+7;
const ll LINF = 1e18;


signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  string s; cin>>s;
  ll n=s.size();
  // cout<<n<<endl;
  vll dp(2100);

  ll ans=0;
  rep(i,n){
    vll ndp(2100);
    ll now=s[i]-'0';
    ndp[now]++;
    rep(j,2019){
      // dp[i+1][j]+=dp[i][j];
      ll nxtj=((j*10)%2019+now)%2019;
      // cout<<i<<" "<<nxtj<<endl;
      ndp[nxtj]+=dp[j];
    }
    ans+=ndp[0];
    dp=ndp;
  }
  // rep(i,100) cout<<dp[n][i]<<endl;
  
  // rep(i,2019){
  //   // if(dp[n][i]!=0) cout<<i<<" "<<dp[n][i]<<endl;
  // }
  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;

long long N;
string S;
int P;

long long solve() {
  vector<long long> val(P, 0);
  long long tenfactor = 1;
  long long cur = 0;
  val[cur]++;
  for (int i = 0; i < N; ++i) {
    cur = (cur + (S[N - i - 1] - '0') * tenfactor) % P;
    tenfactor = (tenfactor * 10) % P;
    val[cur]++;
  }
  long long res = 0;
  for (int p = 0; p < P; ++p) res += val[p] * (val[p] - 1) / 2;
  return res;
}

int main() {
  cin >> S;
  N = S.length();
  P = 2019;
  cout << solve() << 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++

using namespace std;

int main()
{
    string s;
    cin >> s;
    long long int tmp, tmp_sum = 0, ans = 0;
    for(int j = 0; j < s.length(); j++){
        tmp_sum = 0;
        for(int i = j; i < s.length(); i++){
            tmp = int(s[i])-48;
            tmp_sum = tmp_sum * 10 + tmp;
            //cout << tmp_sum << "\n";
            if(tmp_sum % 2019 == 0){
                tmp_sum = 0;
                ans ++;
            }
        }
        
    }
    
    cout << ans << "\n";;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'string' was not declared in this scope
    5 |     string s;
      |     ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | using namespace std;
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin >> s;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:6:12: error: 's' was not declared in this scope
    6 |     cin >> s;
      |            ^
a.cc:22:5: error: 'cout' was not declared in this scope
   22 |     cout << ans << "\n";;
      |     ^~~~
a.cc:22:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(k,i,n) for(ll i=k;i<n;++i)
#define ar array

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

	ll n, p=2019;
	string s;
	cin >> s;
	n=s.length();
	ll ans=0;
		map<ll, ll> mp;
		++mp[0];
		ll t=0, p2=1;
		for(ll i=n-1; i>=0; --i) {
			t=(t+(s[i]-'0')*p2)%p;
			ans+=mp[t];
			mp[t]++;
			p2=p2*10%p;
		}
	cout << ans;
}

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

import java.util.*;
import java.math.*;
 
public class A{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		
		long n = 0;
		final BigInteger MOD = BigInteger.valueOf(2019);
		for(int i = 0; i < s.length(); i++)
			for(int j = i + 4; j <= s.length(); j++)
				//if(new BigInteger(s.substring(i, j)).mod(MOD).shortValue() == 0)
					n++;
		
		System.out.println(n);
		
		sc.close();
    }
}

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

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

int main() {
  string S;
  cin >> S;
  int count = 0;
  if (S.size() < 4){
    cout << 0 << endl;
    return;
  for(int i = 0; i < S.size() - 3; i++){
    for(int j = i + 3; j < S.size(); j++){
      ll x;
      istringstream(S.substr(i, j - i + 1)) >> x;
      if (x % 2019 == 0)
        count++;
    }
  }
    
  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
   11 |     return;
      |     ^~~~~~
a.cc:22:2: error: expected '}' at end of input
   22 | }
      |  ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

int main()
{
	long long m[2][2019] = {};
	int cur = 0, nxt;
	long long ans = 0;
	m[0][0] = 1;
	char c;
	int dig;
	while (cin >> c) {
		dig = c - '0';
		nxt = cur ^ 1;
		m[cur][0] += 1;
		for (int i = 0; i < 2019; i++) {
			m[nxt][i] = 0;
		}
		for (int i = 0; i < 2019; i++) {
			m[nxt][(i*10+dig)%2019] += m[cur][i];
		}
		cur = nxt;
		ans += m[cur][0];
	}
	cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: 'cin' was not declared in this scope
    9 |         while (cin >> c) {
      |                ^~~
a.cc:22:9: error: 'cout' was not declared in this scope
   22 |         cout << ans;
      |         ^~~~
Language: C++

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

const int MOD = 2019;

string S;
int csum[200000];

signed main() {
  cin >> S;
  int N=S.size();

  csum[0] = (int)(S[N-1]-'0') % MOD;
  //cerr << csum[0] << endl;
  int p10 = 1;
  for(int i=N-2; i>=0; i--) {
    int index = N-1-i;
    p10 = (p10 * 10) % MOD;
    int s = (int)(S[i] - '0') * p10;
    s %= MOD
    csum[index] = (csum[index-1] + s) % MOD;
    //cerr << index << "\t" << S[i] << "\t" << s << "\t" << csum[index] << endl;
  }
  
  map<int,int> mp;
  mp[0]++;
  int ans = 0;
  for(int i=0; i<N; i++) {
    ans += mp[csum[i]];
    cerr << i << "\t" << csum[i] << "\t" << mp[csum[i]] << endl;
    mp[csum[i]]++;
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:13: error: expected ';' before 'csum'
   21 |     s %= MOD
      |             ^
      |             ;
   22 |     csum[index] = (csum[index-1] + s) % MOD;
      |     ~~~~
Language: C++

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define MAX_C 1000000001
#define MOD 1000000007


int main() {
  string s;
  cin >> s;
  int len = s.size();
  vector<int> snum(len);
  for (int i = 0; i < len; i++) {
    snum[i] = (int)(s[i] - '0');
  }

  vector<int> memo(len); //memo[i]:下からi桁のあまり
  int tmp = 0, tmp_ten = 1;
  for (int i = 0; i < len; i++) {
    //tmp = (tmp * 10 + snum[len-1-i]) % MOD;
    tmp = (tmp_ten * snum[len-1-i] + tmp) % 2019;
    tmp_ten = (10 * tmp_ten) % 2019;
    memo[i] = tmp;
  }
  //cout << memo[0] << memo[1] << endl;

  sort(memo.begin(), memo.end());
  //cout << "sort" << endl;
  ll cnt = 0;
  /*
  for (int i = 0; i < 2019; i++) {
    auto itl = lower_bound(memo.begin(), memo.end(), i);
    auto itu = upper_bound(memo.begin(), memo.end(), i);
    ll c = (ll)(itu - itl);
    //if (c != 0) cout << i << ", " << c << endl;
    if (i == 0) c++;
    cnt += (c * (c-1)) / 2;
  }*/
  ll c_tmp = 1;
  int c = 0;
  for (int i = 0; i < len; i++) {
    if (memo[i] == c) c_tmp++;
    else {
      cnt += (ll)(c_tmp * (c_tmp-1)) / 2;
      c_tmp = 1;
      c = memo[i];
    }
  }

  cout << (ll)cnt << endl;
    
}

int main() {

}

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

#include <iostream>
#include <string>
#include <iomanip>
#include <ios>
using namespace std;
int main(void){
  string s;
  cin >> s;
  
  int l = s.length();
  long long ans = 0;
  
  for(int i=0;i<l-4;i++){
    long long n = s[i] - '0';
    for(int j=i+1;j<l;j++){
      n = (n * 10 + (s[j] - '0')) % 2019;
      if(n == 0) ans++;
    }
  }
  
  cout << ans << endl;
  
  return 0;
}


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

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

int main(){
  string S;
  cin >> S;
  int answer = 0;
  for(int i = 0; i < (int)(S.length()); i++){
    for(int j = i+1; j < (int)(S.length(); j++){
      int num = stoi(S.substr(i, j - i + 1));
      if(num % 2019 == 0){
        answer ++;
      }
    }
  }
  cout << answer << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:42: error: expected ')' before ';' token
    9 |     for(int j = i+1; j < (int)(S.length(); j++){
      |                               ~          ^
      |                                          )
Language: C

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

typedef long lint;
typedef long long llint;
typedef pair<int, int> pint;
typedef pair<long long, long long> pllint;

// static const int MAX = 1e6;
// static const int NIL = -1;
// static const ll INF = 1<<21;
static const llint MOD = 2019;

bool compPair(const pint& arg1, const pint& arg2) { return arg1.first > arg2.first; }
template<class T> void chmax(T& a, T b) { if (a < b) { a = b; } }
template<class T> void chmin(T& a, T b) { if (a > b) { a = b; } }

int main(void) {
    string s;
    cin >> s;

    llint a = 0, n;
    n = s.size();

    llint dp[n+1][MOD];
    for(int in=0;in<n+1;in++) {
       for(int im=0;im<MOD+1;im++) {
           dp[in][im] = 0;
       }
    }

    llint now;
    for(int in=1;in<=n;in++) {
        now = s.at(in-1)-'0';
        dp[in][now]++;
       for(int im=1;im<=MOD+1;im++) {
           dp[in][(10*im+now)%MOD] += dp[in-1][im];
       }
    }

    cout << dp[n][0] << endl;
    return 0;
}


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

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

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

	u64 k = 2019;
	u64 ans = 0;
	
	for(u64 b=0; b<S.size(); b++) {
		u64 tdiv = 0;
		for(u64 e=b; e<S.size(); e++) {
			tdiv = tdiv * 10 + S[e] - '0';
			bool r = (tdiv != 0);
			
			tdiv = tdiv - (tdiv / k) * k;
			if(r && tdiv == 0) {
				ans++;
			}
		}
	}

	cout << ans;

}


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

s = input()
n = len(s)
right = n-1
ans = 0

def count(s,i):
    counta = 0
    for left in range(n-i-3):
        k = int(s[left:n-i+1])
        if k%2019==0:
            counta += 1
    return counta


for i in range(2,n-2):
    ans += count(s,i-1)
print(ans)


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 'n'
    2 | n = len(s)
      | ^
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);if(atoi(p)%2019==0)x++;}
           cout<<x<<endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:4:90: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
    4 |            for(int i=0;i<b-3;i++)for(int j=4;j<b-i+1;j++){string p=S.substr(i,j);if(atoi(p)%2019==0)x++;}
      |                                                                                          ^
      |                                                                                          |
      |                                                                                          std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
a.cc: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;
using u64 = uint64_t;


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

	u64 k = 2019;
	u64 ans = 0;
	
	for(u64 b=0; b<S.size(); b++) {
		u64 tdiv = 0;
		for(u64 e=b; e<S.size(); e++) {
			tdiv = tdiv * 10 + S[e] - '0';
			bool r = (tdiv != 0);
			
			tdiv = tdiv - (tdiv / k) * k;
			if(r && tdiv == 0) {
				ans++;
			}
		}
	}

	cout << ans;

}


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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
	string S;
  	cin >> S;
  	string T;
  	int a;
  	int keta = S.size();
  	int64_t sum = 0;
  	for(int i=0 ; i < keta ; i++){
    	for(int j=i; j <keta; j++){
        	for(int k=i; k <= j;k++){
            	T = T + S.at(k);
            }
            a = stoi(T);
          	if(a%2019 == 0) sum = sum + 1;
          	T = null;
        }
    }
  	cout << sum << endl;
}

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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(void)
{
  string s;
  cin >> s;
  int l = s.length();
  ll c=0;
  for(int i = 1;i<5;i++)
  {
      int a = 2019 * i;
      string b = to_string(a);
      for(int j = 0;j<l-3;j++)
      {
          string ms = s.substr(j,4);
          if(b == ms)c++;
      }
  }
  for(int i = 5;i<50;i++)
  {
      int a = 2019 * i;
      string b = to_string(a);
      for(int j = 0;j<l-4;j++)
      {
          string ms = s.substr(j,5);
          if(b == ms) c++;
      }
  }
  for(int i = 50;i<95;i++)
  {
      int a = 2019 * i;
      string b = to_string(a);
      for(int j = 0;j<l-5;j++)
      {
          string ms = s.substr(j,6);
          if(b == ms)c++;
      }
  }
  cout << c << 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

S = input()
t = []
for i in range(1, 1000):
    t.append(str(2019 * i))
c = 0
for i in t:
    if S.count(i):
        a = len(i)
        for j in range(len(S) - a + 1):
            if S[j:j + a] == i:
                c += 1

print(c)


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 't'
    2 | t = []
      | ^
Language: C++

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

int main(){
    string s;
    cin >> s;
    int n = s.size();
    int level = 0;
    int sum = 0;
    int cnt = 0;
    for(int i = n-1; i > 2;i--){
        for(int j = i;j >= 0;j--){
            char k = s[j];
            sum += ctoi(k)*pow(10,level);
            if(sum%2019 == 0){
                cnt++;
            }
            level++;
        }
    }
    cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:20: error: 'ctoi' was not declared in this scope; did you mean 'atoi'?
   14 |             sum += ctoi(k)*pow(10,level);
      |                    ^~~~
      |                    atoi
Language: C++

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

Compiler output:
/usr/bin/ld: /tmp/ccWrmOAa.o: warning: relocation against `stdscr' in read-only section `.text'
/usr/bin/ld: /tmp/ccWrmOAa.o: in function `main':
a.cc:(.text+0x24): undefined reference to `stdscr'
/usr/bin/ld: a.cc:(.text+0x2c): undefined reference to `wgetch'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
Language: C++

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

int main(){
  string S;
  cin >> S;
  int answer = 0;
  for(int i = 0; i < S.size(); i++){
    for(int j = i+1; j < S.size; j++){
      int num = stoi(S.substr(i, j - i + 1));
      if(num % 2019 == 0){
        answer ++;
      }
    }
  }
  cout << answer << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:28: 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 '()' ?)
    9 |     for(int j = i+1; j < S.size; j++){
      |                          ~~^~~~
      |                                ()
Language: C++

#include <iostream>
#include <string>
#include <cstdio>
#include <stdlib.h>
using namespace std;

int ctoi(char c) {
	switch (c) {
		case '0': return 0;
		case '1': return 1;
		case '2': return 2;
		case '3': return 3;
		case '4': return 4;
		case '5': return 5;
		case '6': return 6;
		case '7': return 7;
		case '8': return 8;
		case '9': return 9;
		default: return 0;
	}
}

int main(){
    char S[2000000];

    scanf("%s", S);
    
    int length = strlen(S);
    long n;
    int count = 0;
    int x;

    //printf("lenght %d\n", length);

    if(length <= 3){
        printf("0\n");
    }
    else{
        for(int i = 0; i < length; i++){
            x = 100*ctoi(S[i]) + 10 * ctoi(S[i+1]) + ctoi(S[i]);
            if(i + 3 > length - 1){
                break;
            }
            for(int j = i + 3;j < length; j++){
                x = 10*x + ctoi(S[j]);
                if(x % 2019 == 0){
                    count++;
                }
            }
        
        }
        printf("%d\n", count);
    }

    return 0;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:18: error: 'strlen' was not declared in this scope
   28 |     int length = strlen(S);
      |                  ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <stdlib.h>
  +++ |+#include <cstring>
    5 | using namespace std;
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:11: error: 'Test' was not declared in this scope
    6 |   cout << Test;
      |           ^~~~
Language: C++

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

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

  int i = 1;
  int huga =0;
  while(true){

      string str = s.substr(i);
      int hoge = atoi(str.c_str());
      
      if(hoge%2019 == 0){ 
          ++huga; 
      }
      if(s.lenth() == i){break;}
      ++i;
  }
  cout << huga;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:12: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'lenth'; did you mean 'length'?
   18 |       if(s.lenth() == i){break;}
      |            ^~~~~
      |            length