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

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
using namespace std;
typedef long long int ll;
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}



int main() {
    string s;
    ss = s.size();
    ll MOD = 1000000007;
    ll z[ss];
    ll o[ss];
    z[0] = 1;
    o[0] = 2;

    srep(i,1,ss){
        if(s[i]=='0'){
            z[i] = (z[i-1]*3) % MOD;
            o[i] = o[i-1];
        }else{
            z[i] = (z[i-1]*3 + o[i-1]) % MOD;
            o[i] = (o[i-1] * 2) % MOD;
        }
    }

    cout << (z[ss-1]+o[ss-1])%MOD << endl;

    return 0;
}
 
 


Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'ss' was not declared in this scope; did you mean 's'?
   15 |     ss = s.size();
      |     ^~
      |     s
a.cc:19:5: error: 'z' was not declared in this scope
   19 |     z[0] = 1;
      |     ^
a.cc:20:5: error: 'o' was not declared in this scope
   20 |     o[0] = 2;
      |     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
string s;
const ll maxn=1e5+10;
const ll mod=1e9+7;
ll dp[maxn][2];
ll len;
dfs(ll pos,ll lead){
    if(pos==len)return 1;
    ll tmp=0;
    if(dp[pos][lead]!=-1)return dp[pos][lead];
    if(lead){
        if(s[pos]=='0'){
            tmp+=dfs(pos+1,1);
        }
        else {
            tmp+=dfs(pos+1,0);
            tmp+=2*dfs(pos+1,1);
        }
    }
    else{
        tmp+=3*dfs(pos+1,0);
    }
    dp[pos][lead]=tmp%mod;
    return tmp%mod;
}
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>s;
    memset(dp,-1,sizeof(dp));
    len=s.size();
    cout<<dfs(0,1)<<endl;
}


