Language: C++

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

#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define vecp(p) int aa;cin>>aa;(p).push_back(aa);
#define vecpl(p) long long aa;cin>>aa;(p).push_back(aa);
#define vecps(p) string aa;cin>>aa;(p).push_back(aa);
#define vecp2(p) cin>>aa;(p).push_back(aa);
#define vecpl2(p) long long a	b;cin>>ab;(p).push_back(ab);
#define vecps2(p) string ab;cin>>ab;(p).push_back(ab);
#define set0(k,n) for(int nn=0;nn<(n);nn++){ (k).push_back(0); }
#define sorts(c) sort((c).begin(),(c).end());
#define reverses(c) reverse((c).begin(),(c).end());
#define vec(b) vector<int> (b);
#define vecl(b) vector<long long> (b);
#define vecs(b) vector<string> (b);
#define vecsize(b,size) vector<int> (b)((size));
#define pb(b,a) (b).push_back((a));
#define doublece(a,b) cout<<(a)<<' '<<(b)<<endl;
#define pairs(s) vector<pair<int,int>> (s);
#define pairsl(s) vector<pair<ll,ll>> (s);
#define pairss(s) vector<pair<string,string>> (s);
#define pairsp(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairspl(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsps(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsREV(s) (s).push_back(make_pair(bb,aa));
#define pairslREV(s) (s).push_back(make_pair(bb,aa));
#define pairssREV(s) (s).push_back(make_pair(bb,aa));
#define MOD 1000000007
int index[26];
int main()
{
	string s, t;
	cin >> s >> t;
	map<char, int> S;
	map<char, int> T;
	vector<vector<int>> C(26);

	fx(s.size()) {
		S[s.at(x)]++;
		int a = s.at(x) - 'a';
		pb(C.at(a),x)
	}
	vec(A)
	fx(t.size()) {
		T[t.at(x)]++;
		int a = t.at(x) - 'a';
		pb(A, C.at(a).at(index[a]))
		index[a] = (index[a] + 1) % C.at(a).size();
	}
	ll repeat = 1;

	fx(26) {
		if (T['a'+x]>0&& S['a' + x] == 0) {
			ce(-1)
			return 0;
		}
	}
	int sum = -1;
	fx(t.size()) {
		if (sum<A.at(x)) {
			sum = A.at(x);
		}
		else {
			sum =A.at(x);
			repeat++;

		}
	}
	//ce(repeat)
	ll ans = repeat*s.size();
	int b = index[t.at(t.size() - 1) - 'a'];
	ans -= s.size() - C.at(t.at(t.size()-1)-'a').at(b);
	ce(ans+1)
	
    return 0;
}



Compiler output:
a.cc:37:13: error: 'int index [26]' redeclared as different kind of entity
   37 | int index[26];
      |             ^
In file included from /usr/include/string.h:462,
                 from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/strings.h:50:20: note: previous declaration 'const char* index(const char*, int)'
   50 | extern const char *index (const char *__s, int __c)
      |                    ^~~~~
a.cc: In function 'int main()':
a.cc:55:39: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   55 |                 pb(A, C.at(a).at(index[a]))
      |                                       ^
a.cc:25:32: note: in definition of macro 'pb'
   25 | #define pb(b,a) (b).push_back((a));
      |                                ^
a.cc:56:22: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   56 |                 index[a] = (index[a] + 1) % C.at(a).size();
      |                      ^
a.cc:56:34: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   56 |                 index[a] = (index[a] + 1) % C.at(a).size();
      |                                  ^
a.cc:79:22: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   79 |         int b = index[t.at(t.size() - 1) - 'a'];
      |                      ^