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

#include<bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1000000000
#define mod 1000000007
typedef long long ll;
const ll LINF = 1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main(){
    string s,t;
    cin>>s>>t;
    string scopy=s;
    sort(ALL(scopy));
    scopy.erase(unique(ALL(scopy)),scopy.end());
    bool ss[26]={};
    for(int i=0;i<scopy.size();i++){
        int num=scopy[i]-'a';
        ss[num]=true;
    }
    for(int i=0;i<t.size();i++){
        int num=t[i]-'a';
        if(!ss[num]){
            cout<<-1<<endl;return 0;
        }
    }



    vector<vector<ll>> v(26);
    for(int i=0;i<s.size();i++){
        ll num=s[i]-'a';
        v[num].push_back(i);
    }
    ll ind=0ll;ll ans=0ll,ssize=(ll)s.size(),tsize=(ll)t.size();
    for(ll i=0ll;i<tsize;i++){
        ll num=t[i]-'a';
        ll *x=lower_bound(ALL(v[num]),ind);
        if(ite==v[num].end()){
            ans+=(ll)(v[num][0]+ssize-ind);
            ind=(ll)v[num][0];
        }
        else{
            ans+=(ll)(x-ind);
            ind=x;
        }
    }
    cout<<ans+1<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:26: error: cannot convert '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >' to 'll*' {aka 'long long int*'} in initialization
   43 |         ll *x=lower_bound(ALL(v[num]),ind);
      |               ~~~~~~~~~~~^~~~~~~~~~~~~~~~~
      |                          |
      |                          __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >
a.cc:44:12: error: 'ite' was not declared in this scope
   44 |         if(ite==v[num].end()){
      |            ^~~
a.cc:50:17: error: invalid conversion from 'll*' {aka 'long long int*'} to 'll' {aka 'long long int'} [-fpermissive]
   50 |             ind=x;
      |                 ^
      |                 |
      |                 ll* {aka long long int*}
Language: C++

#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
using namespace std;
long long  mod = 1000000007;
char s[100010], t[100010];
char tmp[100010];
int main()
{
	int count[2][26] = { 0 };
	cin >> s >> t;
	int p = 0, L = 0;
	while (s[p] != '\0') {
		count[0][s[p] - 'a']++;
		p++;
		L++;
	}
	p = 0;
	while (t[p] != '\0') {
		count[1][t[p] - 'a']++;
		p++;
	}
	for (int i = 0; i < 26; i++) {
		if (count[0][i] == 0 && count[1][i] != 0) {
			cout << "-1";
			return 0;
		}
	}
	long long co = 0;
	int k = 0;
	int l = 0;
	while (strcmp(tmp, t) != 0) {
		if (k == L) k = 0;
		if (t[l] == s[k]) {
			tmp[l] = s[k];
			l++;
		}
		co++;
		k++;
	}
	cout << co;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:16: error: 'strcmp' was not declared in this scope
   33 |         while (strcmp(tmp, t) != 0) {
      |                ^~~~~~
a.cc:5:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<cmath>
  +++ |+#include <cstring>
    5 | using namespace std;
Language: C++

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

int gcd(int a,int b){
    int t;
    while(b>0){
        t=b;
        b=a%b;
        a=t;
    }
    return a;
}

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

int main(){
    int c=0,d=0,e=0,k=0,l,m,n,o=0,p,q,r,x,y,z,max1=0,ans=0,n1,n2;
    string s,t,u;
    
    priority_queue<ll> pque;
    
    cin>>s>>t;
    n1=s.size();
    n2=t.size();
    int a[26][100000]={},b[26]={};
    for(int i=0;i<n1;i++){
        a[s[i]-'a'][b[s[i]-'a']]=i+1;
        b[s[i]-'a']++;
    }
    
    for(int i=0;i<n2;i++){
        if(a[t[i]-'a'][0]==0){
            k=1;
            break;
        }
        o=0;
        d=0;
        while(1){
            if(a[t[i]-'a'][o]==0){
                d=1;
                break;
            }
            if(a[t[i]-'a'][o]>c){
                ans+=a[t[i]-'a'][o]-c;
                c=a[t[i]-'a'][o];
                break;
            }
            o++;
            
        }
        if(d==1)ans+=n1-c;
        
        if(d==1){
            if(a[t[i]-'a'][0]!=0){
                ans+=a[t[i]-'a'][0];
                c=a[t[i]-'a'][0];
            }
            else d=2;
            
        }
        if(d==2)break;
      
    }
    if(d==2)cout<<-1<<endl;
    else if(k==1)cout<<-1<<endl
    else cout<<ans<<endl;
}







Compiler output:
a.cc: In function 'int main()':
a.cc:68:32: error: expected ';' before 'else'
   68 |     else if(k==1)cout<<-1<<endl
      |                                ^
      |                                ;
   69 |     else cout<<ans<<endl;
      |     ~~~~
Language: C++

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

int gcd(int a,int b){
    int t;
    while(b>0){
        t=b;
        b=a%b;
        a=t;
    }
    return a;
}

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

int main(){
    int c=0,d=0,e=0,k=0,l,m,n,o=0,p,q,r,x,y,z,max1=0,ans=0,n1,n2;
    string s,t,u;
    
    priority_queue<ll> pque;
    
    cin>>s>>t;
    n1=s.size();
    n2=t.size();
    int a[26][100000]={},b[26]={};
    for(int i=0;i<n1;i++){
        a[s[i]-'a'][b[s[i]-'a']]=i+1;
        b[s[i]-'a']++;
    }
    
    for(int i=0;i<n2;i++){
        if(a[t[i]-'a'][0]==0){
            K=1;
            break;
        }
        o=0;
        d=0;
        while(1){
            if(a[t[i]-'a'][o]==0){
                d=1;
                break;
            }
            if(a[t[i]-'a'][o]>c){
                ans+=a[t[i]-'a'][o]-c;
                c=a[t[i]-'a'][o];
                break;
            }
            o++;
            
        }
        if(d==1)ans+=n1-c;
        
        if(d==1){
            if(a[t[i]-'a'][0]!=0){
                ans+=a[t[i]-'a'][0];
                c=a[t[i]-'a'][0];
            }
            else d=2;
            
        }
        if(d==2)break;
      
    }
    if(d==2)cout<<-1<<endl;
    else if(k==1)cout<<-1<<endl
    else cout<<ans<<endl;
}







Compiler output:
a.cc: In function 'int main()':
a.cc:36:13: error: 'K' was not declared in this scope
   36 |             K=1;
      |             ^
a.cc:68:32: error: expected ';' before 'else'
   68 |     else if(k==1)cout<<-1<<endl
      |                                ^
      |                                ;
   69 |     else cout<<ans<<endl;
      |     ~~~~
Language: Java

import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

class Main {

    static final int MOD = 1000000007;
    static ArrayList<Node> nodeList = new ArrayList<Node>();

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        String t = sc.nextLine();
        long ans = -1;
        int[] salp = new int[27];
        int[] talp = new int[27];
        char[] sr = s.toCharArray();
        char[] tr = t.toCharArray();

        for (int i = 0; i < sr.length; i++) {
            salp[sr[i] - 'a']++;
        }
        for (int i = 0; i < tr.length; i++) {
            talp[tr[i] - 'a']++;
            if (salp[tr[i] - 'a'] == 0) {
                System.out.println(ans);
                return;
            }
        }

        int pos = 0;
        char[] fr = new char[100001];
        int[] frp = new int[100001];
        for (int i = 0; i < sr.length; i++) {
            if (talp[sr[i] - 'a'] > 0) {
                fr[pos] = sr[i];
                frp[pos] = i;
                pos++;
            }
        }
        int flength = pos;
        pos = 0;
        long rep;
        for (rep = 0; true; rep++) {
            for (int i = 0; i < flength; i++) {
                if (fr[i] == tr[pos]) {
                    pos++;
                    if (pos == tr.length) {
                        System.out.println(rep * sr.length + frp[i]+1);
                        return;
                    }
                }
            }
        }
    }
}

Compiler output:
Main.java:10: error: cannot find symbol
    static ArrayList<Node> nodeList = new ArrayList<Node>();
                     ^
  symbol:   class Node
  location: class Main
Main.java:10: error: cannot find symbol
    static ArrayList<Node> nodeList = new ArrayList<Node>();
                                                    ^
  symbol:   class Node
  location: class Main
2 errors
Language: C++

#include<bits/stdc++.h>
#define ll long long
using namespace std;
string s,t;
ll f[100010][26],v[100010][26];
int main(){
    memset(f,-1,sizeof(f));
    cin>>s>>t;
    for(int i=0;i<26;i++){
        int j;
        for(j=0;j<s.size();j++){
            if(s[j]-'a'==i)break;
        }
        if(j!=s.size()){
            f[j][i]=j;
            int k=0;
            for(k=s.size()-1;k>0;k--){
                int a=(k+j)%s.size();
                if(s[a]-'a'==i)f[a][i]=a;
                else{f[a][i]=f[(a+1)%s.size()][i];v[a][i]=v[(a+1)%s.size()][i]+1;}
            }
        }
    }
    ll idx=0,ans=0;
    for(int i=0;i<t.size();i++){
        if(f[idx][t[i]-'a']==-1){
            ans=-1;
            break;
        }
        ans+=v[idx][t[i]-'a'];
        idx=f[idx][t[i]-'a'];
    }
    cout<<(ans==-1)?-1:ans+1<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:29: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
   33 |     cout<<(ans==-1)?-1:ans+1<<endl;
      |                        ~~~~~^~~~~~
Language: Java

import jdk.nashorn.api.tree.Tree;

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

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String t = sc.next();
		int mod = s.length();
		long ans = 0;
		TreeSet<Integer>[] index = new TreeSet[26];
		for (int i = 0; i < 26; i++) {
			index[i] = new TreeSet<>();
		}
		for (int i = 0; i < t.length(); i++) {
			TreeSet<Integer> tmp = index[t.charAt(i) - 'a'];
			if (tmp.size() == 0) {
				if (s.indexOf(t.charAt(i)) == -1) {
					ans = -1;
					break;
				} else {
					int in = 0;
					while (s.indexOf(t.charAt(i), in) != -1) {
						tmp.add(s.indexOf(t.charAt(i), in));
						in = s.indexOf(t.charAt(i), in) + 1;
					}
				}
			}
			int num;
			if (tmp.higher((int) ans % mod - 1) == null) {
				num = tmp.first();
			} else {
				num = tmp.higher((int) ans % mod - 1);
			}
			if (num + 1 <= ans % mod) {
				ans = mod * ((ans + mod - 1) / mod) + num + 1;
			} else {
				ans = mod * (ans / mod) + num + 1;
			}
		}
		System.out.println(ans);
	}
}


Compiler output:
Main.java:1: error: package jdk.nashorn.api.tree does not exist
import jdk.nashorn.api.tree.Tree;
                           ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: C++

#include <iostream>
#include <string>

using namespace std;

#define MAXL 100000

int first[26];
int nxt[MAXL + 1][26];

int main(){
  string s,t;

  cin >> s >> t;

  memset(first, -1, sizeof first);
  int Ls = s.size();

  for(int i = 0;i < Ls;++i){
    int x = s[i] - 'a';

    if(first[x] == -1)
      first[x] = i;
  }

  memset(nxt, -1, sizeof nxt);

  for(int i = Ls - 1;i >= 0;--i){
    for(int j = 0;j < 26;++j){
      nxt[i][j] = nxt[i + 1][j];
    }

    if(i + 1 < Ls){
      int x = s[i + 1] - 'a';
      nxt[i][x] = i + 1;
    }
  }

  long long ans = 0;
  int turns = 0;
  int pos = -1;
  int Lt = t.size();

  for(int i = 0;i < Lt;){
    int x = t[i] - 'a';

    if(pos == -1){
      ++turns; ++i;
      pos = first[x];

      if(pos == -1){
        ans = -1;
        break;
      }
    }else{
      pos = nxt[pos][x];
      if(pos != -1) ++i;
    }

    //cout << t[i] << " " << pos << endl;
    ans = (turns - 1) * Ls + pos + 1;
  }

  cout << ans << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: 'memset' was not declared in this scope
   16 |   memset(first, -1, sizeof first);
      |   ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

#include<bits/stdc++.h>
using namespace std ;
int main () {
  
  string s , t ;
  cin >> s >> t ;
  vector<int> a[26] ;
  for(int i=0 ; i < s.length() ;i++)
    a[s[i]-'a'].push_back(i) ;
  ll cnt =0 ;
  int  ptr = -1;
  bool flag = true ;
        
  for(int i = 0 ; i < t.length() ;i++){
    int c = t[i]-'a';
    if(a[c].size() == 0) {
      flag= false ;
      break ;
    }
    vector<int> :: iterator it = upper_bound(a[c].begin(),a[c].end(),ptr) ;
    if(it == a[c].end()) {
      ptr = -1 ;
      cnt++ ;
      ptr = *upper_bound(a[c].begin(),a[c].end(),ptr);
    }
    else 
      ptr = *it ;
  }
  if(flag == true)
  cout<<ll(cnt*s.length())+ptr + 1<<endl;
  else cout<<-1<<endl;
      
  return 0 ;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'll' was not declared in this scope
   10 |   ll cnt =0 ;
      |   ^~
a.cc:23:7: error: 'cnt' was not declared in this scope; did you mean 'int'?
   23 |       cnt++ ;
      |       ^~~
      |       int
a.cc:30:12: error: 'cnt' was not declared in this scope; did you mean 'int'?
   30 |   cout<<ll(cnt*s.length())+ptr + 1<<endl;
      |            ^~~
      |            int
Language: C++

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

int main() {
  string s,t;
  cin >> s >> t;
  int n,m,k;
  k=0;
  n = s.size();
  m = t.size();
  vector<int> a(m);
  for(int i=0;i<m;i++){
    for(int j=0;j<n;j++){
      if(t.at(i) == s.at(j)){
        a.at(i) = j
        k++;
        break;
      }
    }
  }
  if(k < m){
    cout << -1 << endl;
  }
  else {
    int count = 0;
    for(int i=0;i<m-1;i++){
      if(a.at(i) > a.at(i+1)){
        count++;
      }
    }
    cout << count*n + a.at(m-1) + 1 << endl;
  }
  
   return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:20: error: expected ';' before 'k'
   15 |         a.at(i) = j
      |                    ^
      |                    ;
   16 |         k++;
      |         ~
Language: C++

#include <bits/stdc++.h>

using namespace std;

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

	string s, t;
	cin >> s >> t;

	vector<long long> v[26];
	for(int i = 0; i < s.length(); i++) {
		v[s[i]-'a'].push_back(i+1);
	}
	long long cur = 0;
	for(auto i : t) {
		int id = (i - 'a');
		long long temp = 2e18;
		if(v[id].size() == 0) {
			cur = -1;
			break;
		}
		for(auto j : v[id]) {
			if(cur == 0) temp = min(temp, j);
			else {
				long long tm = (cur-j) / s.length() + 2ll;
				temp = min(temp, j + (tm-1ll)*s.length());
			}
		}
		cur = temp;
	//	cout << cur << ' ';
	}
	cout << cur;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:43: error: no matching function for call to 'min(long long int&, long long unsigned int)'
   28 |                                 temp = min(temp, j + (tm-1ll)*s.length());
      |                                        ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:28:43: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long long unsigned int')
   28 |                                 temp = min(temp, j + (tm-1ll)*s.length());
      |                                        ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:28:43: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   28 |                                 temp = min(temp, j + (tm-1ll)*s.length());
      |                                        ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

char buf[100100];
int nxt[30][100100];
string s, t;
string s2;
int n, m;

int main(){
	gets(buf); s = buf; n = s.size();
	s2 = s + s;
	gets(buf); t = buf; m = t.size();
	rep(num, 26){
		char now = num + 'a';
		bool has = 0, need = 0;
		rep(i, n) has |= (s[i] == now);
		rep(i, m) need |= (t[i] == now);
		if(need && !has){
			cout << "-1" << endl;
			return 0;
		}
		if(!has) continue;
		rep(i, n){
			if(s2[n + i] == now){
				nxt[num][i] = i;
				for(int j = n + i - 1; s2[j] != now; j--){
					nxt[num][j % n] = i;
				}
			}
		}
	}
	long long num = 0ll, ans = 0ll;
	int pos = -1;
	rep(i, m){
		int to = nxt[t[i] - 'a'][pos+1];
		if(to < pos) num++;
		pos = to;
		ans = to;
	}
	cout << n*num + ans+1 << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   12 |         gets(buf); s = buf; n = s.size();
      |         ^~~~
      |         getw
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>

int main(void) {
	std::string s, t;
	std::cin >> s >> t;
	int i = 0;
	int j = 0;
	int size = s.size();
	int sized = size * 100;
	int count = 0;
	for (; j < sized; j++) {
		if (t[i] == s[j % size]) {
			i++;
			if (i == t.size()) {
				int r = j + 1;
				std::cout << r << std::endl;
				return 0;
			}
			count = 0;
		}else count++;
		if (count == size) {
			std::cout << -1 << std::endl;
			return 0;
		}
	}
	std::cout << -1 << std::endl;
	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:31:18: error: expected '}' at end of input
   31 |         return 0;
      |                  ^
a.cc:7:16: note: to match this '{'
    7 | int main(void) {
      |                ^
Language: C++

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

string s, t;
vector<int> v[1000];
int ans = 0;
int n;

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

	cin >> s;
	cin >> t;

	n = s.size();

	for(int i=0; i<s.size(); i++) {
		v[s[i] - 'a'].push_back(i);
	}

	for(int i=0; i<t.size(); i++) {
		int c = t[i] - 'a';

		if(v[c].size() == 0) {
			cout << -1;
			return 0;
		}

		vector<int>::iterator it = lower_bound(v[c].begin(), v[c].end(), ans % n );
		if(it != v[c].end()) {
			ans = *it + ans / n * n;
		}
		else {
			it = upper_bound(v[c].begin(), v[c].end(), ans % n - n);
			ans = *it + ans / n * n + n;
		}
	}

	cout << ans+1;
}

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

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

string s, t;
vector<int> v[30];
int ans = 0;
int n;

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

	cin >> s;
	cin >> t;

	n = s.size();

	for(int i=0; i<s.size(); i++) {
		v[s[i] - 'a'].push_back(i);
	}

	for(int i=0; i<t.size(); i++) {
		int c = t[i] - 'a';

		if(v[c].size() == 0) {
			cout << -1;
			return 0;
		}

		vector<int>::iterator it = lower_bound(v[c].begin(), v[c].end(), ans % n );
		if(it != v[c].end()) {
			ans = *it + ans / n * n;
		}
		else {
			it = upper_bound(v[c].begin(), v[c].end(), ans % n - n);
			ans = *it + ans / n * n + n;
		}

		//cout << (char) (c + 'a') << " " << ans << " " << *it << endl;
	}

	cout << ans+1;
}

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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define LLINF 9223372036854775807
#define MOD ll(1e9+7)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cerr<<#x<<": "<<x<<endl



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

    vector<vector<ll>> pos(26);
    for(int i = 0; i < s.size(); i++){
        pos[(int)(s[i]-'a')].push_back(i+1);
    }


    ll num = 0;
    ll ans = 0;
    for(int i = 0; i < t.size(); i++){
        if(pos[(int)(t[i]-'a')].size()==0){
            cout << -1 << endl;
            return 0;
        }
        auto itr = lower_bound(all(pos[(int)(t[i]-'a')]),num);
        if(itr == pos[(int)(t[i]-'a')].end()){
            ans += (ll)(s.size();)
            num = pos[(int)(t[i]-'a')][0];
        }else{
            num = *itr;
        }
    }
    ans += (ll)(num);

    cout << ans << endl;
    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:33: error: expected ')' before ';' token
   32 |             ans += (ll)(s.size();)
      |                        ~        ^
      |                                 )
a.cc:32:34: error: expected primary-expression before ')' token
   32 |             ans += (ll)(s.size();)
      |                                  ^
Language: Java

import java.util.*;
import java.io.*;
public class E {

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		char[] s = br.readLine().toCharArray();
		long n = s.length;
		char[] t = br.readLine().toCharArray();
		TreeSet<Long>[] poss = new TreeSet[26];
		for(int c = 0; c < 26; c++){
			poss[c] = new TreeSet<>();
		}
		for(int i = 0; i < n; i++){
			poss[s[i]-'a'].add((long)i);
		}
		long res = -1;
		long count = 0;
		for(char c: t){
			if(poss[c-'a'].isEmpty()){
				System.out.println("-1"); return;
			}
			Long ind = poss[c-'a'].higher(res % n);
			if(ind == null){
				ind = poss[c-'a'].first();
				count++;
				res = count * n + ind;
			}
			else{
				res = count * n + ind;
			}
		}
		System.out.println(res+1);
	}

}


Compiler output:
Main.java:3: error: class E is public, should be declared in a file named E.java
public class E {
       ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <cstdint>
#include <numeric>
#include <bitset>

using namespace std;

using ll =  long long;
using Pll = pair<ll, ll>;
using Pii = pair<int, int>;

constexpr ll MOD = 1000000007;
constexpr long double EPS = 1e-10;
constexpr int dyx[4][2] = {
    { 0, 1}, {-1, 0}, {0,-1}, {1, 0}
};

int main() {
    std::ios::sync_with_stdio(false); cin.tie(0);
    string s,t;
    cin >> s >> t;
    int n = s.length(), m = t.length();

    vector<vector<int>> smap(26);
    for(int i=0;i<n;++i) {
        smap[int(s[i]-'a')].push_back(i);
    }

    ll ans = 0
    int idx = -1;
    for(int i=0;i<m;++i) {
        int c = t[i] - 'a';
        if(!smap[c].size()) {
            ans = -1;
            break;
        }
        auto itr = upper_bound(smap[c].begin(), smap[c].end(), idx);
        int j = -1;
        if(itr == smap[c].end()) {
            j = smap[c][0];
        } else {
            j = *itr;
        }

        if(idx > j) {
            ans += (n-1-idx) + (j+1);
        } else {
            ans += j-idx;
        }
        idx = j;
    }

    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:5: error: expected ',' or ';' before 'int'
   43 |     int idx = -1;
      |     ^~~
a.cc:50:64: error: 'idx' was not declared in this scope
   50 |         auto itr = upper_bound(smap[c].begin(), smap[c].end(), idx);
      |                                                                ^~~
Language: C++

#include<bits/stdc++.h>
#define ll long long
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;
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; }


using namespace std;

int mod = 1000000007;
struct mint {
    ll x; // typedef long long ll;
    mint(ll x=0):x((x%mod+mod)%mod){}
    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;
    }
};
// combination mod prime
// https://www.youtube.com/watch?v=8uowVvQ_-Mo&feature=youtu.be&t=1619
struct combination {
    vector<mint> fact, ifact;
    combination(int n):fact(n+1),ifact(n+1) {
        assert(n < mod);
        fact[0] = 1;
        for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
        ifact[n] = fact[n].inv();
        for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
    }
    mint operator()(int n, int k) {
        if (k < 0 || k > n) return 0;
        return fact[n]*ifact[k]*ifact[n-k];
    }
};

mint dp[61][2][2][2];
int main(){
    ll l, r;
    cin >> l >> r;

    dp[60][0][0][0] = 1;

    for (int i = 59; i >= 0; i--) {
        int lb = l >> i&1;
        int rb = r >> i&1;
        rep(j, 2) rep(k, 2) rep(s, 2) {
            mint pre = dp[i+1][j][k][s];
            rep(x, 2) rep(y, 2) {
                if (x && !y) continue;
                int nj = j, nk = k, ns = s;
                if (!s && x != y) continue;
                if (x && y) ns = 1;
                if (!j && !x && lb) continue;
                if (x && !b) nj = 1;
                if (!k && y && !rb) continue;
                if (!y && rb) nk = 1;
                dp[i][nj][nk][ns] += pre;
            }
        }
    }

    mint ans;
    rep(j, 2) rep(k, 2) rep(s,2) ans += dp[0][j][k][s];
    cout << ans.x << endl;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:97:27: error: 'b' was not declared in this scope
   97 |                 if (x && !b) nj = 1;
      |                           ^
Language: C++

#include <bits/stdc++.h>
#include "../lib/math/comb.hpp"

using namespace std;

#define SZ(x) (int)(x.size())

using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;

template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}
ll l, r;
ll dp[2][2][2][62];

ll f(int d, int msb, int lt, int rt) {
  if(d == -1) return msb == 1;
  if(dp[msb][lt][rt][d] >= 0) return dp[msb][lt][rt][d];

  ll ret = 0;

  for(int a=0;a<2;++a) {
    for(int b=0;b<2;++b) {
      if(a == 0 && lt && (l & (1ll<<d)) > 0) continue;
      if(b == 1 && rt && (r & (1ll<<d)) == 0) continue;
      if(a>b) continue;
      if(msb == 0 && a != b) continue;
      int nlt = lt && (((l>>d)&1)==a);
      int nrt = rt && (((r>>d)&1)==b);
      int nmsb = msb || (a == 1 && b == 1);
      ret += f(d-1, nmsb, nlt, nrt);
    }
  }

  return dp[msb][lt][rt][d] = ret % MOD;
  
}

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

  cin >> l >> r;
  
  for(int i=0;i<2;++i) {
    for(int j=0;j<2;++j) {
      for(int k=0;k<2;++k) {
        for(int l=0;l<62;++l) {
          dp[i][j][k][l] = -1;
        }
      }
    }
  }
  cout << f(61, 0, 1, 1) << endl;

}


Compiler output:
a.cc:2:10: fatal error: ../lib/math/comb.hpp: No such file or directory
    2 | #include "../lib/math/comb.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define all(V) V.begin(),V.end()
#define ll long long
#define MOD 1000000007

vector<ll> d2(63, 1), d3(63, 1);

ll f(ll N) {
	if (N == 0)return 0;
	if (N == 1)return 1;

	auto it = upper_bound(all(d2), N);it--;
	ll ans = d3[it - d2.begin()] + 2 * f(N - *it);ans %= MOD;
	return ans;
}

int main() {
	ll L, R;
	cin >> L >> R;L--;
	if (R == 1) { cout << 1 << endlreturn 0; }
	for (int i = 1;i < 63;i++) {
		d2[i] = d2[i - 1] * 2;
		d3[i] = d3[i - 1] * 3;d3[i] %= MOD;
	}

	auto it1 = upper_bound(all(d2), L);
	auto it2 = lower_bound(all(d2), R);it2--;

	ll al = *it1 - L - 1;
	ll ar = R - *it2 + 1;

	//cout << al << " " << ar << endl;

	ll xl = -f(al);
	ll xr = f(ar);

	for (int i = 0;i < (it1 - d2.begin());i++) {
		xl += d3[i];xl %= MOD;
	}

	for (int i = 0;i < (it2 - d2.begin());i++) {
		xr += d3[i];xl %= MOD;
	}

	//cout << xl << " " << xr << endl;

	cout << (xr - xl % MOD + MOD) % MOD << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:36: error: 'endlreturn' was not declared in this scope
   21 |         if (R == 1) { cout << 1 << endlreturn 0; }
      |                                    ^~~~~~~~~~
Language: C++

#include <bitset>
#include <iostream>
using namespace std;
using lint = long long;
const int MOD = 1000000007;

int getCountOfPair(bitset<64> l, bitset<64> r) {
    bool flag = false, diff = false, both = false;
    int i = 63;
    lint count[3] = {1, 0, 1};
    do {
        flag |= l[i];
        diff |= l[i] != r[i];
    } while (!r[i--]);
    for (; i >= 0; i--) {
        count[1] = (count[1] * 3 + (count[0] * !l[i] + count[2] * r[i]) * diff) % MOD;
        count[0] = ((count[0] << (!l[i] * flag * diff)) + both * r[i]) % MOD;
        count[2] = ((count[2] << (r[i] * diff)) + both * !l[i]) % MOD;
        flag |= l[i];
        bool check = diff;
        diff |= l[i] != r[i];
        check ^= diff;
        both = (both * !l[i] * r[i]) | check;
    }
    return int((count[0] + count[1] + count[2] + both) % MOD);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int answer;
    lint l, r
    cin >> l >> r;
    answer = getCountOfPair(l, r);
    cout << answer;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:5: error: expected initializer before 'cin'
   34 |     cin >> l >> r;
      |     ^~~
a.cc:35:32: error: 'r' was not declared in this scope
   35 |     answer = getCountOfPair(l, r);
      |                                ^
Language: C++

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

long long L,R;
//sub_f 1
string Xor_C(int x,int y){
  if (x<2 and y<2){
    if (x == y){
      return "0";
    }
    else{
      return "1";
    }
  }
  
  int x_d,y_d,x_r,y_r;
  x_d = x/2, y_d = y/2;
  x_r = x%2, y_r = y%2;
  
  if (x_r == y_r){
    return Xor_C(x_d,y_d).append("0");
  }
  else{
    return Xor_C(x_d,y_d).append("1");
  }
}
//sub_f2
int Convert(string s){
  int l = s.length();
  int calc=0,i=0,is;
  char arr[l+1];
  //convert str to char
  strcpy(arr,s.c_str());
  
  for (int n = l-1; n >= 0; n--){
    int is = arr[i] -'0';
    calc += pow(2,n)*(is);
    i += 1;
  }
  return calc;
}

int main(){
  int count = 0,xo;
  //start
  cin >> L >> R;
  for (long long x=L;x<=R;x++){
    for (long long y=L;y<=R;y++){
        x=x%(pow(10,9)+7),y=y%(pow(10,9)+7);
	    xo = Convert(Xor_C(x,y));
   	  if(y%x == xo){
        count += 1;
        }
    }
  }
  cout << count;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:12: error: invalid operands of types 'long long int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
   49 |         x=x%(pow(10,9)+7),y=y%(pow(10,9)+7);
      |           ~^~~~~~~~~~~~~~
      |           |           |
      |           |           __gnu_cxx::__promote<double>::__type {aka double}
      |           long long int
a.cc:49:30: error: invalid operands of types 'long long int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
   49 |         x=x%(pow(10,9)+7),y=y%(pow(10,9)+7);
      |                             ~^~~~~~~~~~~~~~
      |                             |           |
      |                             |           __gnu_cxx::__promote<double>::__type {aka double}
      |                             long long int
Language: C

#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define all(a) a.begin(), a.end()

typedef long long lint;

const lint mod = 1e9 + 7;

lint memo[61][2][2][2];

lint L, R;

lint solve(int pos, bool left, bool right, bool msb) {
    // printf("%d %d %d %d\n", pos, left, right, msb);
    if (pos == -1)
        return 1;
    lint &ret = memo[pos][left][right][msb];
    if (ret != -1)
        return ret;
    ret = 0LL;
    bool lb = (L & (1LL << pos)) ? false : true;
    bool rb = (R & (1LL << pos)) ? true : false;
    // x0, y0
    if (left || lb)
        ret += 1LL * solve(pos - 1, left, rb ? 1 : right, msb);
    // x0, y1
    if ((left || lb) && (right || rb) && msb)
        ret += 1LL * solve(pos - 1, left, right, msb);
    // x1, y1
    if (right || rb)
        ret += 1LL * solve(pos - 1, lb ? 1 : left, right, 1);
    ret %= mod;
    return ret;
}

int main() {
    scanf("%lld%lld", &L, &R);
    memset(memo, -1, sizeof(memo));
    printf("%lld\n", solve(60, 0, 0, 0));
}


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

import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        long L = Long.parseLong(sc.next());
        long R = Long.parseLong(sc.next());
        long count = 0L;

		for(long x = L; x <= R; x++){
            String xBinaryString = Long.toBinaryString(x).length()
            for(long y = x; xBinaryString == Long.toBinaryString(y).length() && y <= R; y++){
                if(y % x == (y ^ x)){
                    count++;
                }
            }
        }

        System.out.println((int) (count % (Math.pow(10, 9) + 7)));

	}
}

Compiler output:
Main.java:11: error: ';' expected
            String xBinaryString = Long.toBinaryString(x).length()
                                                                  ^
1 error
Language: C++

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

// def
#define debug(x) cout << #x << ": " << x << endl
#define out(x) cout << x << endl
#define repeat(i, a, b) for (int i = (a); i < (b); i++)
#define revrepeat(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define revrep(i, n) for (int i = (n)-1; i >= 0; i--)
typedef long long ll;
typedef pair<ll, ll> P;
const int M = 1e9 + 7;
const int INF = 1e9;
const int MAX_V = 100 + 5;
const int MAX_N = 1e5 + 5;

int main(void) {
  ll L, R;
  cin >> L >> R;
  
  int MSB_L, MSB_R = 0;

  ll l = L;
  ll r = R;
  ll ans = 0;
  rep(x, L, 1+R) {
    rep(y, x, 1+R) {
       if(y % x == y ^ x) {
         ans++; 
       }
    }
  }
  
  cout << ans;
  
  
  return 0; 
}


Compiler output:
a.cc:27:16: error: macro "rep" passed 3 arguments, but takes just 2
   27 |   rep(x, L, 1+R) {
      |                ^
a.cc:9:9: note: macro "rep" defined here
    9 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |         ^~~
a.cc:28:18: error: macro "rep" passed 3 arguments, but takes just 2
   28 |     rep(y, x, 1+R) {
      |                  ^
a.cc:9:9: note: macro "rep" defined here
    9 | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
      |         ^~~
a.cc: In function 'int main()':
a.cc:27:3: error: 'rep' was not declared in this scope
   27 |   rep(x, L, 1+R) {
      |   ^~~
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int 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;
bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd_(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}
 
class UnionFind {
    public:
    //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
    vector<int> Parent;
    
    //クラスを作るときは、Parentの値を全て-1にする。
    //以下のようにすると全てバラバラの頂点として解釈できる。
    UnionFind(int N) {
        Parent = vector<int>(N, -1);
    }
    
    //Aがどのグループに属しているか調べる
    int root(int A) {
        if (Parent[A] < 0) return A;
        return Parent[A] = root(Parent[A]);
    }
    
    //自分のいるグループの頂点数を調べる
    int size(int A) {
        return -Parent[root(A)];//先祖をrootで取っておきたい。
    }
    
    //AとBをくっ付ける
    bool connect(int A, int B) {
        //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
        A = root(A);
        B = root(B);
        if (A == B) {
            //すでにくっついてるからくっ付けない
            return false;
        }
        
        //大きい方(A)に小さいほう(B)をくっ付けたい
        //大小が逆だったらAとBをひっくり返す。
        if (size(A) < size(B)) swap(A, B);
        
        //Aのサイズを更新する
        Parent[A] += Parent[B];
        //Bの親をAに変更する
        Parent[B] = A;
        
        return true;
    }
};

int len_(long long n){
  int res=0;
  while(n>0){
    n = n>>1;
    res++;
  }
  return res;
}
    
int main(){
  
  long long l,r;
  cin>>l>>r;
  int lenl,lenr;
  lenl=len(l);
  lenr=len(r);
  
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:103:8: error: 'len' was not declared in this scope; did you mean 'lenr'?
  103 |   lenl=len(l);
      |        ^~~
      |        lenr
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
ll A[2000],B[2000],mod=1e9+7;
ll ans(ll n){
    ll j,p=n,C[200001];
    for(j=0;p>0;j++) C[j]=p%2,p=p/2;
    ll d=0;
    reverse(C,C+j);
    int e=1;
    rep(i,j) if(C[i]==1){
      if(i==j) d+=e/2%mod;
      else d=(d+e*B[j-i-2])%mod,e=e*2;
    return d;
}
int main(){
    A[0]=1,B[0]=1;
    rep(i,1000) A[i+1]=A[i]*3%mod;
    rep(i,1000) B[i+1]=(B[i]+A[i+1])%mod;
    ll L,R;
    cin>>L>>R;
    cout<<ans(R)-ans(L-1);
}

Compiler output:
a.cc: In function 'll ans(ll)':
a.cc:17:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   17 | int main(){
      |         ^~
a.cc:17:9: note: remove parentheses to default-initialize a variable
   17 | int main(){
      |         ^~
      |         --
a.cc:17:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:17:11: error: a function-definition is not allowed here before '{' token
   17 | int main(){
      |           ^
a.cc:24:2: error: expected '}' at end of input
   24 | }
      |  ^
a.cc:6:13: note: to match this '{'
    6 | ll ans(ll n){
      |             ^
a.cc:24:2: warning: control reaches end of non-void function [-Wreturn-type]
   24 | }
      |  ^
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

ll func(ll x, bool flag)
{
    if (x==0) return 1;
    if (flag) return pow(3, (int)log2((double)x)1) ;


    int keta = (int)log2((double)x);
    return func(x - pow(2, keta))+ func(pow(2, keta)-1);
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll l,r;
    cin >> l >> r;
    cout << func(l) - func(r) << endl;
}


Compiler output:
a.cc: In function 'll func(ll, bool)':
a.cc:28:49: error: expected ')' before numeric constant
   28 |     if (flag) return pow(3, (int)log2((double)x)1) ;
      |                         ~                       ^
      |                                                 )
a.cc:32:16: error: too few arguments to function 'll func(ll, bool)'
   32 |     return func(x - pow(2, keta))+ func(pow(2, keta)-1);
      |            ~~~~^~~~~~~~~~~~~~~~~~
a.cc:25:4: note: declared here
   25 | ll func(ll x, bool flag)
      |    ^~~~
a.cc:32:40: error: too few arguments to function 'll func(ll, bool)'
   32 |     return func(x - pow(2, keta))+ func(pow(2, keta)-1);
      |                                    ~~~~^~~~~~~~~~~~~~~~
a.cc:25:4: note: declared here
   25 | ll func(ll x, bool flag)
      |    ^~~~
a.cc: In function 'int main()':
a.cc:41:17: error: too few arguments to function 'll func(ll, bool)'
   41 |     cout << func(l) - func(r) << endl;
      |             ~~~~^~~
a.cc:25:4: note: declared here
   25 | ll func(ll x, bool flag)
      |    ^~~~
a.cc:41:27: error: too few arguments to function 'll func(ll, bool)'
   41 |     cout << func(l) - func(r) << endl;
      |                       ~~~~^~~
a.cc:25:4: note: declared here
   25 | ll func(ll x, bool flag)
      |    ^~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int p = 1000000007;

int pow(int n, int k) {//n^k(mod p)
	if (k != 0) {
		if (p % 2 == 0) {
			int x = pow(n, k / 2);
			return (long long)x*x%p;
		}
		else {
			int x = pow(n, k - 1);
			return (long long)x*n%p;
		}
	}
	return 1;
}

int rev(int n) {//nの逆元
	return pow(n, p - 2);
}

int bino(int n, int m) {//nCm(mod p)
	int me = 1;
	int ans = 1;
	for (int i = 0;i < n + m;i++) {
		me = (long long)(i + 1) * ans % p;
		if (i == m - 1) {
			ans = (long long)rev(me) * ans%p;
		}
		if (i == m - n - 1) {
			ans = (long long)(rev(me))*ans%p;
		}
	}
	ans = (long long)(ans*me%p);
	return ans;
}

void change(long long x, vector<bool> &da) {
	for (int i = 0;i < 60;i++) {
		da[i] = bool(x % 2);
		x /= 2;
	}
}

int main() {
	long long l, r;
	cin >> l >> r;
	vector<bool> L(60), R(60);
	change(l, L);change(r, R);
	long long ans = 0;
	long long a = 0, b = 0,co=1;
	for (int i = 59;i > -1;i--) {
		if (L[i])
			a = a * 2 + 1;
		else
			a *= 2;
		if (R[i])
			b = b * 2 + 1;
		else
			b *= 2;
		co /= 2;
		if (b - a > 1) {
			if (!L[i]) {
				ans = (ans + pow(3, i)) % p;
			}
			if (R[i]) {
				ans = (ans + pow(3, i)) % p;
			}
		}
		else if(b-a==1){
			ans = (ans + pow(3, i)) % p;
		}
	}
	cout << ans+2 << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:78:31: error: expected '}' at end of input
   78 |         cout << ans+2 << endl;
      |                               ^
a.cc:49:12: note: to match this '{'
   49 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <cmath>
#include <vector>
using namespace std;
int main(){
    int a{0},b{0};
    cin>>a>>b;
    float logg{0};
    short check{0};
   unsigned int sonuc{b-a+1};
   vector<short>a_tarafi(0);
   vector<short>b_tarafi(0);
    vector<short>temp(0);
    vector<short>sonucc(0);
    int gecici{0};
   short uzunluk{0};
   int b_hatirlatici{b};
   int a_hatirlatici{a};
   while(a!=b){
   while(a!=b){gecici=b%a;logg=log2(b);uzunluk=logg;for(int j{0};j<logg;j++){a_tarafi.push_back(0);}
       for(int j{0};j<logg;j++){temp.push_back(0);}logg=log2(a);
       while(a!=0){logg=floor(logg);a_tarafi.at(logg)=1;a-=pow(2,logg);logg=log2(a);}logg=log2(b);
       while(b!=0){logg=floor(logg);b_tarafi.at(logg)=1;b-=pow(2,logg);logg=log2(b);}logg=log2(gecici);
       while(gecici!=0){logg=floor(logg);temp.at(logg)=1;b-=pow(2,logg);logg=log2(b);}
       b=b_hatirlatici;
       a++;
for(int j{0};j<uzunluk;j++){
    if(a_tarafi.at(j)==b_tarafi.at(j)){
        sonucc.push_back(1);
    }else{sonucc.push_back(0);}
}

       for(int j{0};j<uzunluk;j++){
           if(temp.at(j)==sonuc.at(j)){
               gecici++;
           }
       }
if(gecici==uzunluk){
    sonuc++;
}
gecici=0;sonucc.clear();a_tarafi.clear();b_tarafi.clear();
   }
   a_hatirlatici++;
       a=a_hatirlatici;
   b_hatirlatici--;
   b=b_hatirlatici;
   }
cout<<sonuc;}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:26: warning: narrowing conversion of '((b - a) + 1)' from 'int' to 'unsigned int' [-Wnarrowing]
   10 |    unsigned int sonuc{b-a+1};
      |                       ~~~^~
a.cc:34:33: error: request for member 'at' in 'sonuc', which is of non-class type 'unsigned int'
   34 |            if(temp.at(j)==sonuc.at(j)){
      |                                 ^~
Language: C++

#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;

#define MOD 1000000007

vector<ll> f(ll n){
	vector<ll> v;
	while(n){
		if(n%2==1){
			v.pb(1);
		}
		else{
			v.pb(0);
		}
		n/=2;
	}
	reverse(all(v));
	vector<ll> ret;
	rep(i,0,50-v.sz){
		ret.pb(0);
	}
	rep(i,0,v.sz){
		ret.pb(v[i]);
	}
	return ret;
}
ll dp[50][2][2][2];

int main(){
	ll l,r;
	cin>>l>>r;
	vector<ll> vu = f(l);
	vector<ll> vd = f(r);
	dp[0][0][0] = 1;
	rep(i,1,50){
		// 0 0
		if(vu[i]==1&&vd[i]==1){
			dp[i][0][0] += dp[i-1][0][0];
		}
		else if(vu[i]==1&&vd[i]==0){
			dp[i-1][]
		}
		dp[i-1][1][0];
		dp[i-1][0][1];
		dp[i-1][1][1];
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:67:21: error: incompatible types in assignment of 'int' to 'll [2]' {aka 'long long int [2]'}
   67 |         dp[0][0][0] = 1;
      |         ~~~~~~~~~~~~^~~
a.cc:71:37: error: invalid operands of types 'll [2]' {aka 'long long int [2]'} and 'll*' {aka 'long long int*'} to binary 'operator+'
   71 |                         dp[i][0][0] += dp[i-1][0][0];
      |                         ~~~~~~~~~~~~^~~~~~~~~~~~~~~~
a.cc:71:37: note:   in evaluation of 'operator+=(ll [2] {aka long long int [2]}, ll* {aka long long int*})'
a.cc:74:33: error: expected primary-expression before ']' token
   74 |                         dp[i-1][]
      |                                 ^