Compiler output:
a.cc:9:1: error: ISO C++ forbids declaration of 'dfs' with no type [-fpermissive]
    9 | dfs(ll pos,ll lead){
      | ^~~
Language: C++

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

string L;

const int vmax=100010;
int dp[vmax][2];


signed main(){
	cin>>L;
fill(dp[0],dp[vmax],0);
dp[0][1]=2,dp[0][0]=1;

int n=L.size();

	for(int j=1;j<n;j++){
		dp[j][0]=dp[j-1][0]*3%mod;
		if(L[j]=='1'){
			(dp[j][0]+=dp[j-1][1])%=mod;
			dp[j][1]=dp[j-1][1]*2%mod;
		}
		else{
			dp[j][1]=dp[j-1][1];
		}

	}
	int ret=(dp[n-1][0]+dp[n-1][1])%mod;
	cout<<ret<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:39: error: 'mod' was not declared in this scope; did you mean 'modf'?
   19 |                 dp[j][0]=dp[j-1][0]*3%mod;
      |                                       ^~~
      |                                       modf
a.cc:29:41: error: 'mod' was not declared in this scope; did you mean 'modf'?
   29 |         int ret=(dp[n-1][0]+dp[n-1][1])%mod;
      |                                         ^~~
      |                                         modf
Language: C++

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

string L;

const vmax=100010;
int dp[vmax][2];


signed main(){
	cin>>L;
fill(dp[0],dp[vmax],0);
dp[0][1]=2,dp[0][0]=1;

int n=L.size();

	for(int j=1;j<n;j++){
		dp[j][0]=dp[j-1][0]*3%mod;
		if(L[j]=='1'){
			(dp[j][0]+=dp[j-1][1])%=mod;
			dp[j][1]=dp[j-1][1]*2%mod;
		}
		else{
			dp[j][1]=dp[j-1][1];
		}

	}
	int ret=(dp[n-1][0]+dp[n-1][1])%mod;
	cout<<ret<<endl;
}


Compiler output:
a.cc:7:7: error: 'vmax' does not name a type
    7 | const vmax=100010;
      |       ^~~~
a.cc:8:8: error: 'vmax' was not declared in this scope; did you mean 'fmax'?
    8 | int dp[vmax][2];
      |        ^~~~
      |        fmax
a.cc: In function 'int main()':
a.cc:13:6: error: 'dp' was not declared in this scope; did you mean 'dup'?
   13 | fill(dp[0],dp[vmax],0);
      |      ^~
      |      dup
a.cc:13:15: error: 'vmax' was not declared in this scope; did you mean 'fmax'?
   13 | fill(dp[0],dp[vmax],0);
      |               ^~~~
      |               fmax
a.cc:19:39: error: 'mod' was not declared in this scope; did you mean 'modf'?
   19 |                 dp[j][0]=dp[j-1][0]*3%mod;
      |                                       ^~~
      |                                       modf
a.cc:29:41: error: 'mod' was not declared in this scope; did you mean 'modf'?
   29 |         int ret=(dp[n-1][0]+dp[n-1][1])%mod;
      |                                         ^~~
      |                                         modf
Language: C++


#include <stdio.h>
#include <algorithm>
#include <string>
#include <vector>

const int mod = 1000000007;
int expInt(int, int);
long long ex2[100001], ex3[100001];
int main() {
	char L[100001];
	scanf("%s", L);
	int fig;
	for (int i = 0; i < 100001; i++) {
		if (L[i] == 0) {
			fig = i;
			break;
		}
	}
	long long e2 = 1, e3 = 1;
	for (int i = 0; i < 100001; i++) {
		ex2[i] = e2;
		ex3[i] = e3;
		e2 = (e2 * 2) % mod;
		e3 = (e3 * 3) % mod;
	}
	int ones = 0;
	long long res = 0;
	for (int i = 0; i < fig; i++) {
		if (L[i] == '1') {
			res += (expInt(3, fig - i - 1)*expInt(2, ones)) % mod;
			res %= mod;
			ones++;
		}
	}
	res += expInt(2, ones);
	res %= mod;
	printf("%d", res);
}

long long expInt(int a, int s) {
	return a == 2 ? ex2[s] : ex3[s];
}





Compiler output:
a.cc:41:11: error: ambiguating new declaration of 'long long int expInt(int, int)'
   41 | long long expInt(int a, int s) {
      |           ^~~~~~
a.cc:8:5: note: old declaration 'int expInt(int, int)'
    8 | int expInt(int, int);
      |     ^~~~~~
Language: C++


#include <stdio.h>
#include <algorithm>
#include <string>
#include <vector>

const int mod = 1000000007;
int expInt(int, int);

int main() {
	char L[100001];
	scanf("%s", L);
	int fig;
	for (int i = 0; i < 100001; i++) {
		if (L[i] == 0) {
			fig = i;
			break;
		}
	}
	int ones = 0;
	int res = 0;
	for (int i = 0; i < fig; i++) {
		if (L[i] == '1') {
			res += (((long long)(expInt(3, fig - i - 1)))*expInt(2, ones)) % mod;
			res %= mod;
			ones++;
		}
	}
	res += expInt(2, ones);
	res %= mod;
	printf("%d", res);
	Sleep(100000);
}

int expInt(int a, int s) {
	int res = 1;
	for (int i = 0; i < s; i++) {
		res = (res*a) % mod;
	}
	return res;
}





Compiler output:
a.cc: In function 'int main()':
a.cc:32:9: error: 'Sleep' was not declared in this scope
   32 |         Sleep(100000);
      |         ^~~~~
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <vector>
#include <queue>
#include <iostream>
#include <set>
#include <map>
#include <string>
#include <algorithm>

using namespace std;

#define mod 1e9+7
#define ll long long int
#define epsilon 1e-7

ll ma(ll x, ll y){
    if(x>y)return x;
    return y;
}
char l[100003];
ll dp[100003][2];
int main(void){
    scanf("%s", &l);
    int n = 0;
    while(l[n] != '\0')n++;
    printf("%d, %s\n", n, l);
    dp[0][0] = 1;
    dp[0][1] = 0;
    for(int i = 0;i < n;i++){
        for(int j = 0;j < 2;j++){
            for(int d = 0;d <= (j?1:l[i]-'0');d++){
                if(!d){
                    dp[i+1][j || (d < l[i]-'0')] += dp[i][j];
                    dp[i+1][j || (d < l[i]-'0')] %= 1000000007;
                }else{
                    dp[i+1][j || (d < l[i]-'0')] += dp[i][j] * 2;
                    dp[i+1][j || (d < l[i]-'0')] %= 1000000007;
                }
            }
        }
        /*for(int i = 0;i <= n;i++){
        for(int j = 0;j < 2;j++){
            printf("dp[%d][%d] = %7lld ",i, j, dp[i][j]);
        }
        printf("\n");*/
    }
    }
    /*for(int i = 0;i <= n;i++){
        for(int j = 0;j < 2;j++){
            printf("dp[%d][%d] = %7lld ",i, j, dp[i][j]);
        }
        printf("\n");
    }*/
    printf("%lld\n", dp[n][0] + dp[n][1]);
    return 0;
}

Compiler output:
a.cc:57:11: error: expected constructor, destructor, or type conversion before '(' token
   57 |     printf("%lld\n", dp[n][0] + dp[n][1]);
      |           ^
a.cc:58:5: error: expected unqualified-id before 'return'
   58 |     return 0;
      |     ^~~~~~
a.cc:59:1: error: expected declaration before '}' token
   59 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr int MAX_N = int(1e5) + 5;

int main() {
    ll n, dp[MAX_N][2]{};  // dp[0][i]:a+b=L, dp[1][i] = a+b<L
    string L;
    cin >> L;
    n = L.size();
    dp[0][0] = 1;
    for(ll i=0; i<n; i++){
        dp[i+1][1] = dp[i][1]*3 % MOD; // i+1桁目は0+0,1+0,0+1の3パターン
        if(L[i]=='1'){
            dp[i+1][0] += dp[i][0]*2; // 0+1,1+0
            dp[i+1][1] += dp[i][0]; // 0+0
        }
        else{
            dp[i+1][0] += dp[i][0]; // 0+0
        }
        dp[i+1][0] %= MOD;
        dp[i+1][1] %= MOD;
    }
    cout << (dp[n][0] + dp[n][1])%MOD << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:35: error: 'MOD' was not declared in this scope
   13 |         dp[i+1][1] = dp[i][1]*3 % MOD; // i+1桁目は0+0,1+0,0+1の3パターン
      |                                   ^~~
a.cc:24:35: error: 'MOD' was not declared in this scope
   24 |     cout << (dp[n][0] + dp[n][1])%MOD << endl;
      |                                   ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define MOD (1000000007)
vector<vector<int>> dp(100005,vector<int>(2,0));
int main(){
  string s;
  cin>>s;
  dp[0][0]=1;
  for(int i=0;i<s.length();++i){
    if(s[i]=='0'){
      dp[i+1]=dp[i];
      (dp[i+1][1]+=dp[i][1]*2%MOD)%=MOD;
    }
    else{
      dp[i+1][1]=(dp[i][0]+dp[i][1])%MOD;
      (dp[i+1][0]+=2*dp[i][0]%MOD)%=MOD;
      (dp[i+1][1]+=2*dp[i][1]%MOD)%=MOD;
    }
  }
  cout<<(dp[n][0]+dp[n][1])%MOD;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:13: error: 'n' was not declared in this scope
   20 |   cout<<(dp[n][0]+dp[n][1])%MOD;
      |             ^
Language: C++

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

#define P (1000000000 + 7)

using namespace std;

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

        int n = str.size();
        long long * threes = new long[n];
        threes[0] = 1;
        for(int i=1;i<n;i++){
                threes[i] = (threes[i-1] * 3)%P;
        }

        long long ans = 0;
        long long rem = 1;
        for(int i=0;i<str.size();i++){
                char c = str[i];
                if(str[i] == '1'){
                        ans += rem * threes[n-1-i];
                        ans %= P;

                        rem *= 2;
                }
                else
                {
                }
        }

        //cout << ans << "," << rem << endl;
        cout << (ans + rem) % P << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:40: error: invalid conversion from 'long int*' to 'long long int*' [-fpermissive]
   14 |         long long * threes = new long[n];
      |                                        ^
      |                                        |
      |                                        long int*
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int bi = sc.nextInt();
      	int n = Integer.parseInt(bi, 2);
		System.out.println(2*n+1);
	}
}

Compiler output:
Main.java:6: error: incompatible types: int cannot be converted to String
      	int n = Integer.parseInt(bi, 2);
      	                         ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: C++

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

#define MOD 1000000007

long long mod_pow(long long x, long long n)
{
    long long ret = 1;
    while (n > 0)
    {
        if (n & 1)
        {
            ret *= x;
            ret %= MOD;
        }
        x *= x;
        x %= MOD;
        n >>= 1;
    }
    return ret;
}

long long f(string &l, vector<long long> &t)
{
    if (l.size() == 1)
    {
        if (l[0] == '0')
        {
            return 1;
        }
        else
        {
            return 3;
        }
    }

    if (l[0] == '0')
    {
        return f(l.substr(1, l.size() - 1), t);
    }
    else
    {
        long long ret = t[l.size() - 1];
        ret += 2 * f(l.substr(1, l.size() - 1), t);
        ret %= MOD;
        return ret;
    }
}

int main()
{
    string L;
    cin >> L;
    vector<long long> t(100005, 1);
    for (int i = 1; i < 100005; i++)
    {
        t[i] = t[i - 1] * 3;
        t[i] %= MOD;
    }
    cout << f(L, t) << endl;
}


Compiler output:
a.cc: In function 'long long int f(std::string&, std::vector<long long int>&)':
a.cc:39:26: error: cannot bind non-const lvalue reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} to an rvalue of type 'std::__cxx11::basic_string<char>'
   39 |         return f(l.substr(1, l.size() - 1), t);
      |                  ~~~~~~~~^~~~~~~~~~~~~~~~~
a.cc:23:21: note:   initializing argument 1 of 'long long int f(std::string&, std::vector<long long int>&)'
   23 | long long f(string &l, vector<long long> &t)
      |             ~~~~~~~~^
a.cc:44:30: error: cannot bind non-const lvalue reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} to an rvalue of type 'std::__cxx11::basic_string<char>'
   44 |         ret += 2 * f(l.substr(1, l.size() - 1), t);
      |                      ~~~~~~~~^~~~~~~~~~~~~~~~~
