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

import java.util.*;

public class Main {

	public static void main(String[] args) {
			
		Scanner sc = new Scanner(System.in);
		String ss = sc.next();

		int ans = 0;
		for (int i = 0; i < s.length(); i++) {
			for (int j = i+4; j < s.length(); j++) {
				String sub = s.substring(i, j+1);			
				if (Long.parseLong(sub) % 2019 == 0)
					ans++;
			}
		}
		System.out.println(ans);
	}
}

Compiler output:
Main.java:11: error: cannot find symbol
		for (int i = 0; i < s.length(); i++) {
		                    ^
  symbol:   variable s
  location: class Main
Main.java:12: error: cannot find symbol
			for (int j = i+4; j < s.length(); j++) {
			                      ^
  symbol:   variable s
  location: class Main
Main.java:13: error: cannot find symbol
				String sub = s.substring(i, j+1);			
				             ^
  symbol:   variable s
  location: class Main
3 errors
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   11 |       long num = atoi(S_2);
      |                       ^~~
      |                       |
      |                       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)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

#include <bits/stdc++.h>
#include <stdio.h>
#include <math.h>
#include <cmath>
using namespace std;
#define vsort(vec) sort(vec.begin(), vec.end())
#define vreverse(vec) reverse(vec.begin(), vec.end())
using ll =long long;
using ull =unsigned long long;
const ll INF =1001001001;

//10億7。　　　100000007

//最大公約数
ll gcd(ll a, ll b){
   if (a%b==0){
       return(b);
   }else{
       return(gcd(b,a%b));
   }
}
//最小公倍数
ll lcm(ll a, ll b){
   return a*b/gcd(a,b);
}


int main(){
cout<<fixed<<setprecision(10);
//cin.tie(0); ios::sync_with_stdio(false);

  string S;
  cin>>S;
  int N=S.size();
  int cnt=0;
  string A;
  for(int i=0;i<N;i++){
    for(int j=i+3;j<Ni+10;j++){
      for(int k=i;k<j+1;k++){

         A=A+S[k];
      }
      int B=atoi(A.c_str());
  //    cout<<A<<" "<<B<<endl;
      if(B%2019==0){
        cnt++;
      }
      A='0';
    }
  }
  cout<<cnt<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:38:21: error: 'Ni' was not declared in this scope; did you mean 'i'?
   38 |     for(int j=i+3;j<Ni+10;j++){
      |                     ^~
      |                     i
Language: C

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

int main(){
  string S; cin >> S;
  int N=S.size();
  
  // 2019 = 3 * 673(prime)
  // 673の倍数判定で組をためる
  int cur=0;
  int d=1;
  vector<vector<int>> q(673,vector<int>());
  q[0].push_back(N);
  for(int i=N-1; i>=0; i--){
    cur=(cur+d*(S[i]-'0'))%673;
    q[cur].push_back(i);
    d=(d*10)%673;
  }
  
  // 3の倍数判定をためた組に行う
  int th[200010];
  th[N]=th[N+1]=0;
  for(int i=N-1; i>=0; i--){
    th[i]=th[i+1]+(S[i]-'0');
  }
  
  long long count=0;
  for(int i=0; i<673; i++){
    for(int j=0; j<(int)q[i].size(); j++){
      for(int k=j+1; k<(int)q[i].size(); k++){
        if((th[q[i][k]]-th[q[i][j]])%3==0) count++;
      }
    }
  }
  cout << count << 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: Java

import java.io.*;

public class Battle {
    public static void main(String[] args) {
        try {
            BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
            char[] n = in.readLine().toCharArray();
            int count = 0;
            for (int i = n.length - 1;i >= 3;i --) {
                for (int j = i - 3;j >= 0 && j >= i - 6;j --) {
                    String s = new String(n, j, i - j + 1);
                    int t = Integer.parseInt(s);
                    if (t % 2019 == 0) {
                        count ++;
                    }
                }
            }
            System.out.print(count);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }


}


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

# -*- coding: utf-8 -*-
S = str(input())

len_str = len(S)
dp_list = [-1 for _ in range(len_str)]

ans = 0
for i in range(len_str):
    for j in range(i + 4, len_str + 1):
        temp_ans = int(S[i:j]) if i == 0 or j == i + 4 else (dp_list[j - 2] * 10 + int(S[j - 1]))
        temp_ans %= 2019
        dp_list[j - 1] = temp_ans
        if temp_ans == 0:
            ans += 1
print(ans)

Compiler output:
main.c:1:3: error: invalid preprocessing directive #-
    1 | # -*- coding: utf-8 -*-
      |   ^
main.c:2:1: warning: data definition has no type or storage class
    2 | S = str(input())
      | ^
main.c:2:1: error: type defaults to 'int' in declaration of 'S' [-Wimplicit-int]
main.c:2:5: error: implicit declaration of function 'str' [-Wimplicit-function-declaration]
    2 | S = str(input())
      |     ^~~
main.c:2:9: error: implicit declaration of function 'input' [-Wimplicit-function-declaration]
    2 | S = str(input())
      |         ^~~~~
main.c:2:5: error: initializer element is not constant
    2 | S = str(input())
      |     ^~~
main.c:4:1: error: expected ',' or ';' before 'len_str'
    4 | len_str = len(S)
      | ^~~~~~~
Language: C

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

ll r(ll x, ll y) {
  if (y == 0) return 1;
  else if (y % 2 == 0) return r(x, y/2) * r(x, y/2) % mod;
  else return x * r(x, (y-1)/2) % mod * r(x, (y-1)/2) % mod;
}
  
int main() {
  string S;
  cin >> S;
  int n = S.size();
  vector<int> s(n);
  for (int i = 0; i < n; i++) {
    s[i] = S[i] - '0';
  }
  ll c = 0;
  if (n < 4) {
    cout << 0 <<endl;
  }
  else {
    for (int i = 0; i < n - 4; i++) {
      int p = 100 * s[i] + 10 * s[i+1] + s[i+2];
      for (int j = i + 4; j < n; j++) {
        p = p*10 + s[j];
        p %= 2019;
        if (p == 0) {
          c++;
        }
      }
    }
    cout << c <<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>
    #include <ext/pb_ds/assoc_container.hpp>
    #include <ext/pb_ds/tree_policy.hpp>
     
    using namespace std;
    using namespace __gnu_pbds;
     
    void debug_out() { cerr << endl; }
    template<class T> ostream& prnt(ostream& out, T v) { out << v.size() << '\n'; for(auto e : v) out << e << ' '; return out;}
    template<class T> ostream& operator<<(ostream& out, vector <T> v) { return prnt(out, v); }
    template<class T> ostream& operator<<(ostream& out, set <T> v) { return prnt(out, v); }
    template<class T1, class T2> ostream& operator<<(ostream& out, map <T1, T2> v) { return prnt(out, v); }
    template<class T1, class T2> ostream& operator<<(ostream& out, pair<T1, T2> p) { return out << '(' << p.st << ' ' << p.nd << ')'; }
    template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << H; debug_out(T...);}
     
    #define dbg(...) cerr << #__VA_ARGS__ << " ->", debug_out(__VA_ARGS__)
    #define dbg_v(x, n) do{cerr<<#x"[]: ";for(int _=0;_<n;++_)cerr<<x[_]<<" ";cerr<<'\n';}while(0)
    #define dbg_ok cerr<<"OK!\n"
    #define  st first
    #define  nd second
    #define int long long  
     
    template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
     
    typedef cc_hash_table<int, int, hash<int > > ht;
     
    const int  M    = 998244353;
    const int  MAXN = 10005 ;
    const int   INF  = 0x3F3F3F3F  ; // long long inf
    const long double eps = 1.084202e-19;
 
    int32_t main(){
         ios_base::sync_with_stdio(false);
         cin.tie(NULL);
         string s ;  
         cin >> s ; 
         int n = s.size() ; 
         int p= 2019;
         map<int, int> mp;
         int ans = 0 ;
		++mp[0];
		int t=0, p2=1;
		for(int i=n-1; ~i; --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: C++

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


int main() {
    string s;
    cin >> s;
    string k=str;
    ll n = k.size();
    ll cnt=0; 
    for (ll i=n-1;i>3;i--){
        for (ll j=i-3;j>=0;j--){
            string now_s = str.substr(j,i-j+1);
            ll now = stoll(now_s);
            // cout << stoll(now_s) << endl;
            if(now % 2019==0) {
                cnt++;
                break;
            }
        }
    }
    cout << cnt << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: 'str' was not declared in this scope; did you mean 'std'?
   11 |     string k=str;
      |              ^~~
      |              std
Language: C

#include <bits/stdc++.h>
using namespace std;
int fun(string s)
{
  int n=s.size();
  int numMultiples=0;
  int seenRemainders[n+1] ={0};
  for (int i=0;i<n;i++)
  {
    int remainder=0;
    int prefixesFound = 0;
    for (int j=i;j<n;j++)
    {
      remainder = (10 * remainder + (s[j]-'0')) % 2019;
      if (seenRemainders[j]==remainder)
        break;
      seenRemainders[j]=remainder;
    }
    if(remainder==0)
      prefixesFound++;
    numMultiples += prefixesFound * (prefixesFound + 1) / 2;
  }
  return numMultiples;
}
int main()
{
  string s;
  cin>>s;
  int n=s.size();
  cout<<fun(s)+1;
  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<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(void){
	char s[200001] = { '\0' };
	long l = 0;
	long x = 0;
	scanf("%s", s);
	while(s[l] != '\0'){
		l++;
	}
	for(long i=0; i<l-4; i++){
		long j = i + 3;
		while(j<l){
			char *tmp_s;
			tmp_s = (char *)malloc(sizeof(char) * (i+j+2));
			tmp_s = strncpy(tmp_s, s+i, j-i+1);
			tmp_s[i+j+1] = '\0';
			long tmp = atol(tmp_s);
			if(tmp%2019 == 0){
				x++;
				j += 4;
			}
			else{
				j++;
			}
			free(tmp_s)
		}
	}
	printf("%ld\n", x);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:27:36: error: expected ';' before '}' token
   27 |                         free(tmp_s)
      |                                    ^
      |                                    ;
   28 |                 }
      |                 ~
Language: C++

#include <iostream>
#include <string>
#include <ppl.h>
#include <array>
#include <sstream>
#include <iostream>

using namespace concurrency;
using namespace std;

int main()
{
	string S;

	cin >> S;
	int size = S.size();
	long long count = 0;

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

		for (int j = 0; j <= size - i; j++)
		{
			int num = atoi(S.substr(i, j).c_str());
			if (num % 2019 == 0)
			{
				count++;
			}

			if (j >= 100)
			{
				break;
			}

		}

	}


	cout << count << endl;

	return 0;
}

Compiler output:
a.cc:3:10: fatal error: ppl.h: No such file or directory
    3 | #include <ppl.h>
      |          ^~~~~~~
compilation terminated.
Language: C++


#include<stdio.h>
#include<iostream>
#include<math.h>
#include<string>
#include<string.h>
#include<algorithm>
#define N 2019
#define LL long long
using namespace std;
char s[205000];
LL dp[205000][N+1];
int main()
{
    memset(dp,0LL,sizeof(dp));
    scanf("%s",s+1);
    int ls=strlen(s+1);
    int a;
    LL ans=0;
    for(int i=1; i<=ls; i++)
    {
        a=s[i]-'0';
        dp[i][a%N]++;
        for(int j=0; j<N; j++)
            dp[i][(a+j*10)%N]+=dp[i-1][j];
        ans+=dp[i][0];
    }
    printf("%lld\n",ans);


Compiler output:
a.cc: In function 'int main()':
a.cc:28:26: error: expected '}' at end of input
   28 |     printf("%lld\n",ans);
      |                          ^
a.cc:14:1: note: to match this '{'
   14 | {
      | ^
Language: C

using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Math;

namespace D_ABC164
{
    class MainClass
    {

        // static int[] s;

        public static void Main(string[] args)
        {
            int d = 2019;
            // s = Array.ConvertAll(ReadLine().Split().ToArray(), int.Parse);
            string s = ReadLine();
            int n = s.Length;
            long ans = 0;
            if(n<4) {
                WriteLine(0);
                return;
            }
            for(int i = 4;i<=n;i++){
                // WriteLine(i);
                for(int j = 0;j<n-i+1;j++){
                    // WriteLine(j);
                    string tmp =s.Substring(j,i); 
                    // WriteLine(tmp);
                    long x = long.Parse(s.Substring(j,i));
                    if (x %d ==0) ans++;
                }
            }
            WriteLine(ans);
        }
    }
}


Compiler output:
main.c:1:1: error: unknown type name 'using'
    1 | using System;
      | ^~~~~
main.c:2:1: error: unknown type name 'using'
    2 | using System.Collections.Generic;
      | ^~~~~
main.c:2:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | using System.Collections.Generic;
      |             ^
main.c:3:1: error: unknown type name 'using'
    3 | using System.Linq;
      | ^~~~~
main.c:3:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    3 | using System.Linq;
      |             ^
main.c:4:6: error: expected ';' before 'static'
    4 | using static System.Console;
      |      ^~~~~~~
      |      ;
main.c:4:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    4 | using static System.Console;
      |                    ^
main.c:5:6: error: expected ';' before 'static'
    5 | using static System.Math;
      |      ^~~~~~~
      |      ;
main.c:5:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    5 | using static System.Math;
      |                    ^
main.c:7:1: error: unknown type name 'namespace'
    7 | namespace D_ABC164
      | ^~~~~~~~~
main.c:8:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    8 | {
      | ^
Language: C++

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

void n2019(int i, ll &count, string S){
  for(int j = i + 3; j < i + 8; j++){
    if(j >12114121141211412114 S.size())
      return;
    ll x;
    istringstream(S.substr(i, j - i + 1)) >> x;
    if (x % 2019 == 0){
      count++;
      n2019(j + 1,count,S);
    }
  }
}

int main() {
  string S;
  cin >> S;
  ll count = 0;
  if (S.size() < 4){
    cout << 0 << endl;
    return 0;
  }
  for(int i = 0; i < S.size() - 3; i++){
    n2019(i,count,S);
  }
    
  cout << count << endl;
}

Compiler output:
a.cc:7:11: warning: integer constant is so large that it is unsigned
    7 |     if(j >12114121141211412114 S.size())
      |           ^~~~~~~~~~~~~~~~~~~~
a.cc: In function 'void n2019(int, ll&, std::string)':
a.cc:7:31: error: expected ')' before 'S'
    7 |     if(j >12114121141211412114 S.size())
      |       ~                       ^~
      |                               )
Language: C

S = input()
N = len(S)

ans = 0
cnt = [0] * 2019
s=""

for i in range(N)[::-1]:
    s = "".join([S[i],s])
    cnt[int(s) % 2019] += 1

ans += cnt[0]
for i in range(1, 2019):
    ans += cnt[i] * (cnt[i] - 1) // 2
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 ans=0;
  int n=s.size();
  for(int i=0;i<n-3;++i){
    for(int j=4;j+i<=n;++j){
      //string st=s.substr(i,j);
      //cout << st << endl;
      long long cal=0;
      int l=i;
      for(int k=j;k>0;--k){
        cal+=((s[l]-'0')*pow(10,k-1));
        //cal=cal*pow(10,k-1);
        l++;
      }
      //cout << cal << endl;
      if(cal%2019==0) ans++;
    }
  }
  
  cout << ans << endl;
}


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

#include <bits/stdc++.h>
#include <algorithm>
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
const int inf = 1001001001;

int count(string s, string t){
    if(s.size() < t.size()) return 0;
    else {
        int ans = 0;
        int sn = s.size(), tn = t.size();
        for(int i = 0; i <= sn-tn; i++){
            bool flag = 1;
            for(int j = 0; j < tn; j++){
                if(s.at(j+i) != t.at(j)) {flag = 0; break;}
            }
            if(flag) ans++;
        }
        return ans;
    }
}

int main(){
    string s;
　　cin >> s;
    int cnt = 0;
    for(ll i = 2019; i<=30000000000; i += 2019){
        string t = to_string(i);
        cnt += count(s,t);
    }
    cout << cnt << endl;
}

Compiler output:
a.cc:26:1: error: extended character 　 is not valid in an identifier
   26 | 　　cin >> s;
      | ^
a.cc:26:1: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:26:1: error: '\U00003000\U00003000cin' was not declared in this scope
   26 | 　　cin >> s;
      | ^~~~~~~
Language: C

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

#define FOR(i, a, b) for(int i = a; i < b; i ++)
#define FORS(i, a, b, c) for(int i = a; i < b; i += c)
#define FORN(i, a, b) for(int i = a; i <= b; i ++)
#define FORD(i, a, b) for(int i = a-1; i >= b; i --)
#define FORE(i, b) for(auto &i:b)
#define REP(i, b) FOR(i, 0, b)
#define REPN(i, b) FORN(i, 0, b)
#define SQ(i) (i*i)
#define ALL(a) a.begin(), a.end()
#define ALLA(a,n) a, a+n
#define SORT(a) sort(ALL(a))
#define SORTA(a, n) sort(ALLA(a, n))
#define REV(a) reverse(ALL(a))
#define REVA(a, n) reverse(ALLA(a, n))
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define IN(a, b) (a.find(b) != a.end())
#define BACK(a) a.back(); a.RB()
#define QBACK(a) a.top(); a.pop()
#define PRINT(a) FORE(i, a) cout << i << " "; cout << endl

#define PB  push_back
#define RB  pop_back
#define RF  pop_front
#define INS insert
#define F   first
#define S   second
#define UM  unordered_map
#define US  unordered_set
#define PQ  priority_queue

#define IO ios_base::sync_with_stdio(false); cin.tie(NULL)

typedef long long ll;
typedef unsigned long long ull;

typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<ll> vll;
typedef pair<int,int> pi;
typedef pair<double,double> pd;
typedef pair<ll,ll> pll;
typedef queue<int> qi;
typedef queue<double> qd;
typedef queue<ll> qll;
typedef US<int> si;
typedef US<double> sd;
typedef US<ll> sll;
typedef vector<vi> mi;
typedef vector<vd> md;
typedef vector<vll> mll;
typedef vector<pi> vpi;
typedef vector<pd> vpd;
typedef vector<pll> vpll;

ll ans;

int main(){
  IO; string s; cin >> s;
  int N = s.size();
  vi occ(2019); occ[0] ++;
  int m = 0;
  int p = 1;
  FORD(i, N, 0){
    m += p*(s[i]-'0'); m %= 2019; p = p*10%2019;
    ans += occ[m]++;
  }
  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++

// C++ program to count subsequences of a 
// string divisible by n. 
#include<iostream> 
using namespace std; 

// Returns count of subsequences of str 
// divisible by n. 
int countDivisibleSubseq(string str, int n) 
{ 
	int len = str.length(); 

	// division by n can leave only n remainder 
	// [0..n-1]. dp[i][j] indicates number of 
	// subsequences in string [0..i] which leaves 
	// remainder j after division by n. 
	int dp[len][n]; 
	memset(dp, 0, sizeof(dp)); 
	
	int count=0;
	dp[0][(str[0]-'0')%n]++; 

	for (int i=1; i<len; i++) { 
		dp[i][(str[i]-'0')%n]++; 

		for (int j=0; j<n; j++) { 
			dp[i][(j*10 + (str[i]-'0'))%n] += dp[i-1][j]; 
		}
		count+=dp[i][0];
	} 
	return count;
} 

// Driver code 
int main() 
{ 
	string str;
	cin>>str;
	int n = 2019;
	cout << countDivisibleSubseq(str, n); 
	return 0; 
} 


Compiler output:
a.cc: In function 'int countDivisibleSubseq(std::string, int)':
a.cc:17:9: error: 'memset' was not declared in this scope
   17 |         memset(dp, 0, sizeof(dp));
      |         ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<iostream>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C

s = input()
cnt = 0
num_list = []
list4 = []
for i in range(1,10001):
    num_list.append(i*2019)
    list4.append(int(str(i*2019)[-4::]))
for j in range(0,len(s)-4+1):
    if int(s[0+j:4+j]) in list4:
        
        if s[4+j-len(str(num_list[list4.index(int(s[0+j:4+j]))])):4+j] == str(num_list[list4.index(int(s[0+j:4+j]))]):
            cnt += 1
            
print(cnt)

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 'cnt'
    2 | cnt = 0
      | ^~~
Language: C

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

int main() {
  string S;
  int N,count;
  cin >> S;
  N = S.size();
  vector<int> A(N);
  
  for (int i = 0; i < N; i++) {
    if( S.at(i) == '0' ){A.at(i) = 0;continue;}
    if( S.at(i) == '0' ){A.at(i) = 0;continue;}
    if( S.at(i) == '1' ){A.at(i) = 1;continue;}
    if( S.at(i) == '2' ){A.at(i) = 2;continue;}
    if( S.at(i) == '3' ){A.at(i) = 3;continue;}
    if( S.at(i) == '4' ){A.at(i) = 4;continue;}
    if( S.at(i) == '5' ){A.at(i) = 5;continue;}
    if( S.at(i) == '6' ){A.at(i) = 6;continue;}
    if( S.at(i) == '7' ){A.at(i) = 7;continue;}
    if( S.at(i) == '8' ){A.at(i) = 8;continue;}
    if( S.at(i) == '9' ){A.at(i) = 9;continue;}
  }
  for (int i = 0; i < (N-3); i++) {
    int judge,B,C;
    judge = A.at(i)+A.at(i+1)+A.at(i+2);
    B = A.at(i) * 100+A.at(i+1)*10+A.at(i+2);
    for (int l = i+3; l < N; l++) {
      judge += A.at(l);
      B *= 10;
      B += A.at(l);
      if((judge % 3) != 0){
        continue;
      }
      C = B/3;
      if((C % 619) == 0){
        count++;
      }
    }   
  }
  cout << count <<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>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
#define debug(x) cout << #x << " = " << x << '\n'
#define debug_arr(a , n) for(ll i = 0 ; i < n ; i++)cout << a[i] << " "
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define vi vector<ll>
#define vll vector<ll> 
#define inf 1000000000
#define mod 1000000007

const ll max_n = 1e5 + 9;

typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
ll power(ll a , ll b)
{
    ll prod = 1;
    while(b)
    {
        if(b&1)
        prod = (prod*a)%mod;
        a = (a*a)%mod;
        b >>= 1;
    }
    return prod;
}
int main()
{
    speed;
    string s;
    cin >> s;

    int n = s.size();

    int num = 0;
    set<int> st[n];

    for(int i = 0 ; i < n ; i++){
        int rem = 0 , pref = 0;
        for(int j = i ; j < n ; j++){
            rem = (10 * rem + (s[j]-'0'))%2019;
            if(st[j].count(rem)){
                break;
            }
            else{
                st[j].insert(rem);
            }
            if(rem == 0)pref++;
        }
        num += pref * (pref + 1) / 2;
    }

    cout << num << endl;
    return 0;
}

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

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

signed main(void)
{
	string s, t;
	long long cnt;

	cin >> s;
	cnt = 0;
	for(int i = 3; i < s.size(); i++)
	{
		for(int j = 1; j < 5; j++)
		{
			if (to_string(2019 * j) == s.substr(i - 3, 4))
				cnt++;
		}
	}
	for(int i = 4; i < s.size(); i++)
	{
		for(int j = 5; j < 50; j++)
		{
			if (to_string(2019 * j) == s.substr(i - 4, 5))
				cnt++;
		}
	}
	for(int i = 5; i < s.size(); i++)
	{
		for(int j = 50; j < 100; j++)
		{
			if (to_string(2019 * j) == s.substr(i - 5, 6))
				cnt++;
		}
	}
	cout << cnt << endl;
	return 0;
}


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

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

int main() {
    string S;
    cin >> S;
    int ans = 0;
    // for (int i = 0; i < S.size(); i++) {
    //     for (int j = i; j < S.size(); j++) {
    //         string Sij = S.substr(i, j-i+1);
    //         if (atoi(Sij.c_str()) % 2019 == 0 && Sij.size() != 0) {
    //             ans++;
    //         }   
    //     }
    // }

    vector<string> sub_list;
    for (int i = 1; i*2019 <= 200000; i++) {
        int ss = i * 2019;
        string sub_list_i = to_string(ss);
        sub_list.push_back(sub_list_i);
    }

    for (string sub_str: sub_list) {
        if (atoi(sub_str.c_str()) > atoi(S.c_str()) {
            break;
        }
        else {
            for (int i = 0; i < (int)S.size() + 1 - (int)sub_str.size(); i++) {
                string Si = S.substr(i, sub_str.size());
                if (Si == sub_str) {
                    ans++;
                }
            }        
        }
    }
    
    

    cout << ans << endl;;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:52: error: expected ')' before '{' token
   25 |         if (atoi(sub_str.c_str()) > atoi(S.c_str()) {
      |            ~                                       ^~
      |                                                    )
a.cc:36:5: error: expected primary-expression before '}' token
   36 |     }
      |     ^
Language: C++

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

int main() {
  string S;
  cin >> S;
  int C;
  C = 0;
  
  for (int i = 0; i < S.size() - 1; i++) {
    for (int j = i + 1; j < S.size(); j++) {
      string SS = S.substr(i, j);
      int64_t T = atoi(SS);
      if (T % 2019 == 0) {
        C = C + 1;
      }
    }
  }
  
  cout << C;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:24: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   15 |       int64_t T = atoi(SS);
      |                        ^~
      |                        |
      |                        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)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C

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

int main(void){
    string s;
    cin >> s;
    
    int ans=0;

    rep(i,s.size()-3){
        for(int j=4;j<=s.size()-i;++j){
            ll tmp=atoll(s.substr(i,j).c_str());
            if(tmp%2019==0){
                ans++;
                j+=3;
            }
        }
    }

    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 cnt = 0;
  	for(int i = 1; i < 100; i++)
    {
      	int keta = log10(2019*i) + 1;
    	for(int j = 0; j < s.size() - keta; j++)
        {
        	if(s.substr(j.keta) == 2019*i)
            {
            	cnt++;
            }
        }
    }
  	cout << cnt << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:31: error: request for member 'keta' in 'j', which is of non-class type 'int'
   15 |                 if(s.substr(j.keta) == 2019*i)
      |                               ^~~~
Language: C


#include<forward_list>
#include<algorithm>
#include<iostream>
#include<iomanip>
#include<iterator> 
#include<sstream>
#include<fstream>
#include<istream>
#include<utility>
#include<vector>
#include<stack>
#include<cmath>
#include<queue>
#include<deque>
#include<list>
#include<map> 
#include<set>
#define NinjaTurtle ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define infile freopen(".txt", "r", stdin);
#define outfile freopen(".txt", "w", stdout);
#define all(v) v.begin(),v.end()
#define YES cout << "YES\n";
#define NO cout << "NO\n";
#define ll long long 
#define endl "\n"
using namespace std;
int frq[10];
int main()
{
	NinjaTurtle
		string s,st;
	cin >> s;
	int cnt = 0,x=0;
	for (int i = 0; i < s.size(); i++){
		x = 0;
		x = ((x * 10) + s[i] - '0') % 2019;
		
		for (int j = i + 1; j < s.size(); j++){
			x = ((x * 10) + s[j] - '0') % 2019;
			if (x%2019==0)cnt++;
			
		}
	}
	cout << cnt << endl;





}

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

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


int main()
{
	string s;
  	cin >> s;
  	int cnt = 0;
  	for(int i = 1; i < 100; i++;)
    {
      	int keta = log10(2019*i) + 1;
    	for(int j = 0; j < s.size() - keta; j++)
        {
        	if(s.substr(j.keta) == 2019*i)
            {
            	cnt++;
            }
        }
    }
  	cout << cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:36: error: expected ')' before ';' token
   10 |         for(int i = 1; i < 100; i++;)
      |            ~                       ^
      |                                    )
a.cc:10:37: error: expected primary-expression before ')' token
   10 |         for(int i = 1; i < 100; i++;)
      |                                     ^
Language: C

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;
using vec_b = vector<bool>;
using vec_str = vector<string>;
using graph = mat;
using edge = pair<ll,ll>;
using wgraph = vector<vector<edge>>;

#define INF (1LL << 60)
#define MOD 1000000007

#define REP(i,m,n) for(ll (i)=(m),i##_len=(n);(i)<(i##_len);++(i))
#define FORR(i,v) for(auto (i):v)
#define ALL(x) (x).begin(), (x).end()
#define _PR(x) cout << (x) << endl
#define _PS(x) cout << (x) << " "
#define SZ(x) ((ll)(x).size())
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define pb push_back


int main()
{
    string S;
    cin >> S;
    ll N = SZ(S);
    vec csum(N+1, 0);
    ll t = 1;

    REP(i,1,N+1) {
        csum[i] = (csum[i-1] + (t * (S[N-i] - '0'))) % 2019;
        t = (t * 10) % 2019;
        //_PR(csum[i]);
    }
    
    sort(ALL(csum));
    vec C;
    ll cnt = 1;
    REP(i,1,N) {
        if(csum[i] == csum[i-1]) ++cnt;
        else {
            C.pb(cnt);
            cnt = 1;
        }
    }
    if(csum[N] == csum[N-1]) ++cnt;
    C.pb(cnt);

    ll sum = 0;
    FORR(c,C) sum += c * (c - 1) / 2;
    _PR(sum);


    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 Counter

S = input()
S = S[::-1]
base = 2019
count = 0
mod_list = [0]
ten = 1
for i in range(len(S)):
    mod = (ten*int(S[i]))%base
    mod_list.append((mod+mod_list[i])%base)
    ten*= 10
    ten%= base

c = Counter(mod_list)

for i in range(2019):
    num = c[i]
    count += num*(num-1)//2
print(count)


Compiler output:
main.c:1:1: error: unknown type name 'from'
    1 | from collections import Counter
      | ^~~~
main.c:1:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'import'
    1 | from collections import Counter
      |                  ^~~~~~
main.c:1:18: error: unknown type name 'import'
Language: C++

#include "../../C++/bits/stdc++.h"
using namespace std;


int ModPow(int N, int R, int M) {
  if (R == 0) return 1;
  if (R%2 == 0) {
    int t = ModPow(N, R/2, M);
    return (t*t) % M;
  }
  return N * ModPow(N, R-1, M);
}

int main() {
  string S;
  long long int L;
  cin >> S;
  L = S.length();
  int* M = new int[L];

  int ans = 0;
  map<int, bool> mp;
  mp[0] = true;

  for (long long int i = 0; i < L; i++) {
    int x = stoi(S.substr(L-i-1, 1));
    M[i] = i==0? x : ((x*ModPow(10, i, 2019))%2019 + M[i-1])%2019;
    cout << M[i] << endl;
    if (mp.count(M[i]) > 0) ans++;
    else mp[M[i]] = true;
  }

  cout << ans << endl;
}

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

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

string s;
set<ll>st[2019];
ll solve(){
   ll n=s.size();
   ll ans=0;
   rep(i,n){
       ll rem=0,pre=0;
       for(int j=i;j<n;j++){
           rem=(10*rem+(s[j]-'0'))%2019;
           if(st[j].count(rem)!=0)break;
           st[j].insert(rem);
           if(rem==0)
           {
               pre++;
           }
       }
       ans+=pre*(pre+1)/2;
   }
   
   return ans;
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    cin>>s;
    cout<<solve()<<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 num;
    num = atoi(S.c_str());
int L;
  L=S.size();
  int i,j;
  string T;
    T.size()=L;
  
  int counter;
  counter =0;
  
  for(int j = 3; j < L; j++){
  
    for(int i = 0; i < (j-2); i++){
     if(i+3==j){
       
     }else if(i+4==j){
       
     }else if(i+5==j){
       if(num%2019==0){
         counter++;
       }
     }
    }
    
  }
  cout << num;
}

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

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;
using vec_b = vector<bool>;
using vec_str = vector<string>;
using graph = mat;
using edge = pair<ll,ll>;
using wgraph = vector<vector<edge>>;

#define INF (1LL << 60)
#define MOD 1000000007

#define REP(i,m,n) for(ll (i)=(m),i##_len=(n);(i)<(i##_len);++(i))
#define FORR(i,v) for(auto (i):v)
#define ALL(x) (x).begin(), (x).end()
#define _PR(x) cout << (x) << endl
#define _PS(x) cout << (x) << " "
#define SZ(x) ((ll)(x).size())
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define pb push_back


int main()
{
    string S;
    cin >> S;
    ll N = SZ(S);
    vec csum(N+1, 0);
    ll t = 1;

    REP(i,1,N+1) {
        csum[i] = (csum[i-1] + (t * (S[N-i] - '0'))) % 2019;
        t = (t * 10) % 2019;
        //_PR(csum[i]);
    }
    
    sort(ALL(csum));
    vec C;
    ll cnt = 1;
    REP(i,1,N) {
        if(csum[i] == csum[i-1]) ++cnt;
        else {
            C.pb(cnt);
            cnt = 1;
        }
    }
    if(csum[N] == csum[N-1]) ++cnt;
    C.pb(cnt);

    REP(i,0,N+1) _PR(csum[i]);

    ll sum = 0;
    FORR(c,C) sum += c * (c - 1) / 2;
    _PR(sum);


    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();
    int count = 0;
    for(int i=4;i<=n;i++){
        for(int j=0;j<n-i+1;j++){
            string m = S.substr(j,i);
            istringstream ss;
            ss = istringstream(m);
          	int M;
          	ss >> M;
            if(M%2019 == 0) count ++;
        }
    }
    cout <<count<<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;
 
#define ll long long
#define endl "\n";
#define mod 1000000007
#define inf 1e18
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define mp make_pair
#define all(a) a.begin(), a.end()
#define mk(arr,n,type) type *arr=new type[n];
 
void fastio() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}
 
int main() {
    fastio();
    string s;
    cin >> s;
    int n = s.length();
 
    unordered_map<int,int> umap;
 
    ll ans = 0;
    for (int i=0; i<n; i++) {
    	int num = 0;
    	int curr=0;
    	vi js(n-4);
      	int mmm = 0;
    	for (int j=i; j<n; j++) {
    		num = num*10 + (s[j] - '0');
    		if (num%2019==0) {
    			if (umap.count(j)) {
    				ans += umap[j];
    				break;
    			}
    			ans++;
    			curr++;
    			js[mmm++] = j;
    		}
    		num %= 2019;
    	}
    	for (int i=0; i<mmmm; i++) {
    		umap[js[i]] = curr - i;
    	}
    }
 
    cout << ans;
 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:25: error: 'mmmm' was not declared in this scope; did you mean 'mmm'?
   50 |         for (int i=0; i<mmmm; i++) {
      |                         ^~~~
      |                         mmm
Language: C++

#include <bits/stdc++.h> 
using namespace std; 
  
// Function to calculate any permutation divisible 
// by 8. If such permutation exists, the function 
// will return that permutation else it will return -1 
int isSubSeqDivisible(string str) 
{ 
    // Generating all possible permutations and checking 
    // if any such permutation is divisible by 8 
    int count=0;
    for (int i = 0; i < l; i++) { 
        for (int j = i; j < l; j++) { 
            for (int k = j; k < l; k++) { 
                if (arr[i] % 8 == 0) 
                    count++; 
  
                else if ((arr[i] * 10 + arr[j]) % 8 == 0 && i != j) 
                    count++; 
  
                else if ((arr[i] * 100 + arr[j] * 10 + arr[k]) % 8 == 0 && i != j && j != k && i != k) 
                    count++; 
            } 
        } 
    } 
    return count; 
} 
  
// Driver function 
int main() 
{ 
    string str;
  	cin>>str;
    cout<<(isSubSeqDivisible(str));
       
    return 0; 
} 

Compiler output:
a.cc: In function 'int isSubSeqDivisible(std::string)':
a.cc:12:25: error: 'l' was not declared in this scope
   12 |     for (int i = 0; i < l; i++) {
      |                         ^
a.cc:15:21: error: 'arr' was not declared in this scope
   15 |                 if (arr[i] % 8 == 0)
      |                     ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int cnt=0;
  string t;
  int u;
  for (int i=0;i<s.length()-3;i++){
    for (int j=4;j<=s.length()-i;j++){
      t=s.substr(i,j);
      u=(int)t
      if (u%2019==0){
        cnt++;
      }
    }
  }
  cout << cnt << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int'
   12 |       u=(int)t
      |         ^~~~~~
Language: C

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<cstddef>
#include<queue>
#include<math.h>
#include<iomanip>
using namespace std;

int main()
{
    string S, s;
    cin >> S;
    int N =  S.size(), ans = 0;
    long long num;
    for(int len = 1; len < N + 1; ++len){
        for(int i = 0; i < N  + 1 - len; ++i){
            for(int j = i; j < i + len; ++j){
                s += S.at(j);
            }
            num = stol(s);
            if(num % 2019 == 0) ans++; 
            s = '0';
        }
    }
    cout << ans << endl;
    return 0;
}


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

// #include <bits/stdc++.h>
#include <string>
#include <iostream>
#define REP(i, n) for(long long i = 0; i < n; i++)
#define REPR(i, n) for(long long i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(long long i = m; i <= n; i++)
#define FORR(i, m, n) for(long long i = m; i >= n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define VSORTR(v) sort(v.rbegin(), v.rend());
#define ALL(v) (v).begin(),(v).end()
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;
const ll mod = 1e9+7;


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

    string s; cin>>s;
    int n = s.size();
    ll dp[n+1][2019];

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

    // REP(i,n+1)REP(j,2019) dp[i][j]=0;
    char a = s[0];
    dp[1][a-'0'] = 1;

    FOR(i,1,n-1){
        a = s[i];
        int keta = a-'0';
        dp[i+1][keta]++;

        REP(j,2019){  
            // if (i==10) cout<<dp[i][j]<<endl; 
            dp[i+1][(j*10+keta) % 2019] += dp[i][j];
        }

    }
    int ans = 0;

    FOR(i,1,n){
        cout<<dp[i][0]<<endl;
        ans += dp[i][0];
    }

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

Compiler output:
a.cc:14:13: error: 'vector' does not name a type
   14 | using vll = vector<ll>;
      |             ^~~~~~
a.cc:15:14: error: 'vector' does not name a type
   15 | using vvll = vector<vector<ll>>;
      |              ^~~~~~
Language: C

#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
using namespace std;

int main()
{    
  string S;
  cin >> S;
  int ans = 0;
  int digit_num = S.length();
  if (digit_num <4)
  {
    cout << 0 << endl;
    return 0;
  }
  
  for (int i = 1; i <= digit_num-3; i++)
  {
    for (int j = i+3; j <= digit_num; j++)
    {
      string str_ext = S.substr(i-1, j-i+1);
      int num_ext = atoi(str_ext.c_str());
      if (num_ext%2019 == 0)
      {
        ans ++;
      }

    }
    
  }
  cout << ans << endl;
} 


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

// 4/26 リアルタイム参加

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

int main() {
    string S;
    cin >> S;
    int N = S.size();
    // cout << "S is " << S << endl;
    // cout << "N is " << N << endl;

    int ans = 0;

    for (int i = 0; i < N ; i++) {
        string sub;
        int amari = 0;
        for (int j = i; j < N; j++) {
            // int s = atoi(S.substr(i, j - i + 1).c_str());
            // if (s % 2019 == 0) {
            //     ans++;
            //     // cout << "i, j = " << i << " " << j << endl;
            // }d

            // cout << atoi(S.substr(j, 1).c_str()) << endl;
            // amari = (amari * 10 + atoi(S.substr(j, 1).c_str())) % 2019;

            int s;
            s = S[j] - '0';
            // cout << s << endl;

            amari = (amari * 10 + s) % 2019;

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

    cout << ans << endl;
}

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

#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const string ln = "\n";
constexpr int INF = 1001001001;
constexpr int MOD = 1000000007;

ll modpow(ll a, ll n) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % 2019;
    a = a * a % 2019;
    n >>= 1;
  }
  return res;
}

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

  string s;
  cin >> s;

  ll n = s.size();

  ll md[210000] = {};
  md[0] = 1;
  for (int i = 1; i <= 200000; i++) {
    md[i] = modpow(10, i);
  }

  ll ans = 0;
  for (int l = 0; l < n - 4; l++) {
    for (int r = l + 4; r <= n; r++) {
      string sub = s.substr(l, r);
      ll sum = 0;
      for (int i = 0; i < sub.size(); i++) {
        ll num = sub[sub.size() - 1 - i] - '0';
        ll t = (num * md[i]) % 2019;
        sum += t;
        sum %= 2019;
      }

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

  cout << ans << ln;

  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: Java

import java.util.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
      	PrintWriter out = new PrintWriter(System.out);
        Scanner scan = new Scanner(System.in);
        HashSet hs = new HashSet();
        String Ans = scan.next();
        for(int i=0;i<Ans.length();i++){
            for(int j=1;j<Ans.length()+1;j++){
                String kari="1";
                try{
                kari= Ans.substring(i,j);
                //System.out.println(kari);
                double Kans = Double.parseDouble(kari);
                if(Kans%2019==0){
                    String x =i+","+j;
                    hs.add(x);
                }
                
                }
                catch(NumberFormatException e){
                    continue;
                }
                catch(StringIndexOutOfBoundsException ee){
                    continue;
                }
            }
        }
        out.println(hs.size());
      out.flush();
    }
}

Compiler output:
Main.java:6: error: cannot find symbol
      	PrintWriter out = new PrintWriter(System.out);
      	^
  symbol:   class PrintWriter
  location: class Main
Main.java:6: error: cannot find symbol
      	PrintWriter out = new PrintWriter(System.out);
      	                      ^
  symbol:   class PrintWriter
  location: class Main
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors