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

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

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

	bool can;
	int startIndex;
	for (int i = 0; i < s.size() - t.size() + 1; i++) {

		can = true;
		for (int j = i; j < t.size(); j++) {

			if (s.at(j) == '?' ) continue;
			if (s.at(j) != t.at(j - i)) can = false;

		}
		if (can) {
			startIndex = i;
			break;
		}
	
	}

	if (can) {
		string ans = s;
		for (int i = 0; i < startIndex; i++) {
			if (s.at(i) == '?') ans.at(i) = 'a';
		}
		for (int i = startIndex; i < startIndex + t.size(); i++) {
			ans.at(i) = t.at(i - startIndex);
		}
		for (int i = startIndex + t.size(); i < n; i++) {
			if (s.at(i) == '?') ans.at(i) = 'a';
		}		
		cout << ans << endl;
		return 0;
	}
	else {
		cout << "UNRESTORABLE" << endl;
		return 0;
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:57: error: 'n' was not declared in this scope
   34 |                 for (int i = startIndex + t.size(); i < n; i++) {
      |                                                         ^
Language: C++

#include <iostream>
#include <iomanip>
#include <utility>
#include <cmath>
#include <random>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <algorithm>
using namespace std;

#define rep(i,n) for(int i = 0; i<n; ++i)
#define REP(i,n) for(int i = 1; i<=n; ++i)
#define all(x) begin(x),end(x)
#define showall(obj) for(auto x:obj)cout<<x<<endl;
typedef long long ll;
typedef pair<int,int> ip;
typedef pair<ll,ll> lp;
typedef vector<int> vint;
typedef vector<ll> vll;
const int inf = 100100100;
const ll INF = 1LL<<60;
const int MOD = (int)1e9 + 7;

string s,t;

bool is_sam(char x, char y){
	if(x == '?')return true;
	if(x == y)return true;
	return false;
}

string make_st(int pos){
	string ans;
	rep(i,s.size()){
		if(i==pos){ans+=t; i += t.size()-1;}
		else if(s[i]=='?')ans+='a';
		else ans+=s[i];
	}
	return ans;
}

int main(){
	cin>>s>>t;
	bool al = false;
	vector<string> ans;
	rep(i,s.size()-t.size()+1){
		for(int j = 0; j<t.size(); ++j){
			if(is_sam(s[i+j],t[j])){if(j == t.size()-1){ans.push_back(make_st(i)); pos=true;}}
			else break;
		}
	}
	if(!al){cout<<"UNRESTORABLE"<<endl; return 0;}
	sort(all(ans));
	cout<<ans[0]<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:53:96: error: 'pos' was not declared in this scope; did you mean 'pow'?
   53 |                         if(is_sam(s[i+j],t[j])){if(j == t.size()-1){ans.push_back(make_st(i)); pos=true;}}
      |                                                                                                ^~~
      |                                                                                                pow
Language: C

import sys
input = sys.stdin.readline
s = input().rstrip("\n")
t = input().rstrip("\n")
flg = False
#cnt = 0

if len(s)-len(t)+1<0:
	print("UNRESTOABLE")
    sys.exit()
 
for i in range(len(s)-len(t)+1):
    cnt = 0
    for j in range(len(t)):
        #print(s[i+j],t[j])
        if s[i+j] == t[j] or s[i+j] == '?':
            cnt+=1
        #print(cnt,len(t))
    if cnt == len(t):
        cnt=i
        flg = True
        #print(cnt)
        break
 
if not flg:
    print("UNRESTORABLE")
else:
    li = list(s.replace("?","a"))
    #print(li)
    for j in range(len(t)):
        #print(li[cnt+j], t[j])
        li[cnt+j] = t[j]
    print("".join(li))

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import sys
      | ^~~~~~
main.c:2:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'input'
    2 | input = sys.stdin.readline
      | ^~~~~
main.c:6:2: error: invalid preprocessing directive #cnt
    6 | #cnt = 0
      |  ^~~
main.c:15:10: error: invalid preprocessing directive #print
   15 |         #print(s[i+j],t[j])
      |          ^~~~~
main.c:18:10: error: invalid preprocessing directive #print
   18 |         #print(cnt,len(t))
      |          ^~~~~
main.c:22:10: error: invalid preprocessing directive #print
   22 |         #print(cnt)
      |          ^~~~~
main.c:29:6: error: invalid preprocessing directive #print
   29 |     #print(li)
      |      ^~~~~
main.c:31:10: error: invalid preprocessing directive #print
   31 |         #print(li[cnt+j], t[j])
      |          ^~~~~
Language: C++

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

  int M = int(T.size());
  int N = int(S.size());

  set<string> st;
  priority_queue<string> q; 
  
  for(int i=S.size()-1; i>M-2; i--)
    {
   
      if(S[i]==T[M-1] || S[i]=='?')
	{
        
        
	  for(int j=M-1; j>-1; j--)
	    {
        
	      if(S[i-(M-1-j)]==T[j] || S[i-(M-1-j)]=='?')
		{
		  
		}
	      else
		{
		  break;
		}
 
	      if(j==0)
		{
		  string res=S.copy();
		      
		  for(int k=0; k<N; k++)
		    {
		      
		      if(k==i-M+1)
			{
			  while(k-i+M-1<M)
			    {
			      res[k]=T[k-i+M-1];
			      k++;
			    }
			}
		      else if(S[k]=='?')
			{
			  res[k]='a';
			}
		      else
			{
			  res[k]=S[k];
			}
		    }
		  cout << res << endl;
		  q.push(res);
		 
		}
	    }
	}
    }

  if(!q.empty())
    cout << q.top() << endl;
  else
    cout << "UNRESTORABLE" << endl;
  
 
  return 0;
}
 
 
//cout << setprecision(13);
//next_permutation();
//__gcd();
//reverse();
//set ,tuple ,pair;
//bitset
//vector.find
//vector.count
 


Compiler output:
a.cc: In function 'int main()':
a.cc:45:36: error: no matching function for call to 'std::__cxx11::basic_string<char>::copy()'
   45 |                   string res=S.copy();
      |                              ~~~~~~^~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:2618:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::copy(_CharT*, size_type, size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
 2618 |       copy(_CharT* __s, size_type __n, size_type __pos = 0) const;
      |       ^~~~
/usr/include/c++/14/bits/basic_string.h:2618:7: note:   candidate expects 3 arguments, 0 provided
Language: C++

using namespace std;
int main(){
  string s,t;
  bool flag=true,exist=false;
  cin>>s>>t;
  
  for(int i=0;i!=s.size();i++){
    flag=true;
    if(i+t.size()-1<s.size()){
      for(int j=0;j<t.size();j++){
        if(s[i+j]!='?'&&s[i+j]!=t[j]){
          flag=false;
          break;
        }
      }
      if(flag){
        for(int j=0;j<t.size();j++){
          s[i+j]=t[j];
        }
        exist=true;
        break;
      }
    }
  }
  if(exist){
    for(int i=0;i<s.size();i++){
      if(s[i]=='?'){
        s[i]='a';
      }
    }
    cout<<s<<endl;
  }else{
    cout<<"UNRESTORABLE"<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'string' was not declared in this scope
    3 |   string s,t;
      |   ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | using namespace std;
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>s>>t;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:5:8: error: 's' was not declared in this scope
    5 |   cin>>s>>t;
      |        ^
a.cc:5:11: error: 't' was not declared in this scope
    5 |   cin>>s>>t;
      |           ^
a.cc:31:5: error: 'cout' was not declared in this scope
   31 |     cout<<s<<endl;
      |     ^~~~
a.cc:31:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:31:14: error: 'endl' was not declared in this scope
   31 |     cout<<s<<endl;
      |              ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
a.cc:33:5: error: 'cout' was not declared in this scope
   33 |     cout<<"UNRESTORABLE"<<endl;
      |     ^~~~
a.cc:33:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:33:27: error: 'endl' was not declared in this scope
   33 |     cout<<"UNRESTORABLE"<<endl;
      |                           ^~~~
a.cc:33:27: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
 
# 後ろからTを含めることができるか確認していく。余った?はaにする。
int main(){
    string a;
    string b;
    cin >> a >> b;
    reverse(a.begin(), a.end());
    reverse(b.begin(), b.end());
    int a_len = a.size();
    int b_len = b.size();
    bool skip = false;
    rep(i,a_len-b_len+1){
        rep(j,b_len){
            if(a[i+j] != '?'&&b[j] != a[i+j])break;
            if(j == b_len-1){
                skip = true;
                rep(k,b_len)a[i+k] = b[k];
                i += b_len;
            }
        }
        if(skip)break;
    }
    reverse(a.begin(), a.end());
    rep(i,a_len)if(a[i] == '?')a[i] = 'a';
    if(skip)cout << a << endl;
    else cout << "UNRESTORABLE" << endl;
    return 0;
}

Compiler output:
a.cc:5:3: error: extended character 。 is not valid in an identifier
    5 | # 後ろからTを含めることができるか確認していく。余った?はaにする。
      |   ^
a.cc:5:3: error: invalid preprocessing directive #\U00005f8c\U0000308d\U0000304b\U00003089T\U00003092\U0000542b\U00003081\U0000308b\U00003053\U00003068\U0000304c\U00003067\U0000304d\U0000308b\U0000304b\U000078ba\U00008a8d\U00003057\U00003066\U00003044\U0000304f\U00003002\U00004f59\U00003063\U0000305f
    5 | # 後ろからTを含めることができるか確認していく。余った?はaにする。
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:5:55: error: extended character 。 is not valid in an identifier
    5 | # 後ろからTを含めることができるか確認していく。余った?はaにする。
      |                                                       ^
Language: C++

#include <bits/stdc++.h>
#define fi first
#define se second
#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)
#define rng(a) a.begin(), a.end()
#define rrng(a) a.rbegin(), a.rend()
#define maxs(x, y) (x = max(x, y))
#define mins(x, y) (x = min(x, y))
#define limit(x, l, r) max(l, min(x, r))
#define lims(x, l, r) (x = max(l, min(x, r)))
#define isin(x, l, r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)), x.end())
#define show(x) cout << #x << " = " << x << endl;
#define PQ(T) priority_queue<T, v(T), greater<T>>
#define bn(x) ((1 << x) - 1)
#define dup(x, y) (((x) + (y)-1) / (y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;

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

  int n = s.size();
  int m = t.size();
  vector<string> ans;
  
  rep(i,n){
    string a = "";
    rep(k,i){
      if(s[k] == '?')a+='a';
      else a += s[k];
    }
    bool flag = true;
    rep(j,m){
      if (s[i+j] == '?'){
        a+=t[j];
      }
      else if(s[i+j] == t[j]){
        a+=t[j];

      }
      else {
        flag = false;
        break;
      }
    }
    rep(i,n-a.size()) a+="a";
    if(flag){
      ans.push_back(a);
    }
  }
  

  if(ans.size() < 1){
    cout<<"UNRESTORABLE"<<endl;
    return 0;
  }
  sort(ans.begin(),ans.end());
  cout<<ans[0]<<endl;
  

Compiler output:
a.cc: In function 'int main()':
a.cc:80:22: error: expected '}' at end of input
   80 |   cout<<ans[0]<<endl;
      |                      ^
a.cc:39:12: note: to match this '{'
   39 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const double PI=3.14159265358979323846;
const int64_t waru = 1000000007;
const in INF=1<<30;
#define vec2(a,y,x) vector<vector<char>> a(y,vector<char>(x))
#define vec1(a,n) vector<int> a(n);rep(i,n)cin>>a[i]

int main(){
  string s,t;
  cin>>s>>t;
  int x=s.size();
  int y=t.size();
  bool pos=true;
  int fin=100;
  for(int i=x-1;i>=y-1;i--){
    pos=true;
     for(int j=y-1;j>=0;j--){
     	if(s[i]==t[j] || s[i]=='?') continue;
       pos=false;
       break;
     }
    if(pos){fin=i;break;}
  }
  if(!pos) {cout<<"UNRESTORABLE"<<endl;return 0}
  rep(i,y){
  	s[fin-i]=t[y-i-1];
  }
  rep(i,x) if(s[i]=='?') s[i]='a';
  cout<<s<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:48: error: expected ';' before '}' token
   29 |   if(!pos) {cout<<"UNRESTORABLE"<<endl;return 0}
      |                                                ^
      |                                                ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const double PI=3.14159265358979323846;
const int64_t waru = 1000000007;
const in INF=1<<30;
#define vec2(a,y,x) vector<vector<char>> a(y,vector<char>(x))
#define vec1(a,n) vector<int> a(n);rep(i,n)cin>>a[i]

int main(){
  string s,t;
  cin>>s>>t;
  x=s.size();
  y=t.size();
  bool pos=true;
  int fin=100;
  for(int i=x-1;i>=y-1;i--){
    pos=true;
     for(int j=y-1;j>=0;j--){
     	if(s[i]==t[j] || s[i]=='?') continue;
       pos=false;
       break;
     }
    if(pos){fin=i;break;}
  }
  if(!pos) {cout<<"UNRESTORABLE"<<endl;return 0}
  rep(i,y){
  	s[fin-i]=t[y-i-1];
  }
  rep(i,x) if(s[i]=='?') s[i]='a';
  cout<<s<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: 'x' was not declared in this scope
   16 |   x=s.size();
      |   ^
a.cc:17:3: error: 'y' was not declared in this scope
   17 |   y=t.size();
      |   ^
a.cc:29:48: error: expected ';' before '}' token
   29 |   if(!pos) {cout<<"UNRESTORABLE"<<endl;return 0}
      |                                                ^
      |                                                ;
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
using vc = vector<char>;
using vvc = vector<vc>;
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
int main(){
  string s,t;
  cin>>s>>t;
  vstr ans(0);
  ll sn=sz(s);
  ll tn=sz(t);
  rep(i,sn-tn+1){
    ll k=1;
    string a=s;
    for(int j=0;j<tn;j++){
      if(s[i+j]=='?') {
        a[i+j]=t[j];
        continue;
      }
      if(s[i+j]!=t[j]){
        k=0;
        break;
      }
    }
    if(k){
      rep(j,sn){
        if(a[j]=='?'){
          a[j]='a';
        }
      }
      ans.pb(a);
    }
  }
  if(sz(ans)){
  sort(all(ans));
  COUT(ans[0]);
  }
  else{
    COUT("UNRESTORABLE"));
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:73:25: error: expected ';' before ')' token
   73 |     COUT("UNRESTORABLE"));
      |                         ^
Language: C++

//   _/                _/                 _/_/_/   _/
//_/_/_/_/   _/_/   _/_/_/_/   _/_/    _/       _/_/
// _/     _/    _/   _/     _/    _/  _/_/_/     _/
//_/     _/    _/   _/     _/    _/  _/    _/   _/
// _/_/   _/_/       _/_/   _/_/      _/_/     _/
#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<set>
#include<map>
#include<queue>
#include<vector>
using namespace std;
typedef long long ll;
const int MOD=1e9+7;
const int mod=998244353;
const double pi=3.14159265358979323846;
const int inf=2e9;
const ll INF=9e18;
typedef pair<ll,ll> P;
int main() {
  cin.tie(0),cout.tie(0);
  ios::sync_with_stdio(false);
  string s,t;
  cin >> s >> t;
  for(int i=s.size()-t.size(); i>=0; i--) {
    for(int j=0; j<t.size(); j++) {
      if(s[i+j]!='?'&&s[i+j]!=t[j]) {
        break;
      }
    }
    if(j==t.size()) {
      for(int j=0; j<t.size(); j++) {
        s[i+j]==t[j];
      }
      for(int j=0; j<s.size(); j++) {
        if(s[j]=='?') {
          s[j]='a';
        }
      }
      cout << s << endl;
      return 0;
    }
  }
  cout << "UNRESTORABLE" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:8: error: 'j' was not declared in this scope
   33 |     if(j==t.size()) {
      |        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
template<class T> bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;}
typedef long long ll;
const ll INF=1e18;
const ll MOD=1e9+7;

int main(){
    string S;
    string T;
    cin>>S>>T;
    rep(i,S.size()-T.size()+1){
        bool judge=true;
        rep(j,T.size()){
            if(S[S.size()-T.size()-i+j]!='?' && S[S.size()-T.size()-i+j]!=T[j]) judge=false;
        }
        if(judge){
            string ans="";
            rep(j,S.size()){
                if(S.size()-T.size()-i<=j && j<S.size()-T.size()-i+T.size()){
                    ans+=T[j-(S.asize()-T.size()-i)];
                }else if(S[j]=='?'){
                    ans+='a';
                }else{
                    ans+=S[j];
                }
            }
            cout<<ans<<endl;
            return 0;
        }
    }
    cout<<"UNRESTORABLE"<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:33: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'asize'; did you mean 'size'?
   23 |                     ans+=T[j-(S.asize()-T.size()-i)];
      |                                 ^~~~~
      |                                 size
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
	string s,t;
	cin >>s >>t;
	int lens=s.size(),lent=t.size(),i=0,j=0;
	bool ok=0;
	for (i=lens-lent;i>=0;i--)
	{
		ok=0;
		if (s[i]==t[0]||s[i]=='?')
		{
			s1=s.substr(i+1,lens);
			for (j=0;j<s1.size();j++)
			{
				if (s1[j]!=t[j]&&s1[j]!='?')
				{
					ok=1;
					break;
				}
			}
			if (ok==0)
			{
				s=s.substr(0,i-1)+t+s.substr(i+lent,lens);
				for (j=0;j<lens;j++)
					if (s[j]=='?')
						s[j]=='a';
			}
			cout <<s<<endl;
			return 0;
		}
	}
	cout <<"UNRESTORABLE"<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:25: error: 's1' was not declared in this scope; did you mean 's'?
   14 |                         s1=s.substr(i+1,lens);
      |                         ^~
      |                         s
Language: C++

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

int main(){
  string S;cin>>S;std::reverse(S.begin(),S.end());
  string T;cin>>T;std::reverse(T.begin(),T.end());

  for (int s = 0; s < S.size()-T.size(); s++) {
    string sbs = S.substr(s,T.size()+s);
    bool flg=true;
    for (int t = 0; t < T.size(); t++){
      if (!(sbs[t]==T[t]||sbs[t]=='?')){
        flg=false;
        break;
      }
    }
    if (flg){
      string ans=S.substr(0,s)+T+S.substr(T.size()+s,S.size());
      replace(ans.begin(),ans.end(),'?','a');
      reverse(ans.begin(),ans.end());
      cout<< ans  << "\n";return 0;
    }
  }


  cout<<  "UNRESTORABLE" << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:24: error: 'reverse' is not a member of 'std'
    6 |   string S;cin>>S;std::reverse(S.begin(),S.end());
      |                        ^~~~~~~
a.cc:7:24: error: 'reverse' is not a member of 'std'
    7 |   string T;cin>>T;std::reverse(T.begin(),T.end());
      |                        ^~~~~~~
a.cc:20:7: error: 'replace' was not declared in this scope
   20 |       replace(ans.begin(),ans.end(),'?','a');
      |       ^~~~~~~
a.cc:21:7: error: 'reverse' was not declared in this scope
   21 |       reverse(ans.begin(),ans.end());
      |       ^~~~~~~
Language: C++

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

int main(){
  string S;cin>>S;reverse(S.begin(),S.end());
  string T;cin>>T;reverse(T.begin(),T.end());

  for (int s = 0; s < S.size()-T.size(); s++) {
    string sbs = S.substr(s,T.size()+s);
    bool flg=true;
    for (int t = 0; t < T.size(); t++){
      if (!(sbs[t]==T[t]||sbs[t]=='?')){
        flg=false;
        break;
      }
    }
    if (flg){
      string ans=S.substr(0,s)+T+S.substr(T.size()+s,S.size());
      replace(ans.begin(),ans.end(),'?','a');
      reverse(ans.begin(),ans.end());
      cout<< ans  << "\n";return 0;
    }
  }


  cout<<  "UNRESTORABLE" << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:19: error: 'reverse' was not declared in this scope
    6 |   string S;cin>>S;reverse(S.begin(),S.end());
      |                   ^~~~~~~
a.cc:20:7: error: 'replace' was not declared in this scope
   20 |       replace(ans.begin(),ans.end(),'?','a');
      |       ^~~~~~~
Language: C++

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

int main()
{
  string s,b;
  cin>>s>>b;
  int blen=b.length();
  int len=s.length();
  int max=-1;
  bool out-0;
  for(int i=0;i<len-blen+1;i++)
  {
    int j=0;
    bool jdg=1;
    for(j=0;j<blen;j++)
    {
      if(s[i+j]!='?' && s[i+j]!=b[j])
      {  
        jdg=0;
        break;
      }
    }
    
    if(jdg) max=i;
  }
    if(max==-1){
      cout<<"UNRESTORABLE"<<endl;
  	  out=1;
    }
  if(!out){
    int j=0;
    for(int i=max;i<blen;i++){
      s[i]=b[j];
      j++;
    }
  
  	for(int i=0;i<len;i++)
    {
      if(s[i]=='?') s[i]='a';
    }
    cout<<s<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: expected initializer before '-' token
   11 |   bool out-0;
      |           ^
a.cc:29:11: error: 'out' was not declared in this scope
   29 |           out=1;
      |           ^~~
a.cc:31:7: error: 'out' was not declared in this scope
   31 |   if(!out){
      |       ^~~
Language: C++

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

int main()
{
  string s,b;
  cin>>s>>b;
  int blen=b.length;
  int len=s.length();
  int max=-1;
  for(int i=0;i<len-blen+1;i++)
  {
    int j=0;
    bool jdg=1,out=0;
    for(j=0;j<blen;j++)
    {
      if(s[i+j]!='?' && s[i+j]!=b[j])
      {  
        jdg=0;
        break;
      }
    }
    
    if(jdg) max=i;
  }
    if(max==-1){
      cout<<"UNRESTORABLE"<<endl;
  	  out=1;
    }
  if(!out){
    int j=0;
    for(int i=max;i<blen;i++){
      s[i]=b[j];
      j++;
    }
  
  	for(int i=0;i<len;i++)
    {
      if(s[i]=='?') s[i]='a';
    }
    cout<<s<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: cannot convert 'std::__cxx11::basic_string<char>::length' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
    8 |   int blen=b.length;
      |              ^~~~~~
a.cc:28:11: error: 'out' was not declared in this scope
   28 |           out=1;
      |           ^~~
a.cc:30:7: error: 'out' was not declared in this scope
   30 |   if(!out){
      |       ^~~
Language: C++

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

int main()
{
  string a,b;
  cin>>a>>b;
  int blen=b.length;
  int len=a.length();
  int max=-1;
  for(int i=0;i<len-blen+1;i++)
  {
    int j=0;
    bool jdg=1,out=0;
    for(j=0;j<blen;j++)
    {
      if(s[i+j]!='?' && s[i+j]!=b[j])
      {  
        jdg=0;
        break;
      }
    }
    
    if(jdg) max=i;
  }
    if(max==-1){
      cout<<"UNRESTORABLE"<<endl;
  	  out=1;
    }
  if(!out){
    int j=0;
    for(int i=max;i<blen;i++){
      s[i]=b[j];
      j++;
    }
  
  	for(int i=0;i<len;i++)
    {
      if(s[i]=='?') s[i]='a';
    }
    cout<<s<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: cannot convert 'std::__cxx11::basic_string<char>::length' from type 'std::__cxx11::basic_string<char>::size_type (std::__cxx11::basic_string<char>::)() const noexcept' {aka 'long unsigned int (std::__cxx11::basic_string<char>::)() const noexcept'} to type 'int'
    8 |   int blen=b.length;
      |              ^~~~~~
a.cc:17:10: error: 's' was not declared in this scope
   17 |       if(s[i+j]!='?' && s[i+j]!=b[j])
      |          ^
a.cc:28:11: error: 'out' was not declared in this scope
   28 |           out=1;
      |           ^~~
a.cc:30:7: error: 'out' was not declared in this scope
   30 |   if(!out){
      |       ^~~
a.cc:33:7: error: 's' was not declared in this scope
   33 |       s[i]=b[j];
      |       ^
a.cc:39:10: error: 's' was not declared in this scope
   39 |       if(s[i]=='?') s[i]='a';
      |          ^
a.cc:41:11: error: 's' was not declared in this scope
   41 |     cout<<s<<endl;
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
  string s,t,ans="";
  int flag=0,cnt=0,x=0,y;
  cin>>s>>t;
  rep(i,s.size()){
    flag=0
    if (s.at(i)=='?') {
      x+=1;
    }
    else if (s.at(i)!='?') {
      x=0;
      cnt=max(cnt,x);
    }
    
    if (s.at(i)==t.at(0) || s.at(i)=='?') {
      if (s.size()-i>=t.size()) {
        rep(j,t.size()){
          if (s.at(i+j)==t.at(j) || s.at(i+j)=='?') {
            flag+=1;
          }
        }
      }
    }
    if (t.size()==flag) {
      y=i;
      break;
    }
    else if (t.size()<=cnt) {
      y=i;
      break;
    }
  }
  if (t.size()==flag || cnt==t.size()) {
    rep(i,s.size()){
      if (i<y) {
        if (s.at(i)!='?') {
          ans+=s.at(i);
        }
        else{
          ans+='a';
        }
      }
      else if (i>=y && i<=y+t.size()-1) {
        ans+=t.at(i-y);
      }
      else{
        ans+='a';
      }
    }
    cout<<ans<<endl;
  }
  else{
    cout<<"UNRESTORABLE"<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: expected ';' before 'if'
    9 |     flag=0
      |           ^
      |           ;
   10 |     if (s.at(i)=='?') {
      |     ~~     
a.cc:13:5: error: 'else' without a previous 'if'
   13 |     else if (s.at(i)!='?') {
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
using namespace std;

//ループマクロ
#define FOR(i , a , b)  for(int i = (a) ; i < (b) ; i++)
#define REP(i , n)      for(int i = 0 ; i < n ; i++)
#define REPR(i , n)     for(int i = n ; 0 <= i ; i--)
#define ROP(i, n)       for(int i = 1 ; i <= n ; i++)

//入出力
#define SCOUT(x) cout << (x) << " "
#define VECCIN(x) for(auto& ele : (x) ) cin >> ele
#define VECOUT(x) for(auto& ele : (x) ) cout << ele << " "; cout << endl;

//その他
#define ALL(obj) (obj).begin() , (obj).end() 
#define P pair<int , int>
#define V vector<int>
#define VLL vector<long long>
#define M map<int, int>
#define S set<int>
#define PQ priority_queue<int>
#define PQG priority_queue<int , V , greater<int>>

int main(void) {

	ios::sync_with_stdio(false);	cin.tie(0);
	string s, t;  cin >> s >> t;

  	is(s.size() < t.size()){
		cout << "UNRESTORABLE" << endl;
      	return 0;
    }
	int ins_point = -1;
	for(int i = 0 ; i <= s.size() - t.size() ; i++){
			
			bool flag = true;
			for(int j = 0 ; j < t.size() ; j++){
					if(s[i + j] != '?' && s[i + j] != t[j]){
							flag = false;
							break;
					}
			}

			if(flag)  ins_point = i;
	}

	if(ins_point == -1)  cout << "UNRESTORABLE" << endl;
	else{
			for(int i = 0 ; i < s.size() ; i++){
					if(i == ins_point){
							for(int j = 0 ; j < t.size() ; j++)	cout << t[j];
							i += t.size() - 1;
							continue;
					}
					if(s[i] != '?')   cout << s[i];
					else              cout << 'a';
			}
			cout << endl;
	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:9: error: 'is' was not declared in this scope; did you mean 's'?
   33 |         is(s.size() < t.size()){
      |         ^~
      |         s
Language: C++


def main():
  S_=input()
  T=input()
  if len(S_)<len(T):
    print('UNRESTORABLE')
    return
  for i in range(len(S_)-len(T)+1):
    flag=True
    for j in range(len(T)):
      if S_[i+j]!='?' and S_[i+j]!=T[j]:
        flag=False
        break
    if flag:
      S=['a']*len(S_)
      for k in range(i):
        if S_[k]!='?':
          S[k]=S_[k]
      for k in range(i,i+len(T)):
        S[k]=T[k-i]
      for k in range(i+len(T),len(S_)):
        if S[k]!='?':
          S[k]=S_[k]
      print(''.join(S))
      return
  print('UNRESTORABLE')
  return

main()


Compiler output:
a.cc:6:11: warning: multi-character literal with 12 characters exceeds 'int' size of 4 bytes
    6 |     print('UNRESTORABLE')
      |           ^~~~~~~~~~~~~~
a.cc:24:13: error: empty character constant
   24 |       print(''.join(S))
      |             ^~
a.cc:26:9: warning: multi-character literal with 12 characters exceeds 'int' size of 4 bytes
   26 |   print('UNRESTORABLE')
      |         ^~~~~~~~~~~~~~
a.cc:2:1: error: 'def' does not name a type
    2 | def main():
      | ^~~
Language: C++

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define REP(i,a,b) for (int i = a; i < (b); ++i)
#define all(x) (x).begin(),(x).end()
const int INF = 1000000007;
typedef long long ll;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { return (a * b) / gcd(a,b); }
ll fac(ll a) { return a > 1 ? fac(a - 1) * a : 1; }
bool echeck(ll a) { return a % 2 == 0 ? 1 : 0; }
ll comb(ll n, ll m){
  ll tmp = 1;
  for(int i = n; i >= n - m + 1; i--){
    tmp *= i;
  }
  ll temp = 1;
  for(int i = 1; i <= m; i++){
    temp *= i;
  }
  return tmp / temp;
}
bool check(int i,string s,string t){
  int tsize = t.size();
  string tmp = s.substr(i,tsize);
  bool r = true;
  rep(i,tsize){
    if(tmp[i] != t[i] && tmp[i] != '?')r = false;
  }
  return r;
}
int main(){
  // ios::sync_with_stdio(false);cin.tie(nullptr);
  string s,t;
  cin >> s >> t;
  string ans = s;
  bool can = false;
  int x;
  REP(i,s.size() - t.size() + 1,-1){
    if(check(i,s,t)){
      can = true;
      x = i;
      break;
    }
  }
  if(!(can)){
    cout << "UNRESTORABLE" << endl;
  }
  else{
    int j = 0;
    for(int i = s.size() - t.size() + 1; i > -1; i--)
      cout << t[j] << endl;
      s[i] = t[j];
      j++;
    }
    rep(i,s.size()){
      if(s[i] == '?')cout << 'a';
      else cout << s[i];
    }
    cout << endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:9: error: 'i' was not declared in this scope
   56 |       s[i] = t[j];
      |         ^
a.cc: At global scope:
a.cc:66:3: error: expected unqualified-id before 'return'
   66 |   return 0;
      |   ^~~~~~
a.cc:67:1: error: expected declaration before '}' token
   67 | }
      | ^
Language: C++

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


int main(){
   string s,t;cin>>s>>t;
   int ns=s.length();
   int nt = t.length();
   char initial=t[0];
   int count = 0;
  
   if(ns<nt){cout<<"UNRESTORABLE"<<endl;return 0;}
   for(int i=ns-nt;i>=0;--i){
       if(s[i]==initial || s[i]=='?'){
            rep(j,nt){
                if(s[i+j]!=t[j] && s[i+j]!='?')cou+=1;
            }
            int cou=0;
            if(cou>0)break;
            rep(j,nt){
                s[i+j]=t[j];
                count+=1;
            }
            if(count>0)break;
       }
       else continue;
   }
   if(count==0){cout<<"UNRESTORABLE"<<endl;return 0;}
   rep(i,ns){
       if(s[i]=='?')s[i]='a';
   }
   cout<<s<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:48: error: 'cou' was not declared in this scope; did you mean 'cos'?
   18 |                 if(s[i+j]!=t[j] && s[i+j]!='?')cou+=1;
      |                                                ^~~
      |                                                cos
Language: C++

S=input();T=input();
M=-1;
for i in range(len(S)-len(T)+1):
  t=True;
  for j in range(len(T)):
    t*=(S[i+j]==T[j] or S[i+j]=='?');
  if(t):
    M=i;
if(M==-1):
  print("UNRESTORABLE");
  exit();
print((S[:M]+T+S[M+len(T):]).replace("?","a"));

Compiler output:
a.cc:1:1: error: 'S' does not name a type
    1 | S=input();T=input();
      | ^
a.cc:1:11: error: 'T' does not name a type
    1 | S=input();T=input();
      |           ^
a.cc:2:1: error: 'M' does not name a type
    2 | M=-1;
      | ^
a.cc:3:1: error: expected unqualified-id before 'for'
    3 | for i in range(len(S)-len(T)+1):
      | ^~~
a.cc:5:3: error: expected unqualified-id before 'for'
    5 |   for j in range(len(T)):
      |   ^~~
a.cc:7:3: error: expected unqualified-id before 'if'
    7 |   if(t):
      |   ^~
a.cc:9:1: error: expected unqualified-id before 'if'
    9 | if(M==-1):
      | ^~
a.cc:11:9: error: expected constructor, destructor, or type conversion before ';' token
   11 |   exit();
      |         ^
a.cc:12:6: error: expected constructor, destructor, or type conversion before '(' token
   12 | print((S[:M]+T+S[M+len(T):]).replace("?","a"));
      |      ^
Language: Java

mport java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// Dubious Document 2
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		String t = scan.next();
		scan.close();

		char sc[]=s.toCharArray();
		char st[]=t.toCharArray();


		int check=0;
		int check_i=0;
		for(int i=0;i<s.length();i++) {
			if(st[0]==sc[i]) {
				if(sc.length-i>=st.length) {
					check=1;
					check_i=i;
					break;
				}
			}
		}

		if(check==0)System.out.println("UNRESTORABLE");
		else {
			int cnt=1;
			for(int i=0;i<s.length();i++) {
				if(check_i<=i && i< check_i + t.length()) {
					if(sc[i]=='?') {
						sc[i]=st[cnt];
						cnt+=1;
					}
				}else if(sc[i]=='?') {
					sc[i]='a';
				}
			}
			for(int i=0;i<s.length();i++) {
				System.out.print(sc[i]);
			}
			System.out.println();
		}
	}

}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.Scanner;
^
1 error
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
  string s,t;
  cin >> s >> t;
  int n1=s.length();
  int n2=t.length();
  vector<string> w(n1-n2+1);
  if(n1<n2){
    cout << "UNRESTORABLE" << endl;
    return;
  }
  for(int i=0;i<n1-n2+1;i++){
    bool flag=true;
    for(int j=0;j<n2;j++){
      if(s[i+j]=='?'){
        continue;
      }
      else if(s[i+j]==t[j]){
        continue;
      }
      else {
        flag=false;
      }
    }
    if(flag){
      for(int j=0;j<n1;j++){
        if(i<=j && j<=i+n2-1){
          w[i]+=t[j-i];
        }
        else{
          if(s[j]=='?'){
            w[i]+='a';
          }
          else{
            w[i]+=s[j];
          }
        }
      }
    }
  }
  sort(w.begin(),w.end());
  bool ans=false;
  for(int i=0;i<n1-n2+1;i++){
      if(w[i].length()){
          cout << w[i] << endl;
          ans=true;
      }
  }
  if(!ans){
      cout << "UNRESTORABLE" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
   13 |     return;
      |     ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#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 SZ(x) ((int)(x).size())
#define debug(x) cerr << #x << ": " << x << '\n'
#define INF 999999999
typedef long long int Int;
typedef pair<int,int> P;
using ll = long long;
using VI = vector<int>;

signed main(){
    string s,t;cin >> s >> t;
    string ans;
    int n=s.size(),m=t.size();
    for(int i =0;i<=n-m;i++){
        bool f = 0;
        string a = s;
        for(int j=0;j<m;j++){
            if(a[i+j]=='?') continue;
            if(a[i+j]!=t[j]) f= 1;
        }
        if(f) continue;
        for(int j=0;j<m;j++) a[i+j] = t[j];
        for(int j=0;j<n;j++) if(a[j]=='?') a[j] = 'a';
        if(ans.empty()) ans = a;
        else ans = min(ans,a):
    }
    if(ans.empty()) cout << "UNRESTORABLE" << endl;
    else cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:30: error: expected ';' before ':' token
   29 |         else ans = min(ans,a):
      |                              ^
      |                              ;
Language: C++

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

int main(){
  string s,t;
  cin >> s >> t;
  bool flag = false;
  int p;
  for(int i=0; i<s.size()-t.size()+1; i++){
    string ssub = s.substr(i,t.size());
    for(int j=0; j<t.size(); j++){
      if(ssub.at(j)==t.at(j)||ssub.at(j)=='?'){
        flag = true;}
      if(ssub.at(j)!=t.at(j)){
        flag = false;
        goto end;}
      }
    }
    p = i;
    end :
  }
  if(flag){
    for(int i=0; i<s.size(); i++){
      if(i==p){
        cout << t << endl;
        i += t.size()-1;
      }else{
        if(s.at(i)=='?'){
          cout << 'a';
        }else{
          cout << s.at(i);
        }
      }
    }
    cout << endl;
  }else{
    cout << "UNRESTORABLE" << endl;
  }
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'i' was not declared in this scope
   19 |     p = i;
      |         ^
a.cc:21:3: warning: label at end of compound statement only available with '-std=c++2b' or '-std=gnu++2b' [-Wc++23-extensions]
   21 |   }
      |   ^
a.cc: At global scope:
a.cc:22:3: error: expected unqualified-id before 'if'
   22 |   if(flag){
      |   ^~
a.cc:36:4: error: expected unqualified-id before 'else'
   36 |   }else{
      |    ^~~~
a.cc:39:1: error: expected declaration before '}' token
   39 | }
      | ^
Language: C++

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

using namespace std;

string S, T;

bool str_check(int si, int ti, int count) {
    if(count==T.size()) return true;
    
    if(S[si]==T[ti] || S[si]=='?') {
        return str_check(si+1, ti+1, count+1);
    } else {
        return false;
    }
}

int main() {
    cin >> S >> T;
    
    vector<string> T_ins;
    for(int s=0; s<S.size(); s++) {
        if(str_check(s, 0, 0)) {
            string prevT=S.substr(0, s);
            for(int p=0; p<prevT.size(); p++) {
                if(prevT[p]=='?') prevT[p]='a';
            }
            string nextT=S.substr(s+T.size(), S.size()-(s+T.size()));
            for(int n=0; n<nextT.size(); n++) {
                if(nextT[n]=='?') nextT[n]='a';
            }
            T_ins.push_back(prevT+T+nextT);
        }
    }

    // for(int i=0; i<T_ins.size(); i++) {
    //     cout << T_ins[i] << endl;
    // }

    if(!T_ins.size()) {
        cout << "UNRESTORABLE" << endl;
        return 0;
    }
    
    sort(T_ins.begin(), T_ins.end());
    
    cout << T_ins[0] << endl;
    
    return 0;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   46 |     sort(T_ins.begin(), T_ins.end());
      |     ^~~~
      |     short
Language: C++

#include <iostream>
using namespace std;

string restore(string s, string t)
{
    for (int i = s.size() - 1; i >= 0; i--)
    {
        if (s[i] == '?')
        {
            existQuestion = 1;
        }
        if (i <= s.size() - t.size())
        {
            size_t j = 0;
            size_t k = i;
            string temp{s};
            while (s[k] == t[j] || s[k] == '?')
            {
                temp[k] = t[j];
                k++;
                j++;
                if (j == t.size())
                {
                    for (size_t l = 0; l < s.size(); l++)
                    {
                        if (temp[l] == '?')
                        {
                            temp[l] = 'a';
                        }
                    }
                    return temp;
                }
            }
        }
    }
    return "UNRESTORABLE";
}

int main()
{
    string s, t;
    cin >> s >> t;
    cout << restore(s, t) << '\n';
    return 0;
}


Compiler output:
a.cc: In function 'std::string restore(std::string, std::string)':
a.cc:10:13: error: 'existQuestion' was not declared in this scope
   10 |             existQuestion = 1;
      |             ^~~~~~~~~~~~~
Language: C++

string restore(string s, string t){
    for (size_t i = s.size() - t.size(); i >= 0; i--)
    {
        size_t j = 0;
        string temp{s};
        while (s[i] == t[j] || s[i] == '?')
        {
            temp[i] = t[j];
            i++;
            j++;
            if (j == t.size())
            {
        for (size_t i=0; i < s.size(); i++ {
                    if (s[i] == '?')
                    {
                        s[i] == 'a';
                    }
        }
        return temp;
            }
        }
    }
        return s;

}


    int main()
    {
        string s, t;
        cin >> s >> t;
        string restored = restore(s, t);
        if (restored == s)
        {
            return "UNRESTORABLE";
        }
        else
        {
            return restored;
        }
    }

Compiler output:
a.cc:1:1: error: 'string' does not name a type
    1 | string restore(string s, string t){
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:30:9: error: 'string' was not declared in this scope
   30 |         string s, t;
      |         ^~~~~~
a.cc:31:9: error: 'cin' was not declared in this scope
   31 |         cin >> s >> t;
      |         ^~~
a.cc:31:16: error: 's' was not declared in this scope
   31 |         cin >> s >> t;
      |                ^
a.cc:31:21: error: 't' was not declared in this scope
   31 |         cin >> s >> t;
      |                     ^
a.cc:32:15: error: expected ';' before 'restored'
   32 |         string restored = restore(s, t);
      |               ^~~~~~~~~
      |               ;
a.cc:33:13: error: 'restored' was not declared in this scope
   33 |         if (restored == s)
      |             ^~~~~~~~
a.cc:35:20: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
   35 |             return "UNRESTORABLE";
      |                    ^~~~~~~~~~~~~~
      |                    |
      |                    const char*
Language: C++

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

int main() {
    string S; cin >> S;
    string T; cin >> T;
    bool flag = true;
    vector<int> memo;
    for (int i = 0; i < S.length() - T.length(); i++){
        for (int j = 0; j < T.length(); j++){
            if (S[i] != T[j] && S[i] != '?'){
                flag = false;
                break;
            }
        }
        if (flag){
            memo.push_back(i);
        }
    }
    string SS = "";
    for (int i = 0; i < S.length(); i++){
        if (S[i] == '?'){
            SS += 'a';
        }
        else {
            SS += S[i];
        }
    }
    string ans = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz";
    string now = "";
    for (int i = 0; i < memo.size(); i++){
        for (int j = 0; j < memo[i]; j++){
            now += SS[j];
        }
        now += T;
        for (int j = memo[i] + T.length() - 1; j < S.length(), j++){
            now += SS[j];
        }
        if (now < ans){
            ans = now;
        }
        now = "";
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:67: error: expected ';' before ')' token
   39 |         for (int j = memo[i] + T.length() - 1; j < S.length(), j++){
      |                                                                   ^
      |                                                                   ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
string s,t,ans="";
int i,j,r;
int main(void){
    ios::sync_with_stdio(false);
    cin>>s>>t;
    if(s.size()<t.size()){
        cout<<"UNRESTORABLE\r\n";
        exit(0);
    }
    for(i=0;i<=s.size()-t.length();i++){
        int k=i;
        string ss=s;
        j=0;
        while(j<t.size()){
            if(ss[k]=='?')
                ss[k]=t[j];
            else if(s[k]!=t[j]) break;
            k++;
            j++;
        }
        if(j==t.size()){
            for(r=0;r<ss.length();r++){
                if(ss[r]=='?')/
                    ss[r]='a';
            }
            if(ans=="") ans=ss;
            else ans=min(ans,ss);
        }
    }
    if(ans=="") cout<<"UNRESTORABLE\n";
    else cout<<ans<<"\r\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:31: error: expected primary-expression before '/' token
   25 |                 if(ss[r]=='?')/
      |                               ^
Language: C++

#include <iostream>
using namespace std;
int main(){
  string s,t;cin>>s>>t;
  for(int i = 0; s.size()-t.size() > i; i++){
    if(s[i]=='?' || s[i] == t[0]){
      bool ok = true;
      for(int j = 0; t.size() > j; j++){
        if(!(s[i+j]=='?' || s[i+j] == t[j])){
          ok = false;
          break;
        }
      }
      if(ok){
        for(int j = 0; t.size() > j; j++){
          s[i+j] = t[j];
        }
        for(int j = 0; s.size() > j; j++){
          cout << (s[j]=='?':'a':s[j]);
        }
        cout << endl;
        return 0;
      }
    }
  }
  cout << "UNRESTORABLE" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:29: error: expected ')' before ':' token
   19 |           cout << (s[j]=='?':'a':s[j]);
      |                   ~         ^
      |                             )
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define MAX 1000000000
int dx[] = {1,0,-1,0};
int dy[] = {0,-1,0,1};
const ll INF = 10010010010001;
vector<vector<int>> graph;
vector<vector<bool>> reached;

int main(){
    string S,T;
    cin >> S >> T;
    int ts = -1;

    for(int i=S.size()-T.size();i>=0;i--){
        for(int j=0;j<T.size();j++){
            if(S[i+j] != T[j] && S[i+j] != '?'){
                break;
            }
            if(j == T.size()){
                ts = i;
            }
        }
        if(ts != -1){
            break;
        }
    }

    if(ts == -1){
        cout << "UNRESTORABLE" << endl;
    }
    else{
        for(int i=0;i<T.size();i++){
            S[ts+i] = T[i];
        }
        for(int i=0;i<S.size();i++){
            if(S[i]=='?'){
                cout << 'a';
            }else{
                cout << S[i];
            }
        }
        cout << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:2: error: expected '}' at end of input
   45 | }
      |  ^
a.cc:11:11: note: to match this '{'
   11 | int main(){
      |           ^