a.cc:23:21: note:   initializing argument 1 of 'long long int f(std::string&, std::vector<long long int>&)'
   23 | long long f(string &l, vector<long long> &t)
      |             ~~~~~~~~^
Language: C++

#include<bits/stdc++.h>
using namespace std;
const ll mod=1e9+7 ;

ll powmod(ll n,ll k){
    ll ret=1;
    while(k){
        if(k&1)ret=ret*n%mod;
        n=n*n%mod;
        k>>=1;
    }
    return ret;
}

int main(){
    string s;
    cin >> s;
    ll ans = 0;
    ll cnt = 0;
    int n = s.size();
    for(int i = 0; i < n; ++i){
        if(s[i] == '0')continue;
        ans += powmod(2,cnt) * powmod(3,n-i-1) % mod;
        ++cnt;
    }
    ans += powmod(2,cnt);
    cout << ans%mod << endl;
    return 0;
}


Compiler output:
a.cc:3:7: error: 'll' does not name a type
    3 | const ll mod=1e9+7 ;
      |       ^~
a.cc:5:1: error: 'll' does not name a type
    5 | ll powmod(ll n,ll k){
      | ^~
a.cc: In function 'int main()':
a.cc:18:5: error: 'll' was not declared in this scope
   18 |     ll ans = 0;
      |     ^~
a.cc:19:7: error: expected ';' before 'cnt'
   19 |     ll cnt = 0;
      |       ^~~~
      |       ;
a.cc:23:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |         ans += powmod(2,cnt) * powmod(3,n-i-1) % mod;
      |         ^~~
      |         abs
a.cc:23:25: error: 'cnt' was not declared in this scope; did you mean 'int'?
   23 |         ans += powmod(2,cnt) * powmod(3,n-i-1) % mod;
      |                         ^~~
      |                         int
a.cc:23:16: error: 'powmod' was not declared in this scope
   23 |         ans += powmod(2,cnt) * powmod(3,n-i-1) % mod;
      |                ^~~~~~
a.cc:23:50: error: 'mod' was not declared in this scope; did you mean 'modf'?
   23 |         ans += powmod(2,cnt) * powmod(3,n-i-1) % mod;
      |                                                  ^~~
      |                                                  modf
a.cc:26:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   26 |     ans += powmod(2,cnt);
      |     ^~~
      |     abs
a.cc:26:21: error: 'cnt' was not declared in this scope; did you mean 'int'?
   26 |     ans += powmod(2,cnt);
      |                     ^~~
      |                     int
a.cc:26:12: error: 'powmod' was not declared in this scope
   26 |     ans += powmod(2,cnt);
      |            ^~~~~~
a.cc:27:17: error: 'mod' was not declared in this scope; did you mean 'modf'?
   27 |     cout << ans%mod << endl;
      |                 ^~~
      |                 modf
Language: C++

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

using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;

int main(){
  string S;
  cin >> S;
  ll ans  = 0;
  for (int i=0; i<S.size(); i++){
    if (S[i] == '1'){
      ll tmp = pow((long long)3, S.size() - i - 1) % mod;
      ans = (ans + tmp + 2) % mod;
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:52: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'const ll' {aka 'const long long int'} to binary 'operator%'
   15 |       ll tmp = pow((long long)3, S.size() - i - 1) % mod;
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~
      |                   |                                  |
      |                   |                                  const ll {aka const long long int}
      |                   __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

#include <iostream>
#include <sstream>
#include <stdio.h>
#include <cstring>
#include<vector>
#include<climits>
#include<algorithm>
#include<bitset>
#include<cmath>
#include<functional>
#include <numeric>
#include <map>
#include <tuple>
#include <string>
#define FORi(N) for(int i=0;i<N;++i)
#define FORj(N) for(int j=0;j<N;++j)
#define FORk(N) for(int k=0;k<N;++k)
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
ll gcd(ll m,ll n){
  if(n==0)return abs(m);
  return(gcd(n,m%n));
}
void putYN(bool b){
  if(b){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
}
void swap(ll &a,ll &b){
  ll tmp=a;
  a=b;
  b=tmp;
}
int main(){
  string L;
  cin>>L;
  vector <ll> A(L.size(),-1);
  function<ll(ll,bool flag)> f =[&](ll i)->ll{
    if(i==L.size())return 1;
    if(flag==false&&A[i]!=-1)return A[i];
  	ll num=0;
    ll(flag==true&&L[i]=='0')~{
      num=f(i+1,false);
    }else{
      num=f(i+1,flag)*3%1000000007;
    }
    if(flag=false)A[i]=num;
    return num;
  };
  return 0;
}


Compiler output:
a.cc: In lambda function:
a.cc:44:8: error: 'flag' was not declared in this scope
   44 |     if(flag==false&&A[i]!=-1)return A[i];
      |        ^~~~
a.cc:46:8: error: 'flag' was not declared in this scope
   46 |     ll(flag==true&&L[i]=='0')~{
      |        ^~~~
a.cc:48:6: error: 'else' without a previous 'if'
   48 |     }else{
      |      ^~~~
a.cc: In function 'int main()':
a.cc:42:33: error: conversion from 'main()::<lambda(ll)>' to non-scalar type 'std::function<long long int(long long int, bool)>' requested
   42 |   function<ll(ll,bool flag)> f =[&](ll i)->ll{
      |                                 ^~~~~~~~~~~~~~
   43 |     if(i==L.size())return 1;
      |     ~~~~~~~~~~~~~~~~~~~~~~~~     
   44 |     if(flag==false&&A[i]!=-1)return A[i];
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   45 |         ll num=0;
      |         ~~~~~~~~~                
   46 |     ll(flag==true&&L[i]=='0')~{
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~  
   47 |       num=f(i+1,false);
      |       ~~~~~~~~~~~~~~~~~          
   48 |     }else{
      |     ~~~~~~                       
   49 |       num=f(i+1,flag)*3%1000000007;
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   50 |     }
      |     ~                            
   51 |     if(flag=false)A[i]=num;
      |     ~~~~~~~~~~~~~~~~~~~~~~~      
   52 |     return num;
      |     ~~~~~~~~~~~                  
   53 |   };
      |   ~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <array>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <sstream>
#include <stdio.h>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <list>
#include <numeric>
#include <stack>

using namespace std;

#define Rep(i,a,b) for(int i = a; i < b; i++)
#define rep(i,b) Rep(i,0,b)
#define rrep(i,a) for(int i = a; i >= 0; i--)
#define allof(a) (a).begin(), (a).end()

typedef long long ll;
const int inf = 1e9 + 7;
const ll infll = 1ll << 60ll;
const ll mod = 1e9 + 7;
// 0~3までは右左下上 4~7までは斜め
constexpr int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
constexpr int dy[] = { 0, -1, 0, 1, 1, -1, -1, 1 };

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

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

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

	string l;
	cin >> l;

	reverse(allof(l));

	ll ans = 0;
	vector<ll> num((int)l.size(), 0);
	num[0] = 1;
	Rep(i, 1, (int)l.size()) {
		num[i] = 3 * num[i - 1];
		num[i] %= mod;
	}
	while (1) {
		ll res = 1;

		/*Rep(i, 1, (int)l.size()) {
			sum = 2 * res; // 1 or 0
			sum %= mod;
			res += sum;
			res %= mod;
		}*/

		res = num[(int)l.size() - 1];

		// 最大ビットだけ別でやる

		// 全部1なら終了
		bool allone = true;
		rep(i, (int)l.size()) {
			if (l[i] == '0') {
				allone = false;
				break;
			}
		}
		if (allone) {
			res += 2 * res;
			res %= mod;
			ans += res;
			ans %= mod;
			break;
		}
		// まず、どこまでが1か
		int index = -1;
		for (int i = (int)l.size() - 2; i >= 0; i--) {
			if (l[i] == '1') {
				index = i;
				break;
			}
		}
		if (index == -1) {
			res -= num[(int)l.size() - 2]
			res *= 2;
			res %= mod;
			ans += res;
			ans %= mod;
			break;
		}

		l = l.substr(0, index + 1);

		ans += res;
		ans %= mod;
	}

	//ans += tmp;
	// 余りであることを忘れずに
	cout << ans % mod << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:100:54: error: expected ';' before 'res'
  100 |                         res -= num[(int)l.size() - 2]
      |                                                      ^
      |                                                      ;
  101 |                         res *= 2;
      |                         ~~~
Language: C++

#include <cstdio>
#include <iostream>
#include <queue>
#include <string>
#include <algorithm>
#include <vector>
#include <utility>

#define AAA 1000000007
using namespace std;

int main(){
    long long unsigned int l;
    cin>>l;
    long long unsigned int ret;
    ret=floor(2*l/3);
    cout<<ret%AAA<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'floor' was not declared in this scope
   16 |     ret=floor(2*l/3);
      |         ^~~~~
Language: C++

L = input()
L = L[::-1]
len_L = len(L)
ans = 1
count = 0
for i, c in enumerate(L):
    if c == "1":
        ans *= 2
        ans += 3 ** i
        ans %= (10**9 + 7)

print(ans)


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

#include<cstdio>
#include<algorithm>

using namespace std;

int a[100005];
long long int two[100005];
long long int three[100005];
long long int mod = 1000000007;

int main() {
  char s[100005];
  scanf("%s", s);

  int n = strlen(s);

  two[0] = 1;
  three[0] = 1;
  for (int i = 1; i <= n; i++) {
    two[i] = (two[i-1] * 2) % mod;
    three[i] = (three[i-1] * 3) % mod;
  }

  long long int ans = 0;
  int count = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '1') {
      ans = (ans + three[n-i-1] * two[count]) % mod;
      count++;
    }
  }
  ans = (ans + two[count]) % mod;

  printf("%lld\n", ans);
  return 0;
}


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

#include <cstdio>
#include <iostream>
#include <queue>
#include <string>
#include <algorithm>
#include <vector>
#include <utility>

#define AAA 1000000007
using namespace std;

int main(){
    long long unsigned int l;
    cin>>l;
    long long unsigned int ret;
    ret=floor(2*l/3)
    cout<<ret%AAA<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'floor' was not declared in this scope
   16 |     ret=floor(2*l/3)
      |         ^~~~~
Language: C++

#include<cstdio>
#include<algorithm>

using namespace std;

int a[100005];
long long int two[100005];
long long int three[100005];
long long int mod = 1000000007;

int main() {
  char s[100005];
  scanf("%s", s);

  int n = int(strlen(s));

  two[0] = 1;
  three[0] = 1;
  for (int i = 1; i <= n; i++) {
    two[i] = (two[i-1] * 2) % mod;
    three[i] = (three[i-1] * 3) % mod;
  }

  long long int ans = 0;
  int count = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '1') {
      ans = (ans + three[n-i-1] * two[count]) % mod;
      count++;
    }
  }
  ans = (ans + two[count]) % mod;
  
  printf("%lld\n", ans);
  return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e5+10,mod=1e9+7;
char s[N];
int a[N];
ll k;
ll f(ll k)
{
    if(k==0) return 0;
    if(k==1) return 1;
    if(k%2) return mp[k]=(2*f(k/2)+f(k/2+1))%mod;
    return mp[k]=3*f(k/2)%mod;
}
int main()
{
    scanf("%s",s+1);
    int len=strlen(s+1);
    for(int i=1;i<=len;i++)
    {
        if(s[i]=='1')
            k=(k*2+1)%mod;
        else k=k*2%mod;
    }
    k=(k+1)%mod;
    printf("%lld\n",f(k));
}


Compiler output:
a.cc: In function 'll f(ll)':
a.cc:12:20: error: 'mp' was not declared in this scope
   12 |     if(k%2) return mp[k]=(2*f(k/2)+f(k/2+1))%mod;
      |                    ^~
a.cc:13:12: error: 'mp' was not declared in this scope
   13 |     return mp[k]=3*f(k/2)%mod;
      |            ^~
Language: Java

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e5+10,mod=1e9+7;
char s[N];
int a[N];
ll k;
ll f(ll k)
{
    if(k==0) return 0;
    if(k==1) return 1;
    if(k%2) return (2*f(k/2)+f(k/2+1))%mod;
    return 3*f(k/2)%mod;
}
int main()
{
    scanf("%s",s+1);
    int len=strlen(s+1);
    for(int i=1;i<=len;i++)
    {
        if(s[i]=='1')
            k=(k*2+1)%mod;
        else k=k*2%mod;
    }
    k=(k+1)%mod;
    printf("%lld\n",f(k));
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include<bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include<bits/stdc++.h>
        ^
Main.java:3: error: class, interface, enum, or record expected
typedef long long ll;
^
Main.java:4: error: class, interface, enum, or record expected
const int N=1e5+10,mod=1e9+7;
^
Main.java:5: error: class, interface, enum, or record expected
char s[N];
^
Main.java:6: error: class, interface, enum, or record expected
int a[N];
^
Main.java:7: error: unnamed classes are a preview feature and are disabled by default.
ll k;
^
  (use --enable-preview to enable unnamed classes)
7 errors
Language: C++

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

//E

const long long mod=1000000007;
int fflag=-1,zflag=-1,s,i,l[100005];
char ll[100005];

long long pow(long long x, int y){
	if(y==0) return 1;
	else if(y%2==0) return pow((x*x)%mod,y/2);
	else return (pow(x,y-1)*x)%mod;
}

long long count(int ss[100005],int size){
	int j;
	if(size==fflag) return pow(3,size);
	else{
		if(size==1) return 1;
		long long ans,san;
		if(s[size-1]==1) ans=(2*count(ss,size-1))%mod;
		else ans=count(ss,size-1)%mod;
		san=pow(3,size-1);
		return (ans+san)%mod;
	}
}

int main() {
	// your code goes here
	cin >> ll;
	s=strlen(ll);
	for(i=0;i<s;i++){
		if(ll[s-i-1]=='1') l[i]=1;
		else l[i]=0;
	}
	for(i=0;i<s;i++){
		if(l[i]==0) fflag=i;
	}
	if(fflag==-1) fflag=s;
	cout << (count(l,s))%mod << endl;
	return 0;
}

Compiler output:
a.cc: In function 'long long int count(int*, int)':
a.cc:22:21: error: invalid types 'int[int]' for array subscript
   22 |                 if(s[size-1]==1) ans=(2*count(ss,size-1))%mod;
      |                     ^
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(long long i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;
long long po(long a, long b){
    if(b==0){
        return 1;
    }
    
    long long z = po(a,b/2);
    z = mod(z*z);
    if(b%2!=0){
        z = mod(a*z);
    }
    return z;
}

int main(){
  string l;
  cin>>l;
  long long n=l.size();
  long long ans=0;
  long long temp=0;
  REP(i,n){
    if(s[i]=='1'){
      ans += po(3,n-i-1)*po(2,temp);
      temp++;
    }else{
      continue;
    }
  }
  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:8: error: 's' was not declared in this scope
   34 |     if(s[i]=='1'){
      |        ^
Language: Java

public class Main {
	public static BigInteger two=new BigInteger("2"),one=new BigInteger("1"),zero=new BigInteger("0");
	public static long mod=(long) (1e9+7);
	public static long GetAns(BigInteger a)
	{
		if(a.equals(zero)) return 0;
		if(a.equals(one)) return 1;
		if(a.mod(new BigInteger("2")).equals(one))
		{
			return (2*GetAns(a.divide(two))+GetAns(a.divide(two).add(one)))%mod;
		}
		return 3*GetAns(a.divide(two))%mod;
	}
	public static void main(String[] args)
	{
		Scanner sc=new Scanner(System.in);
	    String s=sc.next();
	    BigInteger a=new BigInteger("0");
	    for(int i=0;i<s.length();i++)
	    {
	    	a=a.multiply(two);
	    	if(s.charAt(i)=='1')
	    		a=a.add(one);
	    }
	    a=a.add(new BigInteger("1"));
	    System.out.println(GetAns(a));
	}
}


Compiler output:
Main.java:2: error: cannot find symbol
	public static BigInteger two=new BigInteger("2"),one=new BigInteger("1"),zero=new BigInteger("0");
	              ^
  symbol:   class BigInteger
  location: class Main
Main.java:4: error: cannot find symbol
	public static long GetAns(BigInteger a)
	                          ^
  symbol:   class BigInteger
  location: class Main
Main.java:2: error: cannot find symbol
	public static BigInteger two=new BigInteger("2"),one=new BigInteger("1"),zero=new BigInteger("0");
	                                 ^
  symbol:   class BigInteger
  location: class Main
Main.java:2: error: cannot find symbol
	public static BigInteger two=new BigInteger("2"),one=new BigInteger("1"),zero=new BigInteger("0");
	                                                         ^
  symbol:   class BigInteger
  location: class Main
Main.java:2: error: cannot find symbol
	public static BigInteger two=new BigInteger("2"),one=new BigInteger("1"),zero=new BigInteger("0");
	                                                                                  ^
  symbol:   class BigInteger
  location: class Main
Main.java:8: error: cannot find symbol
		if(a.mod(new BigInteger("2")).equals(one))
		             ^
  symbol:   class BigInteger
  location: class Main
Main.java:16: error: cannot find symbol
		Scanner sc=new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:16: error: cannot find symbol
		Scanner sc=new Scanner(System.in);
		               ^
  symbol:   class Scanner
  location: class Main
Main.java:18: error: cannot find symbol
	    BigInteger a=new BigInteger("0");
	    ^
  symbol:   class BigInteger
  location: class Main
Main.java:18: error: cannot find symbol
	    BigInteger a=new BigInteger("0");
	                     ^
  symbol:   class BigInteger
  location: class Main
Main.java:25: error: cannot find symbol
	    a=a.add(new BigInteger("1"));
	                ^
  symbol:   class BigInteger
  location: class Main
11 errors
Language: C

import Data.List

main = getLine>>=print.solve

solve l = go 0 l
  where
  len = length l
  go _ [] = 1
  go i ('0':l) = go (i+1) l
  go i ('1':l) = 2 *% go (i+1) l +% pow3!!(len-i-1)

mo = 1000000007
infixl 6 *%
infixl 5 +%
a +% b = (a + b) `mod` mo
a *% b = (a * b) `mod` mo
pow3 = 1 : iterate (*%3) 3

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import Data.List
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import Data.List
      |            ^
main.c:15:18: error: stray '`' in program
   15 | a +% b = (a + b) `mod` mo
      |                  ^
main.c:15:22: error: stray '`' in program
   15 | a +% b = (a + b) `mod` mo
      |                      ^
main.c:16:18: error: stray '`' in program
   16 | a *% b = (a * b) `mod` mo
      |                  ^
main.c:16:22: error: stray '`' in program
   16 | a *% b = (a * b) `mod` mo
      |                      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ALL(obj) obj.begin(),obj.end()
#define pb(obj) push_back(obj)
#define REP(i,N) for(ll i=0;i<N;i++)
typedef long long ll;
const ll MOD=1000000007;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll pow3[100002];
    pow3[0]=1;
    for(ll i=1;i<=100001;i++){
        pow3[i]=(pow3[i-1]*3)%MOD;
    }
    ll pow2[100002];
    pow2[0]=1;
    for(ll i=1;i<=100001;i++){
        pow2[i]=(pow2[i-1]*2)%MOD;
    }
    string L;
    cin>>L;
    vector<ll>numof1(L.size());
    ll sum=0;
    numof1[0]=0;
    for(ll i=1;i<L.size();i++
        if(L[i-1]=='1')sum++;
        numof1[i]=sum;
    }
    ll N=L.size();
    ll sub=0;
    ll A;
    bool zero=false;
    for(ll i=N-1;i>=0;i--){
        if(L[i]=='1'){
            A=pow2[numof1[i]];
            A*=pow3[N-i-1];
            A%=MOD;
            sub+=A;
            sub%=MOD;
        }
    }
    if(L[N-1]=='1'){
        sub+=pow2[numof1[N-1]+1];
    }
    if(L[N-1]=='0'){
        sub+=pow2[numof1[N-1]];
    }
    cout<<sub<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:30: error: expected ')' before 'if'
   26 |     for(ll i=1;i<L.size();i++
      |        ~                     ^
      |                              )
   27 |         if(L[i-1]=='1')sum++;
      |         ~~                    
a.cc:28:16: error: 'i' was not declared in this scope
   28 |         numof1[i]=sum;
      |                ^
a.cc: At global scope:
a.cc:30:10: error: 'L' was not declared in this scope
   30 |     ll N=L.size();
      |          ^
a.cc:34:5: error: expected unqualified-id before 'for'
   34 |     for(ll i=N-1;i>=0;i--){
      |     ^~~
a.cc:34:18: error: 'i' does not name a type
   34 |     for(ll i=N-1;i>=0;i--){
      |                  ^
a.cc:34:23: error: 'i' does not name a type
   34 |     for(ll i=N-1;i>=0;i--){
      |                       ^
a.cc:43:5: error: expected unqualified-id before 'if'
   43 |     if(L[N-1]=='1'){
      |     ^~
a.cc:46:5: error: expected unqualified-id before 'if'
   46 |     if(L[N-1]=='0'){
      |     ^~
a.cc:49:5: error: 'cout' does not name a type
   49 |     cout<<sub<<endl;
      |     ^~~~
a.cc:50:1: error: expected declaration before '}' token
   50 | }
      | ^
Language: C++

#include<stdio.h>

int pow3=3,ans=1,cnt;
char l[100001];

int main(){
  scanf("%s",l);
  for(int i=0;i<strlen(l)-1;i++)if(l[i]=='1')cnt++;
  for(int i=1;i<strlen(l)-1;i++){
    if(i==cnt)ans=(ans+pow3)%1000000007;
    ans=(ans+pow3)%1000000007,pow3=pow3*3%100000000007;
  }
  printf("%d",ans);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: 'strlen' was not declared in this scope
    8 |   for(int i=0;i<strlen(l)-1;i++)if(l[i]=='1')cnt++;
      |                 ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<stdio.h>
  +++ |+#include <cstring>
    2 | 
a.cc:9:17: error: 'strlen' was not declared in this scope
    9 |   for(int i=1;i<strlen(l)-1;i++){
      |                 ^~~~~~
a.cc:9:17: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <bits/stdc++.h>
using namespace std;
long long MOD;
unsigned long long modpow(unsigned long long b){
  unsigned long long ans = 1;
  long long a = 10;
  while (b > 0){
    if (b % 2 == 1){
      ans *= a;
      ans %= MOD;
    }
    a *= a;
    a %= MOD;
    b /= 2;
  }
  return ans;
}
unsigned long long gp(int i, unsigned long long N){
  //1+10^i+10^2i+...+10^(N-1)i
  if (N == 1){
    return 1;
  } else {
    if (N % 2 == 0){
      unsigned long long ans = gp(i, N / 2);
      ans *= modpow(N / 2 * i) + 1;
      ans %= MOD;
      return ans;
    } else {
      unsigned long long ans = gp(i, N - 1);
      for (int j = 0; j < i; j++){
        ans *= 10;
        ans %= MOD;
      }
      ans++;
      ans %= MOD;
      return ans;
    }
  }
}
unsigned long long apgp(int i, unsigned long long N){
  //N+(N-1)*10^i+(N-2)*10^2i+...+1*10^(N-1)i
  if (N == 1){
    return 1;
  } else {
    if (N % 2 == 0){
      unsigned long long ans = apgp(i, N / 2);
      ans *= modpow(N / 2 * i) + 1;
      ans %= MOD;
      ans += gp(i, N / 2) * (N / 2 % MOD) % MOD;
      ans %= MOD;
      return ans;
    } else {
      unsigned long long ans = apgp(i, N - 1);
      for (int j = 0; j < i; j++){
        ans *= 10;
        ans %= MOD;
      }
      ans += N;
      ans %= MOD;
      return ans;
    }
  }
}
long long apgp2(unsigned long long lb, unsigned long long ub, unsigned long long B, int i){
  unsigned long long len = (ub - lb) / B + 1;
  unsigned long long ans = 0;
  if (lb > B){
    ans += gp(i, len) % MOMD * ((lb - B) % MOD) % MOD;
  } else {
    ans -= gp(i, len) % MOD * ((B - lb) % MOD) % MOD;
    ans += MOD;
  }
  ans %= MOD;
  ans += (B % MOD) * apgp(i, len) % MOD;
  ans %= MOD;
  return ans;
}
int main(){
  unsigned long long L, A, B, M;
  cin >> L >> A >> B >> M;
  MOD = M;
  unsigned long long C = A + B * (L - 1);
  long long r = A % B;
  long long ans = 0;
  unsigned long long digit_cnt = 0;
  for (int i = 18; i >= 1; i--){
    unsigned long long lb = 1;
    for (int j = 0; j < i - 1; j++){
      lb *= 10;
    }
    unsigned long long ub = lb * 10;
    lb = (lb - r + B - 1) / B * B + r;
    ub = (ub - r - 1) / B * B + r;
    if (lb <= C && A <= ub && lb <= ub){
      lb = max(lb, A);
      ub = min(ub, C);
      assert(ub % B == lb % B && lb % B == A % B);
      ans += apgp2(lb, ub, B, i) * modpow(digit_cnt) % MOD;
      digit_cnt += i * ((ub - lb) / B + 1);
    }
  }
  ans %= MOD;
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'long long int apgp2(long long unsigned int, long long unsigned int, long long unsigned int, int)':
a.cc:68:25: error: 'MOMD' was not declared in this scope; did you mean 'MOD'?
   68 |     ans += gp(i, len) % MOMD * ((lb - B) % MOD) % MOD;
      |                         ^~~~
      |                         MOD
Language: C++

#include <stdio.h>  
#include <algorithm>  
#include <assert.h>
#include <bitset>
#include <cmath>  
#include <complex>  
#include <deque>  
#include <functional>  
#include <iostream>  
#include <limits.h>  
#include <map>  
#include <math.h>  
#include <queue>  
#include <deque>
#include <set>  
#include <stdlib.h>  
#include <string.h>  
#include <string>  
#include <time.h>  
#include <unordered_map>  
#include <unordered_set>  
#include <vector>  
#include <chrono>
#include <random>
#include <time.h>
#include <fstream>
#define ll long long
#define rep2(i,a,b) for(ll i=a;i<=b;++i)
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep3(i,a,b) for(ll i=a;i>=b;i--)
#define pii pair<int,int>
#define pll pair<ll,ll>
//#define pq priority_queue<int>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define vec vector<int>
#define vecll vector<ll>
#define vecpii vector<pii>
#define endl "\n"
#define all(c) begin(c),end(c)
using namespace std;
int in() {int x;scanf("%d",&x);return x;}
ll lin() {ll x;scanf("%lld",&x);return x;}
void print(vec v){for(auto e:v)cout<<e<<" ";cout<<endl;}
void print(vecll v){for(auto e:v)cout<<e<<" ";cout<<endl;}
void print(map<int,int> mp){for(auto e:mp)cout<<e.first<<" "<<e.second<<endl;cout<<endl;}


const ll MOD=1e9+7;
const int N=500000;
ll modpow(ll x,ll n,ll mod){
    ll ret=1;
    while(n){
        if(n&1) ret=ret*x%mod;
        x=x*x%mod; n>>=1;
    }
    return ret;
}
ll sum(ll a,ll r,ll n,ll mod){
    if(n==0)return 0;
    if(n==1) return a%mod;
    ll x=sum(a,r,n/2,mod);
    ll ret=(x+modpow(r,n/2,mod)*x%mod)%mod;
    if(n&1) ret=(a+r*ret%mod)%mod;
    return ret;
}
ll sum2(ll a,ll r,ll n,ll mod){
    if(n==0)return 0;
    if(n==1) return 0;
    if(n&1){
        return (sum2(a,r,n-1,mod)+sum(a,r,n-1,mod))%mod;
    }
    ll x=sum2(a,r,n/2,mod);
    // cout<<r<<" "<<n<<" "<<x<<endl;
    x=(x*(modpow(r,n/2,mod)+1ll)%mod+(n/2ll)*sum(a,r,n/2,mod)%mod)%mod;
    // cout<<r<<" "<<n<<" "<<x<<endl;
    return x;
}

main(){
    ll l,a,b;
    cin>>l>>a>>b;
    ll m=lin();
    ll res=0,keta=1;
    ll ans=0;
    ll now=10;
    while(now<=(ll)1e18){
        ll next=(now-1-a)/b;
        if(next>l-1)next=l-1;
        if(next*b>=now-a){
            keta++;now*=10;
            continue;
        }
        ll cnt=next-res+1;
        ll A=(a%m+res*(b%m)%m)%m,B=b%;
        ll s=keta,t=cnt;
        ll T=modpow(10,s,m);
        ans=ans*modpow(T,t,m)%m;
        ans=(ans+A*sum(1,T,t,m)%m)%m;
        // cout<<ans<<" ";
        ans=(ans+B*sum2(1,T,t,m)%m)%m;
        // cout<<ans<<endl;
        keta++;
        if(now==1e18)break;
        now*=10;
        res=next+1;
    }
    cout<<ans;
}

Compiler output:
a.cc:80:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   80 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:95:38: error: expected primary-expression before ';' token
   95 |         ll A=(a%m+res*(b%m)%m)%m,B=b%;
      |                                      ^
Language: C++

#include <stdio.h>  
#include <algorithm>  
#include <assert.h>
#include <bitset>
#include <cmath>  
#include <complex>  
#include <deque>  
#include <functional>  
#include <iostream>  
#include <limits.h>  
#include <map>  
#include <math.h>  
#include <queue>  
#include <deque>
#include <set>  
#include <stdlib.h>  
#include <string.h>  
#include <string>  
#include <time.h>  
#include <unordered_map>  
#include <unordered_set>  
#include <vector>  
#include <chrono>
#include <random>
#include <time.h>
#include <fstream>
#define ll long long
#define rep2(i,a,b) for(ll i=a;i<=b;++i)
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep3(i,a,b) for(ll i=a;i>=b;i--)
#define pii pair<int,int>
#define pll pair<ll,ll>
//#define pq priority_queue<int>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define vec vector<int>
#define vecll vector<ll>
#define vecpii vector<pii>
#define endl "\n"
#define all(c) begin(c),end(c)
using namespace std;
int in() {int x;scanf("%d",&x);return x;}
ll lin() {ll x;scanf("%lld",&x);return x;}
void print(vec v){for(auto e:v)cout<<e<<" ";cout<<endl;}
void print(vecll v){for(auto e:v)cout<<e<<" ";cout<<endl;}
void print(map<int,int> mp){for(auto e:mp)cout<<e.first<<" "<<e.second<<endl;cout<<endl;}


const ll MOD=1e9+7;
const int N=500000;
ll modpow(ll x,ll n,ll mod){
    ll ret=1;
    while(n){
        if(n&1) ret=ret*x%mod;
        x=x*x%mod; n>>=1;
    }
    return ret;
}
ll sum(ll a,ll r,ll n,ll mod){
    if(n==0)return 0;
    if(n==1) return a%mod;
    ll x=sum(a,r,n/2,mod);
    ll ret=(x+modpow(r,n/2,mod)*x%mod)%mod;
    if(n&1) ret=(a+r*ret%mod)%mod;
    return ret;
}
ll sum2(ll a,ll r,ll n,ll mod){
    if(n==0)return 0;
    if(n==1) return 0;
    if(n&1){
        return (sum2(a,r,n-1,mod)+sum(a,r,n-1,mod))%mod;
    }
    ll x=sum2(a,r,n/2,mod);
    // cout<<r<<" "<<n<<" "<<x<<endl;
    x=(x*(modpow(r,n/2,mod)+1ll)%mod+(n/2ll)*sum(a,r,n/2,mod)%mod)%mod;
    // cout<<r<<" "<<n<<" "<<x<<endl;
    return x;
}

main(){
    ll l,a,b;
    cin>>l>>a>>b;
    ll m=lin();
    ll res=0,keta=1;
    ll ans=0;
    ll now=10;
    while(now<=(ll)1e18){
        ll next=(now-1-a)/b;
        if(next>l-1)next=l-1;
        if(next*b>=now-a){
            keta++;now*=10;
            continue;
        }
        ll cnt=next-res+1;
        ll A=(a%m+res*(b%m)%m)%,B=b%;
        ll s=keta,t=cnt;
        ll T=modpow(10,s,m);
        ans=ans*modpow(T,t,m)%m;
        ans=(ans+A*sum(1,T,t,m)%m)%m;
        // cout<<ans<<" ";
        ans=(ans+B*sum2(1,T,t,m)%m)%m;
        // cout<<ans<<endl;
        keta++;
        if(now==1e18)break;
        now*=10;
        res=next+1;
    }
    cout<<ans;
}

Compiler output:
a.cc:80:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   80 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:95:32: error: expected primary-expression before ',' token
   95 |         ll A=(a%m+res*(b%m)%m)%,B=b%;
      |                                ^
a.cc:101:18: error: 'B' was not declared in this scope
  101 |         ans=(ans+B*sum2(1,T,t,m)%m)%m;
      |                  ^
Language: C++

#include <stdio.h>  
#include <algorithm>  
#include <assert.h>
#include <bitset>
#include <cmath>  
#include <complex>  
#include <deque>  
#include <functional>  
#include <iostream>  
#include <limits.h>  
#include <map>  
#include <math.h>  
#include <queue>  
#include <deque>
#include <set>  
#include <stdlib.h>  
#include <string.h>  
#include <string>  
#include <time.h>  
#include <unordered_map>  
#include <unordered_set>  
#include <vector>  
#include <chrono>
#include <random>
#include <time.h>
#include <fstream>
#define ll long long
#define rep2(i,a,b) for(ll i=a;i<=b;++i)
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep3(i,a,b) for(ll i=a;i>=b;i--)
#define pii pair<int,int>
#define pll pair<ll,ll>
//#define pq priority_queue<int>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define vec vector<int>
#define vecll vector<ll>
#define vecpii vector<pii>
#define endl "\n"
#define all(c) begin(c),end(c)
using namespace std;
int in() {int x;scanf("%d",&x);return x;}
ll lin() {ll x;scanf("%lld",&x);return x;}
void print(vec v){for(auto e:v)cout<<e<<" ";cout<<endl;}
void print(vecll v){for(auto e:v)cout<<e<<" ";cout<<endl;}
void print(map<int,int> mp){for(auto e:mp)cout<<e.first<<" "<<e.second<<endl;cout<<endl;}


const ll MOD=1e9+7;
const int N=500000;
ll modpow(ll x,ll n,ll mod){
    ll ret=1;
    while(n){
        if(n&1) ret=ret*x%mod;
        x=x*x%mod; n>>=1;
    }
    return ret;
}
ll sum(ll a,ll r,ll n,ll mod){
    if(n==0)return 0;
    if(n==1) return a%mod;
    ll x=sum(a,r,n/2,mod);
    ll ret=(x+modpow(r,n/2,mod)*x%mod)%mod;
    if(n&1) ret=(a+r*ret%mod)%mod;
    return ret;
}
ll sum2(ll a,ll r,ll n,ll mod){
    if(n==0)return 0;
    if(n==1) return 0;
    if(n&1){
        return (sum2(a,r,n-1,mod)+sum(a,r,n-1,mod))%mod;
    }
    ll x=sum2(a,r,n/2,mod);
    // cout<<r<<" "<<n<<" "<<x<<endl;
    x=(x*(modpow(r,n/2,mod)+1ll)%mod+(n/2ll)*sum(a,r,n/2,mod)%mod)%mod;
    // cout<<r<<" "<<n<<" "<<x<<endl;
    return x;
}

main(){
    ll l,a,b;
    cin>>l>>a>>b;
    ll m=lin();
    ll res=0,keta=1;
    ll ans=0;
    ll now=10;
    while(now<=(ll)1e18){
        ll next=(now-1-a)/b;
        if(next>l-1)next=l-1;
        if(next*b>=now-a){
            keta++;now*=10;
            continue;
        }
        ll cnt=next-res+1;
        ll A=(a%m+res*(b%m)%m)%,B=b%,;
        ll s=keta,t=cnt;
        ll T=modpow(10,s,m);
        ans=ans*modpow(T,t,m)%m;
        ans=(ans+A*sum(1,T,t,m)%m)%m;
        // cout<<ans<<" ";
        ans=(ans+B*sum2(1,T,t,m)%m)%m;
        // cout<<ans<<endl;
        keta++;
        if(now==1e18)break;
        now*=10;
        res=next+1;
    }
    cout<<ans;
}

Compiler output:
a.cc:80:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   80 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:95:32: error: expected primary-expression before ',' token
   95 |         ll A=(a%m+res*(b%m)%m)%,B=b%,;
      |                                ^
a.cc:101:18: error: 'B' was not declared in this scope
  101 |         ans=(ans+B*sum2(1,T,t,m)%m)%m;
      |                  ^