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

#include<iostream>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<algorithm>
using namespace std;
int main()
{
	char a[100];
    char b[50];
	char  c[100];
	int i,k,l,L,n,M,m;
    gets(a);
    gets(b);
	l=strlen(a);
	L=strlen(b);
	for(i=0;i<l;i++)
	{
		if(a[i]=='?'||a[i]==b[0])
		{
			n=1;
			for(k=1,m=i+1;k<L;k++,m++)
			{
				if(a[m]=='?'||a[m]==b[k])
					n++;
			}
		}
		if(n==L)
		{   M=i;
			break;
		}
	}
	if(n!=L)
		cout<<"UNRESTORABLE";
		else{
		m=0;
	for(i=0;i<l;i++)
	{
		if(i==M)
        {
            i=i+L-1;
        }
		else
		{
			if(a[i]!='?')
				{
					c[m]=a[i];
					m++;
				}
		}
	}
	sort(c,c+m);
	k=0;
	for(i=0;i<l;i++)
	{
		if(i==M)
        {
            for(n=0;n<L;n++)
            {
                cout<<b[n];
            }
			i=i+L-1;
        }
		else if(a[i]=='?')
			cout<<'a';
		else
		{
			cout<<c[k];
			k++;
		}
	}

		}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
   13 |     gets(a);
      |     ^~~~
      |     getw
Language: C++

#include<iostream>
#include<cmath>
#include<cstring>
using namespace std;
#include<cstdio>
#include<algorithm>
int main()
{
	char a[100];
    char b[50];
	char  c[100];
	int i,k,l,L,n,M,m;
    gets(a);
    gets(b);
	l=strlen(a);
	L=strlen(b);
	for(i=0;i<l;i++)
	{
		if(a[i]=='?'||a[i]==b[0])
		{
			n=1;
			for(k=1,m=i+1;k<L;k++,m++)
			{
				if(a[m]=='?'||a[m]==b[k])
					n++;
			}
		}
		if(n==L)
		{   M=i;
			break;
		}
	}
	if(n!=L)
		cout<<"UNRESTORABLE";
		else{
		m=0;
	for(i=0;i<l;i++)
	{
		if(i==M)
        {
            i=i+L-1;
        }
		else
		{
			if(a[i]!='?')
				{
					c[m]=a[i];
					m++;
				}
		}
	}
	sort(c,c+m);
	k=0;
	for(i=0;i<l;i++)
	{
		if(i==M)
        {
            for(n=0;n<L;n++)
            {
                cout<<b[n];
            }
			i=i+L-1;
        }
		else if(a[i]=='?')
			cout<<'a';
		else
		{
			cout<<c[k];
			k++;
		}
	}

		}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
   13 |     gets(a);
      |     ^~~~
      |     getw
Language: C++

#pragma comment(linker, "/STACK:1024000000,1024000000")
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <limits.h>
#include <assert.h>
#include <math.h>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <string>
#include <bitset>
#include <vector>
using namespace std;

#define LL long long

#define fi first
#define se second
#define lson l,mid,id<<1
#define rson mid+1,r,id<<1|1
#define ls id<<1
#define rs id<<1|1
#define MID(a,b) (((a)+(b))>>1)
#define maxx(a,b) ((a)<(b)?(b):(a))
#define minx(a,b) ((a)<(b)?(a):(b))
#define absx(a) ((a)<0?-(a):(a))
#define mk(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define itr iterator
#define lowbit(x) ((x)&-(x))

typedef unsigned LL ULL;
typedef unsigned uint;
typedef map<int,int> mii;
typedef pair<int,int> pii;
typedef pair<double,double> pdd;
typedef pair<LL,LL> pLL;

template< typename T > inline void read(T &x) {
    bool f; char ch; f=0; x=0; ch=getchar();
    while(ch<'0' || ch>'9') {if(ch=='-') f=1; ch=getchar();}
    while(ch>='0' && ch<='9') {x=x*10+ch-'0'; ch=getchar();}
    if(f) x=-x;
}

template< typename T > inline void Max(T &a, T b) {if(a<b) a=b;}
template< typename T > inline void Min(T &a, T b) {if(b<a) a=b;}
template< typename T > inline T Abs(T a) {if(a<0) return -a; else return a;}

const double pi=(double) acos(-1.0);
const int MOD=(int) 1e9+7;
const int INF=(int) 0x3f3f3f3f;
const LL  LINF=(LL) INF<<32|INF;
const int SINF=(uint) ~0>>1;
const LL  SLINF=(ULL) (-1)>>1;
const double DINF=(double) 1e50;
const double eps=(double) 1e-8;
const int maxn=(int) 2000+20;
const int maxm=(int) 1e6+20;
const int maxk=(int) 5e2+20;

inline int sig(double x) {return x<-eps?-1:x>eps;}

//--------------start------------------

int n,m;
char S[55],T[55];

inline bool check(char *S,char *T)
{
    for(int i=0;T[i];i++) if(S[i]!='?' && S[i]!=T[i]) return 0;
    return 1;
}

void work()
{
    gets(S);gets(T);
    n=strlen(S); m=strlen(T);

    for(int i=n-1;~i;i--)
    {
        if(check(S+i,T))
        {
            for(int j=0;T[j];j++) S[i+j]=T[j];
            for(int i=0;S[i];i++) if(S[i]=='?') S[i]='a';
            cout <<S <<endl;
            return ;
        }
    }

    cout <<"UNRESTORABLE" <<endl;
}

//--------------end--------------------

int main()
{
#ifdef yukihana0416
freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
#endif // yukihana0416
    work();
    return 0;
}


Compiler output:
a.cc: In function 'void work()':
a.cc:82:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
   82 |     gets(S);gets(T);
      |     ^~~~
      |     getw
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
 
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)
#define VSORT(v) sort(v.begin(), v.end())
#define DVSORT(v) sort(v.begin(), v.end(),greater<int>())
#define SORT(v, n) sort(v, v+n)
#define DSORT(v,n) sort(v, v+n,greater<int>())
#define vi vector<int>
#define pb push_back
#define P pair<int,int>
 
template <class T> void chmin(T&a,const T&b) { a = min(a,b); }
template <class T> void chmax(T&a,const T&b) { a = max(a,b); }
 
void print(){cout<<endl;}
template <class Head, class... Tail>
void print(Head&& h,Tail&&... t){ 
	if(sizeof...(t)==0)
		cout<<h;
	else
		cout<<h<<' ';
	print(move(t)...);
}
 
const double EPS =1e-9;
const long INF =9223372036854775807;//64bit 9*1e+17
const long MOD =1e+9+7;
#define PI 3.14159265258979
 
int dy[]={0, 0, 1, -1, 1, 1, -1, -1};
int dx[]={1, -1, 0, 0, 1, -1, -1, 1};

int main(void){
  string S,T;
  vector<string> ve;
  cin>>S>>T;
  if(S.length()<T.length()){
     print("UNRESTORABLE");
     return 0;
  }
  RREP(i,S.length()-T.length()+1){
    REP(j,(int)T.length()+1){
      if(j==T.length()){
	string nS;
	REP(r,S.length()){
	  if(r==i){
	    nS+=T;
	    r+=T.length();
	  }else if(S[r]=='?'){
	    nS+='a';
	  }else{
	    nS+=S[r];
	  }
	}
	ve.insort(ns);
      }else if(S[i+j]!=T[j]&&S[i+j]!='?'){
	break;
      }
    }
  }
  if(ve.size()==0)
    print("UNRESTORABLE");
  else{
    VSORT(ve);
    print(ve[0]);
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:62:12: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'insort'; did you mean 'insert'?
   62 |         ve.insort(ns);
      |            ^~~~~~
      |            insert
a.cc:62:19: error: 'ns' was not declared in this scope; did you mean 'nS'?
   62 |         ve.insort(ns);
      |                   ^~
      |                   nS
Language: Java

import java.io.InputStream;
import java.util.Scanner;

/**
 * Created on 2017/10/29.
 */
public class main {
    public static void Main(String args[]) {

        Scanner sc = new Scanner(System.in);
        char[] s = sc.nextLine().toCharArray(); //?,t,c,?,?,?,?
        char[] t = sc.nextLine().toCharArray(); //c,o,d,e,r
        int SLength = s.length;
        int TLengt = t.length;
        outer:
        for (int i = SLength - TLengt; i <= 0; i--) {
            for (int j = 0; j < TLengt; j++) {
                if (s[i + j] != '?' && s[i + j] != t[j]) {
                    continue outer;
                } else {
                    s[i + j] = t[j];
                }
            }

        }
        for (int i = 0; i < SLength; i++) {
            if (s[i] == '?') {
                s[i] = 'a';
            }else{
                System.out.println("UNRESTORABLE");
            }
        }
System.out.println(s);

    }

}


Compiler output:
Main.java:7: error: class main is public, should be declared in a file named main.java
public class main {
       ^
1 error
Language: C

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
char s[55],t[55];
int same(char a,char b)
{
	if (a=='?' || a==b) return 1;
	return 0;
}
int main()
{
	scanf("%s%s",s,t);
	for (int i=0;i+strlen(t)<=strlen(s);++i)
	{
		char c[55];
		memcpy(c,s,sizeof(c));
		int ok=1;
		for (int j=0;j<strlen(t);++j)
		{
			if (!same(s[j+i],t[j]))
			{
				ok=0;
				break;
			}
			c[j+i]=t[j];
		}
		if (ok)
		{
			for (int i=0;i<strlen(s);++i)
			{
				if (c[i]=='?') c[i]='a';
			}
			puts(c)
			exit(0);
		}
	}
	puts("UNRESTORABLE");
}

Compiler output:
main.c: In function 'main':
main.c:33:32: error: expected ';' before 'exit'
   33 |                         puts(c)
      |                                ^
      |                                ;
   34 |                         exit(0);
      |                         ~~~~
Language: Java


import java.util.Scanner;

class Main{
        static char wildcard='?';
        static boolean isWild;
        static boolean matches;
        static int ans=-1;
        static String ansString="UNRESTORABLE";

        public static void main(String[] args){
                Scanner scn=new Scanner(System.in);
                String sPrime=scn.next();
                String T=scn.next();
                int sLength=sPrime.length();
                int TLength=T.length();
                int i,j,k;

                for(i=0;i<sLength-TLength+1;i++){
                        for(j=0,k=i;j<TLength;j++,k++){
                                isWild=sPrime.charAt(k)==wildcard;
                                matches=sPrime.charAt(k)==T.charAt(j);
                                if(!isWild && !matches){
                                        break;
                                }
                                if(j==TLength-1){
                                        ans=i;
                                }
                        }
                }

                if(ans!=-1){
                        ansString="";
                        for(i=0;i<ans;i++){
                                isWild=sPrime.charAt(i)==wildcard;
                                if(isWild){
                                        ansString+="a";
                                }else{
                                        ansString+=sPrime.charAt(i);
                                }
                        }
                        ansString+=T;
                        for(i=ans+TLength;i<SLength;i++){
                                isWild=sPrime.charAt(i)==wildcard;
                                if(isWild){
                                        ansString+="a";
                                }else{
                                        ansString+=sPrime.charAt(i);
                                }
                        }
                        System.out.println(ansString);
                }else{
                        System.out.println(ansString);
                }
        }
}

Compiler output:
Main.java:43: error: cannot find symbol
                        for(i=ans+TLength;i<SLength;i++){
                                            ^
  symbol:   variable SLength
  location: class Main
1 error
Language: C++

#include<iostream>
#include<string>
using namespace std;
string a,b,c,ans;
bool ok(int s)
{
	for(int i=s;i<s+b.length();i++)
	{
		if(a[i]!='?'&&a[i]!=b[i-s])
			return false;
	}
	return true;
}
int main()
{
	int t=0;
	cin>>a>>b;
	int la=a.length(),lb=b.length();
	for(int i=0,i<=la-lb;i++)
	{
		string c=a;
		if(ok(i))
		{
			c.replace(i,lb,b);
			if(t==0)
				ans=c;
			else
				ans=(ans<c?ans:c);
		}
	}
	for(int i=0;i<=ans.length();i++)
	{
		if(ans[i]=='?')
			cout<<'a';
		else
			cout<<ans[i];
	}	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:22: error: expected ';' before '<=' token
   19 |         for(int i=0,i<=la-lb;i++)
      |                      ^~
      |                      ;
a.cc:19:22: error: expected primary-expression before '<=' token
   19 |         for(int i=0,i<=la-lb;i++)
      |                      ^~
Language: C++

#include <bits/stdc++.h>

using namespace std;

string s,t,x;

int main (){
    cin >> s >> t;
    char c = 'a';
    for (int i = 0; i <= s.size() - 1; i++)
        if (s[i] == '?')
        {
            x[i] = c;
            c++;
        }
        else if (s[i] != t[0]) x[i] = s[i]
                else for (int j = 1; j <= t.size() - 1; j++)
                        if (s[i + j] == '?')
                        {
                            x[i + j] = t[j];
                            x[i] = t[0];
                            break;
                        }
                        else
                        {
                            cout << "UNRESTORABLE";
                            break;
                        }
    cout << x;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:43: error: expected ';' before 'else'
   16 |         else if (s[i] != t[0]) x[i] = s[i]
      |                                           ^
      |                                           ;
   17 |                 else for (int j = 1; j <= t.size() - 1; j++)
      |                 ~~~~                       
a.cc:17:38: error: 'j' was not declared in this scope
   17 |                 else for (int j = 1; j <= t.size() - 1; j++)
      |                                      ^
a.cc:24:25: error: 'else' without a previous 'if'
   24 |                         else
      |                         ^~~~
a.cc:27:29: error: break statement not within loop or switch
   27 |                             break;
      |                             ^~~~~
Language: C++

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

#define rep(i, n) for(int i = 0;i < n;i++)
#define repr(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)

int main(){
  string s,t,ss,sss;
  bool fc=false;
  cin>>s>>t;
  int slen=s.size();
  int tlen=t.size();
  int ct=slen-tlen+1;
  if(cn<=0){
    cout<<"UNRESTORABLE"<<endl;
    return 0;
  }
    rep(i,ct){
    ss=s;
    rep(j,tlen){
      if(ss[i+j]=='?'){
        ss[i+j]=t[j];
      }
      if(ss[i+j]!=t[j]){
        fc=false;
        break;
      }else{
        fc=true;
      }

    }
    if(fc){sss=ss;
    break;}
  }
  if(fc){
    rep(i,slen){
      if(sss[i]=='?'){
        sss[i]='a';
      }
    }
    cout<<sss<<endl;
  }else{
    cout<<"UNRESTORABLE"<<endl;
  }

return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:6: error: 'cn' was not declared in this scope; did you mean 'ct'?
   15 |   if(cn<=0){
      |      ^~
      |      ct
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:28:14: error: 'a' was not declared in this scope
   28 |             }a
      |              ^
Language: C++

#include <iostream>
#include <string.h>
using namespace std;
int main(int argc, char* argv[])
{
	char  S[51],T[51];
	cin>>S;
	cin>>T;
	int sLen=strlen(S);
	
	int tLen=strlen(T);
	int s;
	bool bFind=false;	
	/*for(s=0;s<sLen;s++){
		if (S[s]=='?'){
			bFind=true;
		}
	}
	if (!bFind){
		if (strstr(S,T)){
			cout<<S<<endl;
		}else{
			cout<<"UNRESTORABLE"<<endl;
		}
		return 0;
	}
	bFind=false;*/
	int t=tLen-1;
	for (s=sLen-1;s>=0;s--){
		if (S[s]=='?'){
			t--;
			if (t<0){
				memcpy(S+s,T,tLen);
				bFind=true;
				t=tLen-1;
			}
			if (s<t){
				break;
			}
			continue;
		}
		if (S[s]==T[t]){
			t--;
			if (t<0){
				memcpy(S+s,T,tLen);
				bFind=true;
				t=tLen-1;
				if (s<t){
					break;
				}
			}
			continue;
		}
		s+=tLen-1-t;
		t=tLen-1;
		if (s<t){
			break;
		}
	}
	if (!bFind){
		cout<<"UNRESTORABLE"<<endl;
		return 0;
	}
	for (s=0;s<sLen;s++){
		if (S[s]=='?'){
			S[s]='a';
		}
	}
	cout<<S<<endl;
	return 0;
}
/*
//Date:2017.10.28
//Contest:076
//Question:B
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
	int N,K;
	cin>>N;
	cin>>K;
	int i;
	int x=1;
	int Sum;
	for (i=0;i<N;i++){
		if (x*2<x+K){
			x*=2;
		}else{
			x+=K;
		}
		Sum=x;
	}
	cout<<Sum<<endl;
	return 0;
}

Compiler output:
a.cc:72:1: error: unterminated comment
   72 | /*
      | ^
Language: C++

#include <iostream>

using namespace std;

int main()
{
    string s,t;

    cin >> s;
    cin >> t;

    bool bug_flag = false;

    for (int a = 0; a < s.size() - t.size() + 1; ++a) {
        string buf = s.substr(a,t.size());

        bool can_replace = false;
        for(auto dbuf : buf){
            can_replace += dbuf == '?' || dbuf == t[index];
        }
        if(can_replace){
            s.replace(a,t.size(),t);
            bug_flag = true;
        }
    }

    if(s.size() < t.size()){
         cout << "UNRESTORABLE" << endl;
    }else if(bug_flag){
        for(auto& ds : s){
            if(ds == '?'){
                ds = 'a';
            }
        }
        cout << s << endl;
    }else{
        cout << "UNRESTORABLE" << endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:53: error: 'index' was not declared in this scope
   19 |             can_replace += dbuf == '?' || dbuf == t[index];
      |                                                     ^~~~~
Language: Java

import static java.lang.System.out;
import java.util.Scanner;
import java.util.Arrays;
public class Main{
   public static void main(String[] args){
      Scanner sc = new Scanner(System.in); 
      char[] str = sc.next().toCharArray();
      String aaa = sc.next();
      char[] target = aaa.toCharArray();
      boolean check = false;
      StringBuilder result = new StringBuilder(); 
      

   try{
      for(int i=0;i<str.length;i++){
         int k = i+1;
         if(str[i] == target[0]){
            for(int j = 1;j<target.length;j++){
               if(str[k]=='?' || str[k] == target[]){
                  if(j==target.length-2){
                     result.append(aaa);
                     check = true;
                     i += target.length;
                  }
                  k++;
               }else{
                  result.append(str[i]);
                  break;
               }
            }
         }else if(str[i]== '?'){
               result.append('a');
         }else{
            result.append(str[i]);
         }
      }
   }catch(ArrayIndexOutOfBoundsException e){

   }
   if(check){
      out.println(result);
   }else{
      out.println("UNRESTORABLE");
   }
      
   } 
}

Compiler output:
Main.java:19: error: '.class' expected
               if(str[k]=='?' || str[k] == target[]){
                                                   ^
1 error
Language: C++

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

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string st, t;
  cin >> st >> t;
  int slen = st.length();
  int tlen = t.length();
  string ans(50, 'z'), ansb(50, 'z');
  for(int i = 0; i <= slen - tlen; i++) {
    string s = st;
    bool fla = true;
    for (int j = 0; j < tlen && fla; j++) {
      if (s[i + j] == t[j]) {
        fla = true;
      }
      else if (s[i + j] != '?' && s[i + j] != t[j]) fla = false;
      else if (s[i + j] == '?') {
        fla = true;
        s[i + j] = t[j];
      }
    }
    if (fla) {
      rep(k, slen) {
        if (s[k] == '?') s[k] = 'a';
      }
      ans = min(ans, s);
    }
  }
  if(ans != ansb) cout << ans << endl;
  else cout << UNRESTORABLE << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:16: error: 'UNRESTORABLE' was not declared in this scope
   34 |   else cout << UNRESTORABLE << endl;
      |                ^~~~~~~~~~~~
Language: C++

#include<cstdio>
#include<cmath>
#include<cstring>
#include<cstdlib>
int main(){
	char s1[55],t[55],s[110];
	int count[55],number[55];
	int s1_len,t_len,i,j,k,n;
	gets(s1);
	gets(t);
	s1_len=strlen(s1);
	t_len=strlen(t);
	for (i=1,k=0,j=0,n=0;i<s1_len;i++){
		if (s1[i-1]==t[0]&&s1[i]=='?'){
			number[j]=i;
			k++;
			j++;
		}
		else if (k&&s1[i]=='?') k++;
		if (k&&s1[i]!='?'||i==s1_len-1) {
			count[n]=k;
			k=0;
			n++;
		}
	}
	k=1;
	for (i=0;i<n;n++){
		if (count[i]>=t_len-1){
			for(j=0;j<s1_len+t_len;j++){
				if (j<number[i]&&s1[j]!='?')
					s[j]=s1[j];
				if (j<number[i]&&s1[j]=='?')
					s[j]='a';
				if (j>=number[i]&&k<t_len&&j<number[i]+t_len){
					s[j]=t[k];
					k++;
				}
				if (j>number[i]+t_len&&s1[j]=='?')
					s[j]='a';
				if (j>number[i]+t_len&&s1[j]!='?')
					s[j]=s1[j-t_len];
				if (j==s1_len+t_len)
					s[j]='\0';
			}
			break;
		}
	}
	if (i>=n) printf ("UNRESTORABLE\n");
	else 
		puts(s);
	return 0;
}

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

#include<cstdio>
#include<cmath>
#include<cstring>
#include<cstdlib>
int main(){
	char s1[55],t[55],s[110];
	int count[55],number[55];
	int s1_len,t_len,i,j,k,n;
	gets(s1);
	gets(t);
	s1_len=strlen(s1);
	t_len=strlen(t);
	for (i=1,k=0,j=0,n=0;i<s1_len;i++){
		if (s1[i-1]==t[0]&&s1[i]=='?'){
			number[j]=i;
			k++;
			j++;
		}
		else if (k&&s1[i]=='?') k++;
		if (k&&s1[i]!='?'||i==s1_len-1) {
			count[n]=k;
			k=0;
			n++;
		}
	}
	k=1;
	for (i=0;i<n;n++){
		if (count[i]>=t_len-1){
			for(j=0;j<s1_len+t_len;j++){
				if (j<number[i]&&s1[j]!='?')
					s[j]=s1[j];
				if (j<number[i]&&s1[j]=='?')
					s[j]='a';
				if (j>=number[i]&&k<t_len&&j<number[i]+t_len){
					s[j]=t[k];
					k++;
				}
				if (j>number[i]+t_len&&s1[j]=='?')
					s[j]='a';
				if (j>number[i]+t_len&&s1[j]!='?')
					s[j]=s1[j-t_len];
				if (j==s1_len+t_len)
					s[j]='\0';
			}
			break;
		}
	}
	if (i>=n) printf ("UNRESTORABLE\n");
	else {
		puts(s);
		printf ("\n");
	}
	return 0;
}

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

#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main()
{
char S[50],T[50];
 int i,j,p,q;
 int flag=0;
 gets(S);
 p=strlen(S);
 cin.get();
 gets(T);
 q=strlen(T);
 for(i=0;i<=p-q;i++)
{
 if(S[i]==T[0])
 if(p-i+1>=q)
 for(j=i+1;j<i+q;j++)
  if(S[j]!='?')break;
  if(j==i+q)
   {
   flag=1;
    for(j=i+1;j<i+q;j++)
    S[j]=T[j-i];
   }
   }
   for(i=0;i<p;i++)
   if(S[i]=='?')S[i]='A';
   if(flag)puts(S);
   else cout<<"UNRESTORABLE";
   return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:2: error: 'gets' was not declared in this scope; did you mean 'getw'?
   10 |  gets(S);
      |  ^~~~
      |  getw
Language: C++

#include<iostream>
#include<cstring>
using namespace std;
int main()
{
 char S[50],T[50];
 int i,j,p,q;
 int flag=0;
 gets(S);
 p=strlen(S);
 cin.get();
 gets(T);
 q=strlen(T);
 for(i=0;i<=p-q;i++)
{
if(S[i]==T[0])
 if(p-i+1>=q)
 for(j=i+1;j<i+q;j++)
  if(S[j]!='?')break;
if(j==i+q)
{
 flag=1;
 for(j=i+1;j<i+q;j++)
  S[j]=T[j-i];
}
}
 for(i=0;i<p;i++)
 if(S[i]=='?')S[i]='A';
if(flag)puts(S);
else cout<<"UNRESTORABLE";
return 0;
}

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

def compair(x,y):
    print("comp",x,y)
    if len(x)!=len(y):
        return False

    for i in range(len(x)):
        if x[i]!=y[i] and x[i]!='?':
            return False

    return True

ss=input()

T=input()

flg=False
for i in reversed(range(len(ss)-1)):
    if compair(ss[i:(i+len(T) )],T):
        flg=True
        break


ss=list(ss)
for j in range(i):
    if ss[j]=='?':
        ss[j]='a'

if flg:
    print("".join(ss))
else:
    print("UNRESTORABLE")


Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def compair(x,y):
      | ^~~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main()
{
    string S, T, ans = "";
    cin >> S >> T;
    string tmpS;

    string srch;
    bool endF = false;
    for (int i = 0; i < T.size(); i++)
    {
        srch = "";
        if (i > 0)
        {
            for (int j = 0; j < i; j++)
            {
                srch += "?";
            }
        }
        srch += T[i];

        int pos = (int)S.find(srch, i);
        if (pos != -1)
        {
            tmpS = S;
            bool flag = true;
            for (int j = 1; j <= T.size() - srch.size(); j++)
            {
                if (pos + j < S.size())
                {
                    if (S[pos + j] != '?' && S[pos + j] != T[i + j])
                    {
                        flag = false;
                        break;
                    }
                    else
                    {
                        tmpS[pos + j] = T[i + j];
                    }
                }
                else
                {
                    if (srch.size() = > 2)
                    {
                        for (int k = 1; k <= srch.size() - 1; k++)
                        {
                            tmpS[pos - k] = srch[srch.size() - 1 - k];
                        }
                    }
                    flag = false;
                    break;
                }
            }
            if (flag)
            {
                endF = true;
                break;
            }
        }
    }

    if (endF)
    {
        replace(tmpS.begin(), tmpS.end(), '?', 'a');
        cout << tmpS << endl;
    }
    else
    {
        cout << "UNRESTORABLE" << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:39: error: expected primary-expression before '>' token
   48 |                     if (srch.size() = > 2)
      |                                       ^
Language: C++

#include <stdio.h>
int main()
{
    printf("UNRESTORABLE');
    return 0;
}

Compiler output:
a.cc:4:12: warning: missing terminating " character
    4 |     printf("UNRESTORABLE');
      |            ^
a.cc:4:12: error: missing terminating " character
    4 |     printf("UNRESTORABLE');
      |            ^~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:5: error: expected primary-expression before 'return'
    5 |     return 0;
      |     ^~~~~~
Language: C++

#include <stdio.h>
int main()
{
    printf("UNRESTORABLE');
}

Compiler output:
a.cc:4:12: warning: missing terminating " character
    4 |     printf("UNRESTORABLE');
      |            ^
a.cc:4:12: error: missing terminating " character
    4 |     printf("UNRESTORABLE');
      |            ^~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:1: error: expected primary-expression before '}' token
    5 | }
      | ^
Language: C++

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

int main()
{
	char a[100] = { 0 };
	char b[51] = { 0 };
	char c[100] = { 0 };
	scanf("%s", a);
	scanf("%s", b);
	int sa = strlen(a);
	int sb = strlen(b);
	bool flag = false;
	bool right = false;
	int f = 0;
	for (int i = 0;i < sa;i++)
	{
		if (a[i] == '?')
		{
			count += 1;
			c[i] = 'a';
		}
		else
			c[i] = a[i];

	}
	for (int i = 0;i <= sa-sb;i++)
	{
		for (int j = i;j <= i+sb;j++)
		{
			if (a[j] == '?' || a[j] == b[f])
			{
				flag = true;
				f += 1;
			}
			else
			{
				f = 0;
				flag = false;
				break;
			}
		}
		f = 0;
		if (flag&&!right)
		{
			for (int j = i;j < i + sb;j++)
			{
				c[j] = b[f];
				f++;
			}
			right = true;
		}
	}
	if (right)
		printf("%s\n", c);
	else
		printf("UNRESTORABLE\n");
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:25: error: 'count' was not declared in this scope
   20 |                         count += 1;
      |                         ^~~~~
Language: Java

import java.util.Scanner;

public class Main {

    public static void main(String[] argv){

        Scanner scan = new Scanner(System.in);

        String ss = scan.nextLine();
        String t = scan.nextLine();

        StringBuilder s = new StringBuilder(ss);

        boolean already = false;

    for (int i = s.length() - 1 - t.length(); i >= 0 && !already; i--) {


        boolean possible = true;

        for (int j = 0; j < t.length() && possible; j++) {

            if (s.charAt(i + j) != t.charAt(j) && s.charAt(i + j) != '?') {
                possible = false;
            }
        }

        if (possible) {
            for (int j = 0; j < t.length(); j++) {
                s.setCharAt(i + j, t.charAt(j));
            }
            already = true;
        }

    }


    // ? -> a
    if (already) {
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '?') {
                s.setCharAt(i, 'a');
            }
        }
        System.out.println(s);
    } else {
        System.out.println("UNRESTORABLE");
    }
}


    }

}


Compiler output:
Main.java:54: error: class, interface, enum, or record expected
}
^
1 error
Language: C

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

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

  if (s.length() < t.length())
  {
    cout << "UNRESTORABLE";
    return 0;
  }

  string ans = s;
  for (int i = 0; i < ans.length(); i++)
  {
    if (ans[i] == '?') ans[i] = 'a';
  }

  int i, j;
  for (i = 0; i < s.length(); i++)
  {
    for (j = 0; j < t.length(); j++)
    {
      if (i + j >= s.length())
      {
        cout << "UNRESTORABLE";
        return 0;
      }
      if (s[i + j] != t[j])
      {
        if (s[i + j] == '?')
        {
          continue;
        }
        else
        {
          i += j;
          break;
        }
      }
    }
    if (j == t.length())
    {
      for (j = 0; j < t.length(); j++)
      {
        ans[i + j] = t[j];
      }
      break;
    }
  }

  cout << ans;
  return 0;
}


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

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

int main()
{
	char a[100] = { 0 };
	char b[51] = { 0 };
	char c[100] = { 0 };
	scanf("%s", a);
	scanf("%s", b);
	int sa = strlen(a);
	int sb = strlen(b);
	bool flag = false;
	bool right = false;
	int count = 0;
	int f = 0;
	for (int i = 0;i < sa;i++)
	{
		if (a[i] == '?')
		{
			count += 1;
			c[i] = 'a';
		}
		else
			c[i] = a[i];

	}
	for (int i = 0;i <= sa-sb;i++)
	{
		for (int j = i;j < i+sb;j++)
		{
			if (a[j] == '?' || a[j] == b[f])
			{
				flag = true;
				f += 1;
			}
			else
			{
				f = 0;
				flag = false;
				break;
			}
		}
		f = 0;
		if (flag&&!right)
		{
			for (int j = i;j < i + sb;j++)
			{
				c[j] = b[f];
				f++;
			}
			right = true;
		}
	}
	if (right&&count!=0)
		printf("%s\n", c);
	else
		printf("UNRESTORABLE\n");
	return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
char a[1111] , b[1111] ,c[1111] , an[1111];
int f[1111];
int x[1111];
int main ()   //  KMP2
{
    while (~scanf("%s",a))
    {


        scanf("%s",b);
        int n = strlen(a), m = strlen(b);
        int i = 0, j = -1;
        f[0] = -1;
        while (b[i] != '\0')
        {
            if (j==-1 || b[i]==b[j])
            {
                i++;
                j++;
                f[i] = j;
            }
            else j = f[j];
        }

        i = 0, j = 0;
        int ans = 0 , t;
        int k = 0;
        while (i < n)
        {
            if (j==-1 || a[i]==b[j] || a[i]=='?')
            {
                i++;
                j++;
            }
            else  j = f[j];
            if (j == m)
            {
                t = i - j;
                x[k++] = t;
                ans ++;
                j = f[j];
            }
        }

        if (ans == 0)  puts("UNRESTORABLE");
        else {
            strcpy(an,a);
            for (int i=x[0]; i<x[0]+m; i++)  an[i] = b[i-x[0]];
            for (int i=0; i<n; i++)
                if (an[i] == '?')  an[i] = 'a';


            for (int j=1; j<k; j++){
                strcpy(c,a);
                for (int i=x[j]; i<x[j]+m; i++)  c[i] = b[i-x[j]];
                for (int i=0; i<n; i++)
                    if (c[i] == '?')  c[i] = 'a';
                if (strcmp(c,an) < 0)  strcpy(an,c);
            }
            puts(an);
        }
        puts("fack you!!!!!!!")
    }
    return 0 ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:65:32: error: expected ';' before '}' token
   65 |         puts("fack you!!!!!!!")
      |                                ^
      |                                ;
   66 |     }
      |     ~
Language: C++


#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>
#define base 10000
#define maxn 100
using namespace std;
char a[57],b[57];
int main()
{
    gets(a);
    gets(b);
    int p;
    int len1=strlen(a);///长
    int len2=strlen(b);///短
    int flag=0;  int kaishi=0;  int k=0;
    for(int i=0,j=0;i<len1&&j<len2;)
    {
        if(b[j]==a[i])
        {
            i++;
            j++;
            kaishi=1;
            k++;
        }
       else if(a[i]!=b[j]&&kaishi==0)
        {
           i++;
        }
        else if(a[i]!=b[j]&&a[i]=='?'&&kaishi==1)
        {

            i++;
            j++;
            k++;
        }
        else if(a[i]!=b[j]&&a[i]!='?'&&kaishi==1)
        {
            i=0;
            j=j-i+1;
            k=0;
            kaishi=0;
        }
        if(k==len2)
        {
                 p=i-len2;
                flag=1;
                break;
        }
    }

    if(flag)
    {
        for(int i=0;i<len1;i++)
        {
            if(i==p)
            {
                for(int k=0;k<len2;k++)
                {
                    a[k+i]=b[k];
                }
                break;
            }
        }
        for(int i=0;i<len1;i++)
            if(a[i]=='?')  a[i]='a';
        printf("%s",a);
    }
    if(!flag) puts("UNRESTORABLE");
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
   22 |     gets(a);
      |     ^~~~
      |     getw
Language: C++

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

int main()
{
	char a[100] = { 0 };
	char b[51] = { 0 };
	char c[100] = { 0 };
	scanf("%s", a);
	scanf("%s", b);
	int sa = strlen(a);
	int sb = strlen(b);
	bool flag = false;
	bool right = false;
	int f = 0;
	for (int i = 0;i < sa;i++)
	{
		if (a[i] == '?')
			c[i] = 'a';
		else
			c[i] = a[i];

	}
	for (int i = 0;i <= sa-sb;i++)
	{
		for (int j = i;j < i+sb;j++)
		{
			if (a[j] == '?' || a[j] == b[f])
			{
				flag = true;
				f += 1;
			}
			else
			{
				f = 0;
				flag = false;
				break;
			}
		}
		f = 0;
		if (flag)
		{
			for (int j = i;j < i + sb;j++)
			{
				c[j] = b[f];
				f++;
			}
			right = true;
		}
	}
	if (right)
		printf("%s\n", c);
	else
		printf("UNRESTORABLE\n");
	return 0;
}


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

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

int main()
{
	char a[51] = { 0 };
	char b[51] = { 0 };
	char c[51] = { 0 };
	scanf("%s", a);
	scanf("%s", b);
	int sa = strlen(a);
	int sb = strlen(b);
	bool flag = false;
	bool right = false;
	int f = 0;
	for (int i = 0;i < sa;i++)
	{
		if (a[i] == '?')
			c[i] = 'a';
		else
			c[i] = a[i];

	}
	for (int i = 0;i <= sa-sb;i++)
	{
		for (int j = i;j < i+sb;j++)
		{
			if (a[j] == '?' || a[j] == b[f])
			{
				flag = true;
				f += 1;
			}
			else
			{
				f = 0;
				flag = false;
				break;
			}
		}
		f = 0;
		if (flag)
		{
			for (int j = i;j < i + sb;j++)
			{
				c[j] = b[f];
				f++;
			}
			right = true;
		}
	}
	if (right)
		printf("%s\n", c);
	else
		printf("UNRESTORABLE\n");
	return 0;
}



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


#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>
#define base 10000
#define maxn 100
using namespace std;
char a[57],b[57];
int main()
{
    gets(a);
    gets(b);
    int len1=strlen(a);///长
    int len2=strlen(b);///短
    int flag=0;  int kaishi=0;  int k=0;
    for(int i=0,j=0;i<len1&&j<len2;)
    {
        if(b[j]==a[i])
        {
            i++;
            j++;
            kaishi=1;
            k++;
        }
       else if(a[i]!=b[j]&&kaishi==0)
        {
           i++;
        }
        else if(a[i]!=b[j]&&a[i]=='?'&&kaishi==1)
        {
            a[i]=b[j];
            i++;
            j++;
            k++;
        }
        else if(a[i]!=b[j]&&a[i]!='?'&&kaishi==1)
        {
            i=0;
            j=j-i+1;
            k=0;
            kaishi=0;
        }
        if(k==len2)
        {
                flag=1;
                break;
        }
    }

    if(flag)
    {
        for(int i=0;i<len1;i++)
        {
            if(a[i]=='?')  a[i]='a';
        }
        printf("%s",a);
    }
    if(!flag) puts("UNRESTORABLE");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
   22 |     gets(a);
      |     ^~~~
      |     getw
Language: C++

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

string judge(string& s, string& t) {
    for(int i = 0; i < s.size() - t.size() + 1; i++) {
        int match_count = 0;
        for(int j = 0; j < t.size(); j++) {
            if(t[j] == s[i+j] or s[i+j] == '?') {
                match_count++;
            }
        }
        if(match_count == t.size()) {
            s.replace(i,t.size(),t);
            replace(s.begin(), s.end(), '?', 'a');            
            return s;
        }
    }
    return "UNRESTORABLE";
}

int main() {
    string s,t;
    cin >> s >> t;
    string ans = judge(s, t);
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'std::string judge(std::string&, std::string&)':
a.cc:16:13: error: 'replace' was not declared in this scope
   16 |             replace(s.begin(), s.end(), '?', 'a');
      |             ^~~~~~~
Language: C++


#include "list.h"
#include <string>
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>


int main() {
	std::string S, T;
	std::cin >> S;
	std::cin >> T;
	std::vector<std::string> candidates;

	for (unsigned int i = 0; i < S.length() - T.length() + 1; i++) {
		std::string new_S = S;
		bool flag = true;
		for (unsigned int j = 0; j < T.length(); j++) {
			if (S[i + j] == T[j] || S[i + j] == '?') {
				new_S[i + j] = T[j];
			}
			else {
				flag = false;
				break;
			}
		}
		if (flag == true) {
			for (unsigned int i = 0; i < new_S.length(); i++) {
				if (new_S[i] == '?') {
					new_S[i] = 'a';
				}
			}
			candidates.push_back(new_S);
		}
	}

	if (candidates.size() > 0){
		std::sort(candidates.begin(), candidates.end());
		std::cout << candidates.front() << "\n";
	}
	else {
		std::cout << "UNRESTORABLE" << "\n";
	}

}

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

#include "stdafx.h"
#include "list.h"
#include <string>
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>


int main() {
	std::string S, T;
	std::cin >> S;
	std::cin >> T;
	std::vector<std::string> candidates;

	for (unsigned int i = 0; i < S.length() - T.length() + 1; i++) {
		std::string new_S = S;
		bool flag = true;
		for (unsigned int j = 0; j < T.length(); j++) {
			if (S[i + j] == T[j] || S[i + j] == '?') {
				new_S[i + j] = T[j];
			}
			else {
				flag = false;
				break;
			}
		}
		if (flag == true) {
			for (unsigned int i = 0; i < new_S.length(); i++) {
				if (new_S[i] == '?') {
					new_S[i] = 'a';
				}
			}
			candidates.push_back(new_S);
		}
	}

	if (candidates.size() > 0){
		std::sort(candidates.begin(), candidates.end());
		std::cout << candidates.front() << "\n";
	}
	else {
		std::cout << "UNRESTORABLE" << "\n";
	}

}

Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
bool match(string a, string b, int c, int d)
{
for (int i=c; i<c+d; i++)
{
if (a[i]==b[i - c] || a[i]=='?') continue;
else return false;
}
return true;
}

int main()
{
string s, t;
string ans;
cin >> s >> t;
for (int i=s.size() - t.size() - 1; i>=0; i--)
{
if (match(s, t, i, t.size()))
{
ans = s;
for(int j=i; j<i+t.size(); j++) ans[j] = t[j - i];
}
}

if(ans.empty())
{
cout << "UNRESTORABLE" << endl;
}
else 
{
replace(ans->begin(), ans->end(), '?', 'a');
cout << ans << endl;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:12: error: base operand of '->' has non-pointer type 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   34 | replace(ans->begin(), ans->end(), '?', 'a');
      |            ^~
a.cc:34:26: error: base operand of '->' has non-pointer type 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   34 | replace(ans->begin(), ans->end(), '?', 'a');
      |                          ^~
Language: C++

#include <iostream>
#include <string>

#define NONE "UNRESTORABLE"

using namespace std;

int main()
{
    string S, S_, T;

    cin >> S_ >> T;

    int SLen = S_.length();

    int lim = S_.length() - T.length();
    int TLen = T.length();
    S = NONE;
    for (int i = 0; i <= lim; i++)
    {
        string s = S_;
        s.replace(i, TLen, T);
        if (s.find(T) != string::npos)
        {
            bool isVlaid = true;
            for (int j = 0; j < SLen; j++)
            {
                if (S_[j] != '?' && S_[j] != s[j])
                {
                    isVlaid = false;
                    break;
                }
            }

            if (isVlaid == true && (S == NONE || s < S))
            {
                S = s;
                cout << S << endl;
            }
        }
    }

    replace(S.begin(), S.end(), '?', 'a');

    cout << S << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:5: error: 'replace' was not declared in this scope
   43 |     replace(S.begin(), S.end(), '?', 'a');
      |     ^~~~~~~
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
string s; string t; string res;
res = "UNRESTORABLE";
cin>>s>>t;
int m; bool b;
m = -1
b = true;
for(int i=0;i<=s.length()-t.length();i++){
for(int j = 0;j < t.length(); j++){
if(s[i+j] != t[j] && s[i+j] != '?') b == false;
}
if(b) m = i;
}
if(m==-1)cout<<res<<endl;
if(m != -1){
for(int j = 0;j < t.length(); j++) s[m+j]=t[j];
for(int i=0;i<s.length();i++){
if(s[i]=='?')s[i]='a';
}
cout<<s<<endl;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: expected ';' before 'b'
    9 | m = -1
      |       ^
      |       ;
   10 | b = true;
      | ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
bool match(string a, string b, int c, int d)
{
for (int i=c; i<c+d; i++)
{
if (a[i]==b[i - c] || a[i]=='?') continue;
else return false;
}
return true;
}

int main()
{
string s, t;
set<string> kouho;
cin >> s >> t;
for (int i=0; i<s.size() - t.size(); i++)
{
if (match(s, t, i, t.size()))
{
string temp = s;
for(int j=i; j<i+t.size(); j++) temp[j] = t[j - i];
kouho.insert(temp);
}
}

if(kouho.empty())
{
cout << "UNRESTORABLE" << endl;
return 0;
}
else
{
replace(kouho.begin()->begin(), kouho.begin()->end(), '?', 'a');
}
cout << *(kouho.begin()) << endl;
return 0;
}

Compiler output:
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::replace(_FIter, _FIter, const _Tp&, const _Tp&) [with _FIter = __gnu_cxx::__normal_iterator<const char*, __cxx11::basic_string<char> >; _Tp = char]':
a.cc:36:8:   required from here
   36 | replace(kouho.begin()->begin(), kouho.begin()->end(), '?', 'a');
      | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4294:20: error: assignment of read-only location '__first.__gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> >::operator*()'
 4294 |           *__first = __new_value;
      |           ~~~~~~~~~^~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
bool match(string a, string b, int c, int d)
{
for (int i=c; i<c+d; i++)
{
if (a[i]==b[i - c] || a[i]=='?') continue;
else return false;
}
return true;
}

int main()
{
string s, t;
set<string> kouho;
cin >> s >> t;
for (int i=0; i<s.size() - t.size(); i++)
{
if (match(s, t, i, t.size()))
{
string temp = s;
for(int j=i; j<i+t.size(); j++) temp[j] = t[j - i];
kouho.insert(temp);
}
}

if(kouho.empty())
{
cout << "UNRESTORABLE" << endl;
return 0;
}
else
{
replace(kouho.begin()->begin(), kouho.begn()->end(), '?', 'a');
}
cout << *(kouho.begin()) << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:39: error: 'class std::set<std::__cxx11::basic_string<char> >' has no member named 'begn'; did you mean 'begin'?
   36 | replace(kouho.begin()->begin(), kouho.begn()->end(), '?', 'a');
      |                                       ^~~~
      |                                       begin
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
bool match(string a, string b, int c, int d)
{
for (int i=c; i<c+d; i++)
{
if (a[i]==b[i - c] || a[i]=='?') continue;
else return false;
}
return true;
}

int main()
{
string s, t;
set<string> kouho;
cin >> s >> t;
for (int i=0; i<s.size() - t.size(); i++)
{
if (match(s, t, i, t.size()))
{
string temp = s;
for(int j=i; j<i+t.size(); j++) temp[j] = t[j - i];
kouho.insert(temp);
}
}

if(kouho.empty())
{
cout << "UNRESTORABLE" << endl;
return 0;
}
else
{
for (int i = 0; i < kouho.size(); i++)
{
replace(kouho[i].begin(), kouho[i].end(), '?', 'a');
}
}
cout << kouho[0] << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:14: error: no match for 'operator[]' (operand types are 'std::set<std::__cxx11::basic_string<char> >' and 'int')
   38 | replace(kouho[i].begin(), kouho[i].end(), '?', 'a');
      |              ^
a.cc:38:32: error: no match for 'operator[]' (operand types are 'std::set<std::__cxx11::basic_string<char> >' and 'int')
   38 | replace(kouho[i].begin(), kouho[i].end(), '?', 'a');
      |                                ^
a.cc:41:14: error: no match for 'operator[]' (operand types are 'std::set<std::__cxx11::basic_string<char> >' and 'int')
   41 | cout << kouho[0] << endl;
      |              ^