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

#include<iostream>

using namespace std;
int main()
{
    string S;
    cin >> S;
 
    //Tn=0
    //T(n-1)=右端ビット
    //あまりが同じもののmC2(mはかぶりあまりの個数)を足し合わせる
    int n=S.size();

    //あまりの個数
    int* modulo_number = new int[2019];
    for(int i=1;i<2019;++i){
        modulo_number[i]=0;
    }
    modulo_number[0]=1;

    for(int i=0;i<n;++i){
        //該当するあまり個数を加算
        modulo_number[atoi(S.substr(i).c_str())%2019]++;
    }

    //数え上げ
    int count=0;
    for(int i=0;i<2019;++i){
        int m=modulo_number[i];
        count=count+m*(m-1)/2;
    }
    
    cout << count << endl;
    delete [] modulo_numer
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:15: error: 'modulo_numer' was not declared in this scope; did you mean 'modulo_number'?
   34 |     delete [] modulo_numer
      |               ^~~~~~~~~~~~
      |               modulo_number
Language: C++

#include<iostream>

using namespace std;
int main()
{
    string S;
    cin >> S;
    /*
    int S_size=S.size();
    int max_i=S_size-4;
    int count=0;
    for(int i=0;i<=max_i;++i){
        int max_j=S_size-i;
        for(int j=4;j<=max_j;++j){
           if(atoi(S.substr(i,j).c_str())%2019==0){
               ++count;
           }
        }
    }
    */
    //Tn=0
    //T(n-1)=右端ビット
    //あまりが同じもののmC2(mはかぶりあまりの個数)を足し合わせる
    int n=S.size();

    //あまりの個数
    int* modulo_number = new int[2019];
    for(int i=1;i<2019;++i){
        modulo_number[i]=0;
    }
    modulo_number[0]=1;

    for(int i=0;i<n;++i){
        //該当するあまり個数を加算
        modulo_number[atoi(S.substr(i).c_str())%2019]++;
    }

    //数え上げ
    int count=0;
    for(int i=0;i<2019;++i){
        int m=modulo_number[i];
        count=count+m*(m-1)/2;
    }
    
    cout << count << endl;
    delete [] modulo
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:15: error: 'modulo' was not declared in this scope
   46 |     delete [] modulo
      |               ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define all(x) (x).begin(),(x).end()
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
using Graph = vector<vector<int>>;
const double pi=acos(-1);
double nCk(int n, int k) {
double res=1.0;
for(int i=0; i<n; i++){
res*=0.5;}
for(int i=0; i<k; i++){
res*=(double)(n-i);
res/=(double)(k-i);
}
return res;}
 
int main() {
//cout << fixed << setprecision(12);
string s;
cin>>s;
reverse(all(s));
ll ca=0;
ll a[2020]={};
ll n=s.size();
string t = "";
rep(i,n){
t += s.at(i);


Compiler output:
a.cc: In function 'int main()':
a.cc:43:14: error: expected '}' at end of input
   43 | t += s.at(i);
      |              ^
a.cc:42:9: note: to match this '{'
   42 | rep(i,n){
      |         ^
a.cc:43:14: error: expected '}' at end of input
   43 | t += s.at(i);
      |              ^
a.cc:33:12: note: to match this '{'
   33 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <cmath>
#include <stdint.h>
#include <iomanip>
using namespace std;

#define int long long
 
int32_t main() {
	
 	string s;
 	
    cin>>s;
   
	reverse(s.begin(),s.end());
	
	int ans=0;
	
	int p = 1;
	
	int total =0;
	vector<int> cnt(2020);
	for(int i=0 ;i<s.length(); i++){
		
		cnt[total]++;
		
		total += ( ( s[i] - '0') * p) % 2019;
		
		ans += cnt[total];
		
		p *= 10 % 2019;
		
	}

	cout << ans << endl;
	
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:15:9: error: 'reverse' was not declared in this scope
   15 |         reverse(s.begin(),s.end());
      |         ^~~~~~~
a.cc:22:9: error: 'vector' was not declared in this scope
   22 |         vector<int> cnt(2020);
      |         ^~~~~~
a.cc:5:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    4 | #include <iomanip>
  +++ |+#include <vector>
    5 | using namespace std;
a.cc:7:13: error: expected primary-expression before 'long'
    7 | #define int long long
      |             ^~~~
a.cc:22:16: note: in expansion of macro 'int'
   22 |         vector<int> cnt(2020);
      |                ^~~
a.cc:25:17: error: 'cnt' was not declared in this scope; did you mean 'int'?
   25 |                 cnt[total]++;
      |                 ^~~
      |                 int
Language: C++

#include <iostream>
#include <cmath>
#include <stdint.h>
#include <iomanip>
using namespace std;

#define int long long

int32_t main() {
	
 	string s;
 	
    cin>>s;
   
	reserve(s.begin(),s.end());
	
	int cnt[2020];
	
	int ans=0;
	
	int p = 1;
	
	int total =0;
	
	for(int i=0 ;i<s.length(); i++){
		
		cnt[total]++;
		
		total += ( ( s[i] - '0') * p % 2019);
		
		ans += cnt[total];
		
		p *= 10 % 2019;
		
	}

	cout << ans << endl;
	
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:15:9: error: 'reserve' was not declared in this scope
   15 |         reserve(s.begin(),s.end());
      |         ^~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vll;
 
#define  ff         first
#define  ss         second
#define  pb         push_back
#define  all(x)     (x).begin(), (x).end()
#define  rep(i,a,b) for(int i=a ; i<b ; ++i)
#define  deb(x)     cout << #x << " - " << x << "\n";
#define  IOS        ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define  D2(x)      cout << "[" << #x << ": "; for(auto it:x) cout << it << " "; cout << "]\n"; 
#define  D2p(x)	    cout << #x << " ~ [ "; for(auto n: x) cout << n.first << "-" << n.second << " / "; cout << "]" << "\n";
#define  ps(x,y)    fixed<<setprecision(y)<<x
 
#define PI 3.141592653589793238462643383279502884L
// const ll MOD = 1e9 + 7;
const ll INF = 1000000000;
const ll MAX_N = 4e4 + 10;

 
int main() {
    IOS;
    ll MOD = 2019;
    string s; cin >> s;
    map<ll,ll>mp;
    ll suf = 0,pot = 1;
    mp[suf]++;
    ll ans = 0;
    for(ll i=n-1;i>=0;--i){
        ll dig = s[i] - '0';
        suf = (suf + dig * pot) % MOD;
        pot = (10 * pot) % MOD;
        ans += mp[suf];
        mp[suf]++;
    }
    cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:14: error: 'n' was not declared in this scope
   33 |     for(ll i=n-1;i>=0;--i){
      |              ^
Language: C++

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

vector<int> SV;
int cnt = 0;

int ctoi(const 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 -1;
    }
}


void s(int start, int end) {
    int num = 0;
    if(start>=SV.size()) {
        return;
    }
    if(end>=SV.size()) {
        end = start;
        s(start+1, end+5);
        return;
    }
    if(end-start>=3) {
        int j=end-start;
        xrep(i, start, end+1) {
            num += SV[i] * pow(10,j);
            --j;
        }
        if(num%2019==0) {
            ++cnt;
            s(start+4, end+4);
            return;
        }
    }
    s(start, end+1);
    return;
}


int main() {
    string S;
    cin >> S;
    int ss;
    for(auto s :S) {
        ss = ctoi(s);
        SV.push_back(ss);
    }

    s(0, 4);
    cout << cnt << endl;
    return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:75:14: error: expected '}' at end of input
   75 |     return 0;
      |              ^
a.cc:64:12: note: to match this '{'
   64 | int main() {
      |            ^
Language: C++

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

vector<int> SV;
int cnt = 0;

int ctoi(const 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 -1;
    }
}


void s(int start, int end) {
    int num = 0;
    if(start>=SV.size()) {
        return;
    }
    if(end>=SV.size()) {
        end = start;
        s(start+1, end+5);
        return;
    }
    if(end-start>=3) {
        int j=end-start;
        xrep(i, start, end+1) {
            num += SV[i] * pow(10,j);
            --j;
        }
        if(num%2019==0) {
            ++cnt;
        }
    }
    s(start, end+4);
}


int main() {
    string S;
    cin >> S;
    int ss;
    for(auto s :S) {
        ss = ctoi(s);
        SV.push_back(ss);
    }

    s(1, 5);
    cout << cnt << endl;
    return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:72:14: error: expected '}' at end of input
   72 |     return 0;
      |              ^
a.cc:61:12: note: to match this '{'
   61 | int main() {
      |            ^
Language: C++

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

vector<int> SV;
int cnt = 0;

int ctoi(const 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 -1;
    }
}


void s(int start, int end) {
    int num = 0;
    if(start>=SV.size()) {
        return;
    }
    if(end>=SV.size()) {
        end = start;
        s(start+1, end+5);
        return;
    }
    stack<int> SQ;
    if(end-start>=3) {
        int j=end-start;
        xrep(i, start, end+1) {
            num += SV[i] * pow(10,j);
            --j;
        }
        if(num%2019==0) {
            ++cnt;
        }
    }
    s(start, end+4);
}


int main() {
    string S;
    cin >> S;
    for(auto s :S) {
        int ss = ctoi(s);
        SV.push_back(ss);
    }

    s(0, 4);
    cout << cnt << endl;
    return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:72:14: error: expected '}' at end of input
   72 |     return 0;
      |              ^
a.cc:62:12: note: to match this '{'
   62 | int main() {
      |            ^
Language: C++

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

vector<int> SV;
int cnt = 0;

int ctoi(const 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 -1;
    }
}


void s(int start, int end) {
    int num = 0;
    if(start==SV.size()) {
        return;
    }
    if(end==SV.size()) {
        end = start;
        s(start+1, end+2);
        return;
    }
    stack<int> SQ;
    if(end-start>=3) {
        int j=end-start;
        xrep(i, start, end+1) {
            num += SV[i] * pow(10,j);
            --j;
        }
        if(num%2019==0) {
            ++cnt;
        }
    }
    s(start, end+1);
}


int main() {
    string S;
    cin >> S;
    for(auto s :S) {
        int ss = ctoi(s);
        SV.push_back(ss);
    }

    s(0, 4);
    cout << cnt << endl;
    return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:72:14: error: expected '}' at end of input
   72 |     return 0;
      |              ^
a.cc:62:12: note: to match this '{'
   62 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

void print(const std::vector<long long>& v)
{
  std::for_each(v.begin(), v.end(), [](int x) {
    std::cout << x << " ";
  });
  std::cout << std::endl;
}

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

    if(S.size() < 3) {
        cout << 0 << endl;
        return 0;
    }

    reverse(S.begin(),S.end());

    vector<int> count(m);
    int x = 1;
    int m = 2019;
    int tot = 0;
    int ans = 0;
    for(int i = 0;i < (int)S.size(); i++){
        count[tot]++;
        tot += ((S[i] - '0') * x);
        tot = tot % m;
        ans += count[tot];
        x = x * 10 % 2019;
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:23: error: 'm' was not declared in this scope
   25 |     vector<int> count(m);
      |                       ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

void print(const std::vector<long long>& v)
{
  std::for_each(v.begin(), v.end(), [](int x) {
    std::cout << x << " ";
  });
  std::cout << std::endl;
}

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

    if(S.size() < 3) {
        cout << 0 << endl;
        return 0;
    }

    reverse(S.begin(),S.end());

    vector<int> count(m);
    int x = 1;
    int m = 2019;
    int tot = 0;
    int ans = 0;
    for(int i = 0;i < (int)S.size(); i++){
        count[tot]++;
        tot += ((S[i] - '0') * x));
        tot = tot % m;
        ans += count[tot];
        x = x * 10 % 2019;
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:23: error: 'm' was not declared in this scope
   25 |     vector<int> count(m);
      |                       ^
a.cc:32:34: error: expected ';' before ')' token
   32 |         tot += ((S[i] - '0') * x));
      |                                  ^
      |                                  ;
Language: C++

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

#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

/* a と b の最大公約数を返す関数 */
long long GCD(long long a, long long b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}


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

	int len = s.length();
	int cnt = 0;
	int est;

	cout << len << endl;
	for (int i = 0; i <= (len-1); ++i)
	{
		for (int j = 1; j <= (len - i); ++j)
		{
			sscanf_s(s.substr(i, j).c_str(), "%d", &est);
			if (est % 2019 == 0 && est != 0)
			{	
				++cnt;
			}
		}
	}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:36:25: error: 'sscanf_s' was not declared in this scope; did you mean 'sscanf'?
   36 |                         sscanf_s(s.substr(i, j).c_str(), "%d", &est);
      |                         ^~~~~~~~
      |                         sscanf
Language: C++

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)

const int mod = 2019;

int main() {
  string s;
  cin >> s;
  int n = s.size();
  reverse(s.begin(), s.end());

  vector<int> s(n + 1);
  int mul = 1;
  rep(i, n) {
    int x = s[i] - '0';
    x = x * mul % mod;
    s[i + 1] = (s[i] + x) % mod;
    mul = mul * 10 % mod;
  }

  vector<int> cnt(mod);
  rep(i, n + 1)++ cnt[s[i]];
  ll ans = 0;
  rep(i, 2019) { ans += (ll)cnt[i] * (cnt[i] - 1) / 2; }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:15: error: conflicting declaration 'std::vector<int> s'
   16 |   vector<int> s(n + 1);
      |               ^
a.cc:11:10: note: previous declaration as 'std::string s'
   11 |   string s;
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define REP(i, m, n) for(int i = m; i < n; i++)
typedef long long ll;
typedef pair<ui,ui> puu;
typedef pair<int, int> P;
typedef vector<int> vi;
template<class T>inline bool chmax(T& a,T b){if(a < b){a=b;return true;}return false;};
template<class T>inline bool chmin(T& a,T b){if(a > b){a=b;return true;}return false;};
int d[2019];
int d2[2019];
int main() {
    
    vi a(200010);
    str s;
    cin >> s;
    int n=s.length();
    int ans=0;
    rep(i,n) a[i]=s[i]-'0';
    d2[a[0]]++;
    REP(i,1,n){
        d[a[i]]++;
        rep(j,2019){
            d[(10*j+a[i])%2019]+=d2[j];
        }
        ans+=d[0];
        rep(j,2019){
            d2[j]=d[j];
            d[j]=0;
        }
    }
    cout << ans << endl;
}


Compiler output:
a.cc:6:14: error: 'ui' was not declared in this scope
    6 | typedef pair<ui,ui> puu;
      |              ^~
a.cc:6:17: error: 'ui' was not declared in this scope
    6 | typedef pair<ui,ui> puu;
      |                 ^~
a.cc:6:19: error: template argument 1 is invalid
    6 | typedef pair<ui,ui> puu;
      |                   ^
a.cc:6:19: error: template argument 2 is invalid
a.cc: In function 'int main()':
a.cc:16:5: error: 'str' was not declared in this scope; did you mean 'std'?
   16 |     str s;
      |     ^~~
      |     std
a.cc:17:12: error: 's' was not declared in this scope
   17 |     cin >> s;
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
using Graph = vector<vector<ll>>;
using P = pair<int,int>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
#define MOD 1000000007
#define INF 1000000
#define PI 3.14159265358979323846264338327950L
#define MAX_N 200010
#define lb lower_bound //[2,4)=lb(4)-lb(2)

int main()
{
  string s;cin>>s;
  reverse(s.begin(), s.end());
  int n = s.size();
  map<ll,ll> m;
  
  ll now = s[0]-'0';
  ll p;
  m[now]++;
  for (int i=1;i<n;i++)
  {
    p = pow(10,i) % 2019;
    now = ((s[i]-'0')*p+now);
    now %= 2019
    m[now]++;
  }
  
  ll ans=0;
  for (auto i=m.begin();i!=m.end();i++){
    ans += i->second -1;
  }
  
  if (m[0]==1) ans++;
  
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:19: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
   27 |     p = pow(10,i) % 2019;
      |         ~~~~~~~~~ ^ ~~~~
      |            |        |
      |            |        int
      |            __gnu_cxx::__promote<double>::__type {aka double}
a.cc:29:16: error: expected ';' before 'm'
   29 |     now %= 2019
      |                ^
      |                ;
   30 |     m[now]++;
      |     ~
Language: C++

s = input()
n = len(s)
count=0
for i in range(n):
  for j in range(n-i):
    if(int(s[i:i+j+1])%2019==0):
      count+=1
print(count)

Compiler output:
a.cc:1:1: error: 's' does not name a type
    1 | s = input()
      | ^
Language: C

#include <bits/stdc++.h>

using namespace std;

int dp[200009][2020];
int main(){
  string s;
  cin >> s;
  memset(dp, 0, sizeof(dp));
  dp[0][s[0]-'0']++;
  for(int i=1;i<s.length();i++){
    dp[i][s[i]-'0']++;
    for(int j=0;j<2019;j++){
      dp[i][(j*10+s[i]-'0')%2019]+=dp[i-1][j];
    }
  }
  int ans=0;
  for(int i=0;i<s.length();i++){
    ans += dp[i][0];
  }
  cout << ans << endl;
}



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

/******************************************************************************
 
рассвет. 
 
*******************************************************************************/
#include <bits/stdc++.h>
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ld;
#define rapgame ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define eb emplace_back
#define vi vector <int>
#define vlli vector <lli>
#define vulli vector <ulli>
#define vchar vector <char>
#define vstr vector <string>
#define vb vector <bool>
#define fst first
#define sec second
#define srt(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define vpii vector <pair <int,int> >
#define pii pair <int,int> 
#define vplli vector <pair <lli,lli> >
#define vpulli vector <pair <ulli,ulli> >
#define vvi vector <vector <int> >
#define vvlli vector <vector <lli> >
#define vvpii vector <vector <pair <int,int>> >
#define fr(i,n) for (int i = 0; i < (n); ++i)
#define frbig(i,n) for (lli i = 0; i < (n); ++i)
#define fra(i,a,n) for (lli i = a; i < (n); ++i)
#define run(c,s) for(auto c:s) 
#define read(n) int n; cin >> n;
#define readchar(n) char n; cin >> n;
#define readstr(n) string n; cin >> n;
#define readarr(a,n) fr(i,n) cin >> a[i];
#define read2(x,y) int x,y; cin >> x >> y;
#define read2ll(x,y) long long int x,y; cin >> x >> y;
#define readll(n) lli n; cin >> n;
#define watch(x) cout << (#x) << " is " << (x) << endl
#define print_array(x) fr(i,x.size()) cout << x[i] << " ";
using namespace std;
 
const lli MOD=1e9+7;
const lli MAXN=1e6+1;
const ld PI=acos(-1);
 
int main(){
    rapgame
    string s;
    cin >> s;
    vi a(2019,0);
    int cur=0;lli ans=0;
    for(int i=n-1;i>-1;--i){
        int dig=s[i]-'0';
        cur=10*cur+dig;
        cur%=2019;
        a[cur]++;
    }
    fr(i,2019){
        ans+=a[i]*(a[i]-1)/2;
    }
    cout << ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:15: error: 'n' was not declared in this scope
   55 |     for(int i=n-1;i>-1;--i){
      |               ^
Language: C++

/******************************************************************************
 
рассвет. 
 
*******************************************************************************/
#include <bits/stdc++.h>
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ld;
#define rapgame ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define eb emplace_back
#define vi vector <int>
#define vlli vector <lli>
#define vulli vector <ulli>
#define vchar vector <char>
#define vstr vector <string>
#define vb vector <bool>
#define fst first
#define sec second
#define srt(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define vpii vector <pair <int,int> >
#define pii pair <int,int> 
#define vplli vector <pair <lli,lli> >
#define vpulli vector <pair <ulli,ulli> >
#define vvi vector <vector <int> >
#define vvlli vector <vector <lli> >
#define vvpii vector <vector <pair <int,int>> >
#define fr(i,n) for (int i = 0; i < (n); ++i)
#define frbig(i,n) for (lli i = 0; i < (n); ++i)
#define fra(i,a,n) for (lli i = a; i < (n); ++i)
#define run(c,s) for(auto c:s) 
#define read(n) int n; cin >> n;
#define readchar(n) char n; cin >> n;
#define readstr(n) string n; cin >> n;
#define readarr(a,n) fr(i,n) cin >> a[i];
#define read2(x,y) int x,y; cin >> x >> y;
#define read2ll(x,y) long long int x,y; cin >> x >> y;
#define readll(n) lli n; cin >> n;
#define watch(x) cout << (#x) << " is " << (x) << endl
#define print_array(x) fr(i,x.size()) cout << x[i] << " ";
using namespace std;
 
const lli MOD=1e9+7;
const lli MAXN=1e6+1;
const ld PI=acos(-1);
 
int main(){
    rapgame
    string s;
    cin >> s;
    vi a(2019,0);
    int cur=0,lli ans=0;
    for(int i=n-1;i>-1;--i){
        int dig=s[i]-'0';
        cur=10*cur+dig;
        cur%=2019;
        a[cur]++;
    }
    fr(i,2019){
        ans+=a[i]*(a[i]-1)/2;
    }
    cout << ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:19: error: expected initializer before 'ans'
   54 |     int cur=0,lli ans=0;
      |                   ^~~
a.cc:55:15: error: 'n' was not declared in this scope
   55 |     for(int i=n-1;i>-1;--i){
      |               ^
a.cc:62:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   62 |         ans+=a[i]*(a[i]-1)/2;
      |         ^~~
      |         abs
a.cc:64:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   64 |     cout << ans;
      |             ^~~
      |             abs
Language: C++

/******************************************************************************
 
рассвет. 
 
*******************************************************************************/
#include <bits/stdc++.h>
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ld;
#define rapgame ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define eb emplace_back
#define vi vector <int>
#define vlli vector <lli>
#define vulli vector <ulli>
#define vchar vector <char>
#define vstr vector <string>
#define vb vector <bool>
#define fst first
#define sec second
#define srt(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define vpii vector <pair <int,int> >
#define pii pair <int,int> 
#define vplli vector <pair <lli,lli> >
#define vpulli vector <pair <ulli,ulli> >
#define vvi vector <vector <int> >
#define vvlli vector <vector <lli> >
#define vvpii vector <vector <pair <int,int>> >
#define fr(i,n) for (int i = 0; i < (n); ++i)
#define frbig(i,n) for (lli i = 0; i < (n); ++i)
#define fra(i,a,n) for (lli i = a; i < (n); ++i)
#define run(c,s) for(auto c:s) 
#define read(n) int n; cin >> n;
#define readchar(n) char n; cin >> n;
#define readstr(n) string n; cin >> n;
#define readarr(a,n) fr(i,n) cin >> a[i];
#define read2(x,y) int x,y; cin >> x >> y;
#define read2ll(x,y) long long int x,y; cin >> x >> y;
#define readll(n) lli n; cin >> n;
#define watch(x) cout << (#x) << " is " << (x) << endl
#define print_array(x) fr(i,x.size()) cout << x[i] << " ";
using namespace std;
 
const lli MOD=1e9+7;
const lli MAXN=1e6+1;
const ld PI=acos(-1);
 
int main(){
    rapgame
    string s;
    cin >> s;
    vi a(2019,0);
    lli ans=0;
    int n=(int)s.size();
    cur=0;
    fr(i,n){
        int dig=s[i]-'0';
        cur*=10;
        cur+=dig;
        a[cur%2019]++;
        cur%=2019;
    }
    fr(i,2019){
        ans+=a[i]*(a[i]-1)/2;
    }
    cout << ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:5: error: 'cur' was not declared in this scope
   56 |     cur=0;
      |     ^~~
Language: C++

#include <cstdio>
#include <vector>
#include <string>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <cstdlib>
using namespace std;

const int mod = 2019;

char p[200010];
int a[200010], b[200010], s[200010];

int main() {
    int n;
    cin>>(p+1);
    n = strlen(p + 1);
    int c = 1, now = 0;
    long long ans = 0;
    for(int i = 1; i <= n; i++) a[i] = p[i] - '0';
    s[0] = 1;
    for(int i = n; i >= 1; i--) {
        now += a[i] * c;
        c *= 10;
        now %= mod;
        c %= mod;
        ans += s[now];
        //if(s[now] > 0) printf("%d\n", i);
        s[now]++;
    }
    cout<<ans<<endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: 'cin' was not declared in this scope
   17 |     cin>>(p+1);
      |     ^~~
a.cc:8:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    7 | #include <cstdlib>
  +++ |+#include <iostream>
    8 | using namespace std;
a.cc:32:5: error: 'cout' was not declared in this scope
   32 |     cout<<ans<<endl;
      |     ^~~~
a.cc:32:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:32:16: error: 'endl' was not declared in this scope
   32 |     cout<<ans<<endl;
      |                ^~~~
a.cc:8:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    7 | #include <cstdlib>
  +++ |+#include <ostream>
    8 | using namespace std;
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 PI 3.14159265358979323846264338327950
int main () {
    string S;
    cin >> S ;
    reverse(S.begin(),S.end());
    vector<int> a(2019);
    int tot = 0 ;
    int x = 1 ;
    int n = S.size();
    ll ans = 0; 
    rep(i,n){
        a[tot]++ ;
        tot += (S[i] - '0') * x ;
        tot %= 2019 ;
        ans += a[tot] ;
        x *= 10 ;
        x %= 2019 ;
    }
    cout << ans << endl ;
}

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

#include <bits/stdc++.h>

using namespace std;

int main(){
string s;
cin>>s;
int cnt=0;
for(int i=0;i<s.size();i++){
string sub="";
for(int j=i;j<s.size();j++){
sub+=s[j];
int n= stoi(sub)
if(n%2019==0){
cnt++;
}
}
}
cout<<cnt<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:14:1: error: expected ',' or ';' before 'if'
   14 | if(n%2019==0){
      | ^~
Language: C

#include <bits/stdc++.h>
#define FORD(i, a, b) for (ll i = a; i >= (ll)(b); i--)
using namespace std;
typedef long long ll;

ll c_to_i(char c)
{
  return (ll)c - (ll)'0';
}

class mint
{
  const ll mod = 2019;

public:
  ll x;

  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const
  {
    return mint(-x);
  }
  mint &operator+=(const mint &a)
  {
    if ((x += a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator-=(const mint &a)
  {
    if ((x += mod - a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator*=(const mint &a)
  {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint &a) const
  {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint &a) const
  {
    mint res(*this);
    return res -= a;
  }
  mint operator*(const mint &a) const
  {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const
  {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }
  // for prime mod
  mint inv() const
  {
    return pow(mod - 2);
  }
  mint &operator/=(const mint &a)
  {
    return (*this) *= a.inv();
  }
  mint operator/(const mint &a) const
  {
    mint res(*this);
    return res /= a;
  }
  friend ostream &operator<<(ostream &os, const mint &m)
  {
    os << m.x;
    return os;
  }
};

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

  ll n = s.length();

  mint *dp = new mint[n + 1];
  mint base = 1;
  map<ll, ll> ms;

  dp[n] *= 0;
  ms[0] += 1;
  FORD(i, n - 1, 0)
  {
    dp[i] *= 0;
    dp[i] += dp[i + 1] + base * c_to_i(s[i]);
    base *= 10;
    ms[dp[i].x] += 1;
  }

  ll ans = 0;
  for (auto m : ms)
  {
    ans += m.second * (m.second - 1) / 2;
  }

  cout << ans << endl;

  return 0;
}

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

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

string s;
int sum=0;

int cal(int i)
{
    int num = s.size()-i-3;
  
    for(int j=0;j<num;j++)
    {
        int a = atoi(s.substr(i,4+j));
        if(a%2019==0)
          sum++;
    }

}



int main()
{
     cin>>s;
     
    for(int i=0;i<s.size()-3;i++)
    {
       sum += cal(i);
    
    }

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

Compiler output:
a.cc: In function 'int cal(int)':
a.cc:13:30: error: cannot convert 'std::__cxx11::basic_string<char>' to 'const char*'
   13 |         int a = atoi(s.substr(i,4+j));
      |                      ~~~~~~~~^~~~~~~
      |                              |
      |                              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:18:1: warning: no return statement in function returning non-void [-Wreturn-type]
   18 | }
      | ^
Language: C++

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

int main()
{
 	string s;
  	cin>>s;
  	ll cnt=0;
  	ll num=stoi(s);
  	for(ll i=1;2019*i<=num;i++)
    {
      ll check=2019*i;
      string checkstring=to_string(check);
      int pos=s.find(checkstring)
      while(pos!=string::npos)
      {
        cnt+=1;
        pos=s.find(checkstring,pos);
    }
    cout<<cnt<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:7: error: expected ',' or ';' before 'while'
   16 |       while(pos!=string::npos)
      |       ^~~~~
a.cc:22:2: error: expected '}' at end of input
   22 | }
      |  ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: Java

public static void main(String[] args){
  String s;
  Scanner scanner = new Scanner(System.in);
  s = scanner.nextLine();
  final int MOD = 2019;
  int power_of_ten  =1;
  int n = s.length(), suf  = 0;
  long answer = 0;
  int[] cnt_suf = new int[MOD];
  cnt_suf[suf]++;
  
  for (int i= n -1; i >=0; i--){
    int digit = s.charAt(i) - '0';
    suf = (suf + digit * power_of_ten) % MOD;
    power_of_ten = 10 * power_of_ten % MOD;
    answer += cnt_suf[suf];
    cnt_suf[suf]++;
  }
  System.out.println(answer);
}

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args){
              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: Java

public static void main(String[] args){
  String s;
  Scanner scanenr = new Scanner(System.in);
  s = scanner.next();
  final int MOD = 2019;
  int power_of_ten  =1;
  int n = s.length(), suf  = 0;long answer = 0;
  int cnt_suf = new int[MOD];
  cnt_suf[suf]++;
  
  for (int i= n -1; i >=0; i--){
    int digit = s.charAt(i) - '0';
    suf = (suf + digit * power_of_ten) % MOD;
    power_of_ten = 10 * power_of_ten % MOD;
    answer += cnt_suf[suf];
    cnt_suf[suf]++;
  }
  System.out.println(answer);
}

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args){
              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: C++

#include <bits/stdc++.h>
//For ordered_set
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define MOD 1000000007
#define test int t; cin>>t; while(t--)
#define init(arr,val) memset(arr,val,sizeof(arr))
#define loop(i,a,b) for(int i=a;i<b;i++)
#define loopr(i,a,b) for(int i=a;i>=b;i--)
#define loops(i,a,b,step) for(int i=a;i<b;i+=step)
#define looprs(i,a,b,step) for(int i=a;i>=b;i-=step)
#define ull unsigned long long int
#define ll long long int
#define P pair
#define PLL pair<long long, long long>
#define PII pair<int, int>
#define PUU pair<unsigned long long int, unsigned long long int>
#define L list
#define V vector
#define D deque
#define ST set
#define MS multiset
#define M map
#define UM unordered_map
#define mp make_pair
#define pb push_back
#define pf push_front
#define MM multimap
#define F first
#define S second
#define IT iterator
#define RIT reverse_iterator
#define FAST ios_base::sync_with_stdio(false);cin.tie();cout.tie();
#define FILE_READ_IN freopen("input.txt","r",stdin);
#define FILE_READ_OUT freopen("output.txt","w",stdout);
#define all(a) a.begin(),a.end()
using namespace std;
// For ordered_set
using namespace __gnu_pbds;
template <typename T>
using ord_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
const ll maxn = 1e5;
const ll inf = 1e9;
const double pi = acos(-1);

void solve()
{
    string s; cin >> s;
    string temp = "";
    vector<pair<int,int>> index;
    int f = 1;

    for(int i = 0;i<s.size(),i++)
    {
        temp += s[i];
        if (stoi(temp) % 2019 == 0)
        {
            temp = s[i];
            index.pb(mp(f,i+1));
            f = i+1;
        }
    }

    cout << index.size() << "\n";

}

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

Compiler output:
a.cc: In function 'void solve()':
a.cc:53:33: error: expected ';' before ')' token
   53 |     for(int i = 0;i<s.size(),i++)
      |                                 ^
      |                                 ;
Language: C++

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

int main() {
  int n, 2019;
  cin >> n ;
  string s;
  cin >> s;

  vector<int> d(n+1);
  int ten = 1;
  for (int i = n-1; i >= 0; --i) {
    int a = (s[i]-'0') * ten % 2019;
    d[i] = (d[i+1]+a) % 2019;
    ten *= 10; ten %= 2019;
  }
  vector<int> cnt(2019);
  ll ans = 0;
  for (int i = n; i >= 0; --i) {
    ans += cnt[d[i]];
    cnt[d[i]]++;
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: expected unqualified-id before numeric constant
    8 |   int n, 2019;
      |          ^~~~
Language: C++

//#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<set>
#include<vector>
#include<list>
#include<queue>
#include<cmath>
#include<cstring>
#include<sstream>
#include<cstdio>
#include<ctime>
#include<map>
#include<bitset>
#include<stack>
#include<string>
#include<complex>
using namespace std;
//#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
// char buf[1<<21],*p1=buf,*p2=buf;
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ll long long
#define pb push_back
#define ull unsigned ll
#define rg register
#define bug puts("bug");
const long long INF=0x3f3f3f3f3f3f3f3fLL;
const int inf = 0x3f3f3f3f;
const int maxn = 1e5+10;
const int mod = 1e9+7;
const double eps = 1e-6;
const double pi=acos(-1);
int di[8][2]={{-1,0},{1,0},{0,-1},{0,1},{-1,-1},{-1,1},{1,-1},{1,1}};
inline ll rd()
{
    ll x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=(x<<3)+(x<<1)+(ch^48);ch=getchar();}
    return x*f;
}
int cnt[maxn];
char s[maxn*2];
int main()
{
	scanf("%s",s+1);
	strrev(s+1);
	ll ans=0;
	int now=0;
	int m=1;
	for(int i=1;s[i];i++)
	{
		m=m*10%2019; 
		now=(now+(s[i]-'0')*m)%2019;
		cnt[now]++;
	}
	for(int i=0;i<=2018;i++)
	{
		ans+=1ll*cnt[i]*(cnt[i]-1)/2;
	}
	cout<<ans+cnt[0];
}


Compiler output:
a.cc: In function 'int main()':
a.cc:47:9: error: 'strrev' was not declared in this scope; did you mean 'strsep'?
   47 |         strrev(s+1);
      |         ^~~~~~
      |         strsep
Language: C

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

typedef long long ll;

int bin_pow(int b, int e) {
    if(e == 0) return 1;

    int p = bin_pow(b, e / 2);
    p *= p;
    p %= 2019;

    if(e & 1) return p * b % 2019;
    else return p;
}

int main() {
	ios_base::sync_with_stdio(false);

    string s;
    cin >> s;

    int n = s.size();
    vector<int> suf(n + 1), cnt(2020);
    cnt[0]++;

    int ans = 0, e = 0;

    for(int i = n - 1; i >= 0; i--) {
        suf[i] = (((s[i] - '0') * bin_pow(10, e++)) % 2019 + suf[i + 1]) % 2019;

        for(int j = 0; j <= 2018; j++) {
            if((suf[i] - j + 2019) % 2019 == 0) {
                ans += cnt[j];
            }
        }

        cnt[suf[i]]++;
    }

    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>

using namespace std;

int main()
{
  string s;
  cin>>s;
  
  int count=0,i=0;
  
  while(i < n-3)
  {
    for(int j=i+3;j<n;j++)
    {
      int f=stoi(s.substr(i,j-i+1));
      
      if(f%2019 == 0)
      {
        count++;
        i=j-1;
        break;
      }
    }
    i++;
  }
  
  cout<<count;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: 'n' was not declared in this scope
   13 |   while(i < n-3)
      |             ^
Language: C++

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

int main (){
    int S;
    cin >> S;
    int x = S;
    x =x/10;
    int y = 0;
    if(x== 0){
        y=1
        x = x/10;

    }
    else if(x== 0){
        y=2
        x = x/10;

    }
    else if(x== 0){
        y=3
        x = x/10;

    }
    else if(x== 0){
        y=4
        x = x/10;

    }
    else if(x== 0){
        y=5
        x = x/10;

    }
    else if(x== 0){
        y=6
    }
    int ans =0;
    if(y <=3){

    }

    if(y == 4){
        if(S%2019 == 0){
            ans++;
        }
    }

    if(y == 5){
        if(S%2019 == 0){
            ans++;
        }
        if((S/10)%2019 == 0){
            ans++;
        }
        int p = (S/10000)*10000
        if((S-p)%2019 == 0){
            ans++;
        }
    }

    if(y == 6){
        if(S%2019 == 0){
            ans++;
        }
        if((S/10)%2019 == 0){
            ans++;
        }
        if((S/100)%2019 == 0){
            ans++;
        }
        int p = (S/10000)*10000
        if((S-p)%2019 == 0){
            ans++;
        }
        int p = (S/100000)*100000
        if((S-p)%2019 == 0){
            ans++;
        }
        int q = S - p;
        int w = S%10;
        int e = q-w;
        if(e%2019 == 0){
            ans++;
        }

    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: expected ';' before 'x'
   11 |         y=1
      |            ^
      |            ;
   12 |         x = x/10;
      |         ~   
a.cc:16:12: error: expected ';' before 'x'
   16 |         y=2
      |            ^
      |            ;
   17 |         x = x/10;
      |         ~   
a.cc:21:12: error: expected ';' before 'x'
   21 |         y=3
      |            ^
      |            ;
   22 |         x = x/10;
      |         ~   
a.cc:26:12: error: expected ';' before 'x'
   26 |         y=4
      |            ^
      |            ;
   27 |         x = x/10;
      |         ~   
a.cc:31:12: error: expected ';' before 'x'
   31 |         y=5
      |            ^
      |            ;
   32 |         x = x/10;
      |         ~   
a.cc:36:12: error: expected ';' before '}' token
   36 |         y=6
      |            ^
      |            ;
   37 |     }
      |     ~       
a.cc:57:9: error: expected ',' or ';' before 'if'
   57 |         if((S-p)%2019 == 0){
      |         ^~
a.cc:73:9: error: expected ',' or ';' before 'if'
   73 |         if((S-p)%2019 == 0){
      |         ^~
a.cc:76:13: error: redeclaration of 'int p'
   76 |         int p = (S/100000)*100000
      |             ^
a.cc:72:13: note: 'int p' previously declared here
   72 |         int p = (S/10000)*10000
      |             ^
Language: C

#include <iostream>
#include <vector>

using namespace std;

int main() {

	long long rez = 0;
	vector<int> freq(2019);	
	string s;
	cin >> s;
	freq[0] = 1;
	int md = 0, p = 1;
	for (int i = (int)s.size() - 1; i >= 0; i--) {
		md = (md + p * (s[i] - '0'))	% 2019;
		rez += freq[md];
		freq[md]++;
		p = p * 10 % 2019;
	}
	cout << rez << "\n";
}


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;
typedef long long ll;

string S;
ll np[2020];

int main()
{
    ios_base::sync_with_stdio(0);

    cin >> S;

    int p10 = 1;
    int vv = 0;
    np[0]++;
    for (int i = N - 1; i >= 0; i--)
    {
        vv = (vv + p10 * (S[i] - '0')) % 2019;
        p10 = (10 * p10) % 2019;
        np[vv]++;
    }

    ll res =0 ;
    for (int i = 0; i < 2019; i++)
        res += (np[i] * (np[i-1])) / 2;
    cout << res << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:18: error: 'N' was not declared in this scope
   18 |     for (int i = N - 1; i >= 0; i--)
      |                  ^
Language: C++

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

#define ll long long
#define ld long double

using namespace std;
const long long LINF = LLONG_MAX;
const int INF = INT_MAX;
const int MOD = 1000000007;

const int N = 2e5 + 111;

int dp[N][2019];

int main() {
    ios::sync_with_stdio(false);
    string s;
    vector<string> a;
    cin >> s;
    int n = s.size();
    dp[0][s[0] - '0']++;
    for (int i = 1; i < n; i++){
        for (int j = 0; j < 2019; j++){
            int nxt = (10 * j + (s[i] - '0')) % 2019;
            dp[i][(10 * j + (s[i] - '0')) % 2019] = dp[i-1][j];
        }
        dp[i][(s[i] - '0') % 2019]++;
    }
    ll ans = 0;
    for (int i = 0; i < n; i++)
        ans += dp[i][0];
    cout << ans;
}


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

#include<bits/stdc++.h>
using namespace std;
#define ll long long
string s;
ll ans,cnt[2200],num,t=1;
int main()
{
   cin>>s;
   cnt[0]=1
   for(int i=s.size()-1;i>=0;i--)
   {
   	   num=(num+(s[i]-'0')*t)%2019;
   	   ans+=cnt[num];
   	   cnt[num]++;
   	   t=t*10%2019;
   }
    
   cout<<ans;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: expected ';' before 'for'
    9 |    cnt[0]=1
      |            ^
      |            ;
   10 |    for(int i=s.size()-1;i>=0;i--)
      |    ~~~      
a.cc:10:25: error: 'i' was not declared in this scope
   10 |    for(int i=s.size()-1;i>=0;i--)
      |                         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
string s;
ll ans,cnt[2200],num;
int main()
{
	cin>>s;
	for(int i=s.size()-1;i>=0;i--)
	{
		num=(num+(s[i]-'0')*t)%2019;
		cnt[num]++;
		t=t*10%2019;
	}
	for(int i=1;i<2019;i++)
	{
		if(cnt[i]>1)	ans+=(cnt[i]-1)*cnt[i]/2;		
	}
	ans+=cnt[0]*(cnt[0]+1)/2;
	cout<<ans;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:37: error: 't' was not declared in this scope
   11 |                 num=(num+(s[i]-'0')*t)%2019;
      |                                     ^
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>;

const int m = 2019;

int main() {
    string s;
    cin >> s;
    int n = s.size();
    reverse(s.begin(), s.end());
    int x = 1, tot = 0;
    vector<int> cnt(m);
    ll ans = 0;
    rep(i,n){
        cnt[tot]++;
        tot += (s[i]-'0')*x;
        tot %= m;
        ans += cnt[tot];
        x = x*10%m;
    }
    cout << ans << endl;
    return

Compiler output:
a.cc: In function 'int main()':
a.cc:25:11: error: expected primary-expression at end of input
   25 |     return
      |           ^
a.cc:25:11: error: expected ';' at end of input
   25 |     return
      |           ^
      |           ;
a.cc:25:11: error: expected '}' at end of input
a.cc:9:12: note: to match this '{'
    9 | int main() {
      |            ^
Language: C++

#include<string>
#include<iostream>
#include<map>

using namespace std;

long long multiple_of_2019(string s) {
  map<int, int> m;
  long long t = 0;
  long long n = s.size();
  m[0]=1;
  long long ten = 1;
  for(int i=n-1;i>=0;i--) {
    long long acc = 0;
    if(i != n-1)
      ten *=10;
    acc = ten;
    acc %= 2019;
    long long a = s[i] - '0';    
    acc *= a;
    acc = acc % 2019;
    t += acc;
    t = t % 2019;
    m[t] = m[t] + 1;
    //cout << i << " -> a " << a << " t -> " << t << endl;
  }
  long long ans = 0;
  for(auto i = m.begin();i != m.end();i++) {
    long long v = i->second;
    if(v == 0)
      continue;
    ans += (v * (v-1))/2;
  }
  return ans;
}
/*
int main() {
  string s;
  cin >> s;
  cout << multiple_of_2019(s); 
}
*/


Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status