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

#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
using ll=long long;
using vec=vector<ll>;
using Graph = vector<vector<ll>>;
#define loop(i,n) for(ll i=0;i<n;i++)
#define Loop(i, m, n) for(ll i = m;i < n;i++)
#define pool(i,n) for(ll i=n;i>=0;i--)
#define Pool(i, m, n) for(ll i=n;i>=m;i--)
#define MAX 999999999ll
#define MIN -999999999ll
#define setbit bitset<8>
#define flagcount __builtin_popcount
#define flag(x) (1<<x)
#define flagadd(bit,x) bit|=flag(x)
#define flagpop(bit,x) bit&=~flag(x) 
#define flagon(bit,i) bit&flag(i)
#define flagoff(bit,i) !(bit & (1<<i))
#define all(v) v.begin(),v.end()
#define low2way(v,x) lower_bound(all(v),x)
#define high2way(v,x) upper_bound(all(v),x)
#define count2way(v,x) high2way(v,x)-low2way(v,x)
#define lower(v,x) low2way(v,x)-v.begin() //1番左が0、もし見つから無いならｎを出力
#define higher(v,x) high2way(v,x)-v.begin()-1 //1番左が0、もし見つからないならn-1を出力（注意）
#define putout(x) cout<<x<<endl
#define gcd(x,y) __gcd(x,y) 
#define Gput(a,b) G[a].push_back(b)
ll lcm(ll x,ll y){
  ll z=gcd(x,y);
  return x*(y/z);
}
ll ctoi(char c){
	if(c>='0'&&c<='9'){
		return c-'0';
	}
	return 0;
}
vector<bool> seen;
void dfs(const Graph &G,ll v){
    seen[v]=true;
    for(auto nextv:G[v]){ 
        if(seen[nextv])continue;
        dfs(G,nextv);
    }
}
int main() {
  cout << fixed << setprecision(16);
  string s,t;
  cin>>s>>t;
  x=s.size();
  y=t.size();
  bool check=true;
  if(x<y){
  putout("UNRESTORABLE");
  }
  else{
  pool(i,x-y){
      loop(j,y){
       check=true;
      if(s[i+j]!='?'&&t[j]!=s[j+i]){
      check= false;
      }
      }
      if(check){
           loop(j,y){
       check=true;
      if(s[i+j]!=t[j]){
      s[i+j]=t[j];
      }
      }
      loop(k,x){
      if(s[k]=='?'){
      s[k]='a';
      }
      }
      putout(s);
      break;
      }
      
      
      
  }
  if(!(check)){
  putout("UNRESTORABLE");
  }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:51:3: error: 'x' was not declared in this scope
   51 |   x=s.size();
      |   ^
a.cc:52:3: error: 'y' was not declared in this scope
   52 |   y=t.size();
      |   ^
Language: C++

/*Function Template*/
#include<bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
#define rep(i, n) for(long long int i = 0; i < (n); i++)


int Len(int n) {
  int s=0;
  while(n!=0) s++, n/=10;
  return s;
}


int Sint(int n) {
  int m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10;
  return m;
}


int Svec(vector<int> v){
  int n=0;
  for(int i=0;i<v.size();i++) n+=v[i];
  return n;
}


int GCD(int a,int b){
  int r,tmp;
/*自然数 a > b を確認・入替*/
  if(a<b){
    tmp=a,a=b,b=tmp;
  }
/*ユークリッドの互除法*/
  r=a%b;
  while(r!=0){
    a=b,b=r,r=a%b;
  }
  return b;
}


int LCM(int a,int b){
  int c=a,d=b,r,tmp;
/*自然数 a > b を確認・入替*/
  if(a<b){
    tmp=a,a=b,b=tmp;
  }
/*ユークリッドの互除法*/
  r=a%b;
  while(r!=0){
    a=b,b=r,r=a%b;
  }
  return c/b*d;
}


int Factorial(int n){
  int m=1;
  while(n>=1) m*=n,n--;
  return m;
}


/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
int main() {
  string a,b;
  bool flag=false;
  cin>>a>>b;
  if(a.size()<b.size()){
    cout<<"UNRESTORABLE"<<endl;
    return 0;
    
    
    
  }else if(a.size()==b.size()){
    flag=true;
    rep(i,a.size()){
      if(a[i]==b[i] || a[i]=='?'){
      }else{
        flag=false;
      }
    }
    if(flag){
      cout<<b<<endl;
      return 0;
    }else{
      cout<<"UNRESTORABLE"<<endl;
      return 0;
    }
    
    
    
  }else if(a.size()>b.size()){
    flag=false;
    rep(i,a.size()-b.size()+1){
      bool can=true;
      for(int j=0;j<b.size();j++){
        int k=0;//どこからがbの範囲か調べる
        if(a[i+j]==b[j] || a[i+j]=='?'){
          if(j==0){
            k=i;
          }
        }else{
          can=false;
        }
      }
      if(can){//出力処理
        int c=a.size();//値を変えるから保存
        rep(i,c-b.size()+1){
          if(i==k){
            cout<<b;
            a=a.substr(i,b.size());
            k=-1;
          }else if(a[i]=='?'){
            cout<<'a';
          }else{
            cout<<a[i];
          }
          
          
          
          
          
        }
        cout<<endl;
        return 0;
      }
    }
    
  }
  
  
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:113:17: error: 'k' was not declared in this scope
  113 |           if(i==k){
      |                 ^
Language: C++

s=input()
t=input()
ls=len(s)
lt=len(t)
sa=[]

def change_to_a(sd):
    new_sd=""
    for i in range(len(sd)):
        if sd[i]=="?":
            new_sd+="a"
        else:
            new_sd+=sd[i]
    return new_sd

if lt > ls:
    print("UNRESTORABLE")
elif lt==ls:
    for i in range(ls):
        if s[j]!=t[j-i] and s[j]!="?":
            print("UNRESTORABLE")
            break
    else:
        print(t)
else:
    x=0
    for i in range(0,ls-lt+1):
        for j in range(i,i+lt):
            if s[j]!=t[j-i] and s[j]!="?":
                x=1
                break
            if j==i+lt-1:
                if i==0:
                    sa.append(t+change_to_a(s[lt:]))
                elif i==ls-lt:
                    sa.append(change_to_a(s[:ls-lt])+t)
                else:
                    sa.append(change_to_a(s[:i])+t+change_to_a(s[i+lt:]))
    if x==0:
        print(min(sa))
    else:
        print("UNRESTORABLE")


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

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


int main(){
  string s,t;
  	cin >>s ;
    cin >>t;
  
  for(int i=0;i<s.size();i++){
    for(int j=0;j<t.size();j++){
      
      if(s[i] == t[j]){
        for(int k =0;k<j;k++){
          if(s[i-k] != t[j-k])
            break;
        }
        for(int k =0;k<t.size()-j;k++){
          if(s[i+K] != t[j+k])
            break;
        }
      }
        for(int i =0;i<s.size();i++){
          if(s[i] == '?'){
            s[i] = 'a';
          }
        }
        
      }
      cout << s << endl;
    
    return 0;
    }
  cout << "UNRESTORABLE" endl;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:19:18: error: 'K' was not declared in this scope
   19 |           if(s[i+K] != t[j+k])
      |                  ^
a.cc:34:25: error: expected ';' before 'endl'
   34 |   cout << "UNRESTORABLE" endl;
      |                         ^~~~~
      |                         ;
Language: C++

s_prime=str(input())
t=str(input())
def solve(s_prime,t):
  ls=len(s_prime)
  lt=len(t)
  for i in range(ls-lt+1):
    temp='?'*(ls-lt-i)+t+'?'*i
    # print(temp)
    f=True
    for j in range(ls):
      if s_prime[j]=='?':
        continue
      elif temp[j] in ['?',s_prime[j]]:
        continue
      f=False
    if f==True:
      ans=''
      for j in range(ls):
        if temp[j]=='?':
          if s_prime[j]=='?':
            ans+='a'
          else:
            ans+=s_prime[j]
        else:
          ans+=temp[j]
      return ans
  return 'UNRESTORABLE'
  
print(solve(s_prime,t))

Compiler output:
a.cc:8:7: error: invalid preprocessing directive #print
    8 |     # print(temp)
      |       ^~~~~
a.cc:17:11: error: empty character constant
   17 |       ans=''
      |           ^~
a.cc:27:10: warning: multi-character literal with 12 characters exceeds 'int' size of 4 bytes
   27 |   return 'UNRESTORABLE'
      |          ^~~~~~~~~~~~~~
a.cc:1:1: error: 's_prime' does not name a type
    1 | s_prime=str(input())
      | ^~~~~~~
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
typedef long long LL;

char a[51], b[51];
int main()
{
	cin.getline(a, 51);
	cin.getline(b, 51);
	int lena = strlen(a);
	int lenb = strlen(b);

	if (lena<lenb) {
		cout << "UNRESTORABLE";
	}

	bool found = false;
	int i;
	for (i = lena - 1;i >= lenb - 1;i--) {
		bool valid = true;
		for (int j = 0;j < lenb;j++) {
			if ((a[i - j] == b[lenb - 1 - j]) || (a[i - j] == '?')) {
				continue;
			}
			else {
				valid = false;
				break;
			}
		}

		if (valid) {
			found = true;
			break;
		}
	}

	if (found) {

		for (int j = 0;j < lenb;j++) {
			a[i - j] = b[lenb - 1 - j];
		}
		for (int j = 0;j < lena;j++) {
			if (a[j] == '?')a[j] = 'a';
		}

		cout << a;
	}
	else {
		cout << "UNRESTORABLE";
	}
	return 0;
}

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

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

string s1,s2,ans;
int n,m;
bool f;

int main(){
	cin>>s1>>s2;
	n=(int)s1.size();
	m=(int)s2.size();
	ans="~";
	for(int i=n-m;i>=0;i--){
		f=true;
		for(int j=0;j<m;j++)
			if(s1[i+j]!='?'&&s1[i+j]!=s2[j]){
				f=false;
				break;
			}
		if(f){
			
			string t="";
			for(int j=0;j<i;j++) {
				if(s1[j]=='?') t+='a';
				else t+=s1[j];
			}
			for(int j=0;j<m;j++) t+=s2[j];
			for(int j=i+m;j<n;j++) {if(s1[j]==/?)t+='a';else t+=s1[j];}
			ans=min(ans,t);
		}
	}
	if(ans=="~") puts("UNRESTORABLE");
	else cout<<ans<<endl;
	return 0;
}
//Dubious Document

Compiler output:
a.cc: In function 'int main()':
a.cc:28:59: error: expected primary-expression before '/' token
   28 |                         for(int j=i+m;j<n;j++) {if(s1[j]==/?)t+='a';else t+=s1[j];}
      |                                                           ^
a.cc:28:60: error: expected primary-expression before '?' token
   28 |                         for(int j=i+m;j<n;j++) {if(s1[j]==/?)t+='a';else t+=s1[j];}
      |                                                            ^
a.cc:28:61: error: expected primary-expression before ')' token
   28 |                         for(int j=i+m;j<n;j++) {if(s1[j]==/?)t+='a';else t+=s1[j];}
      |                                                             ^
a.cc:28:61: error: expected ':' before ')' token
   28 |                         for(int j=i+m;j<n;j++) {if(s1[j]==/?)t+='a';else t+=s1[j];}
      |                                                             ^
      |                                                             :
a.cc:28:61: error: expected primary-expression before ')' token
Language: C++


#include <iostream>

using namespace std;

int main(){
    string S, T;
    cin >> S >> T;

    int p = S.size() - T.size();
    bool judge;
    for(int i = p; i >= 0; i--){
        judge = true;
        for(int j = 0; j < T.size(); j++){
            if(T[j] != S[j+i] && S[j+i] != '?'){
                judge = false;
            }
        }
        if(judge == true){
            p = i;
            break;
        }
    }
    
    if(judge == false){
        cout << "UNRESTORABLE" << endl;
    }else{
        for(int i = p; i < t.size()+p; i++){
            if(S[i] == '?'){
                S[i] = T[i-p];
            }
        }
        for(int i = 0; i < s.size(); i++){
            if(S[i] == '?'){
                S[i] = 'a';
            }
        }
        cout << S << endl;
    }


    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:28: error: 't' was not declared in this scope
   28 |         for(int i = p; i < t.size()+p; i++){
      |                            ^
a.cc:33:28: error: 's' was not declared in this scope
   33 |         for(int i = 0; i < s.size(); i++){
      |                            ^
Language: C++

#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <cfloat>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

int main() {
  string S, T;

  cin >> S >> T;

  bool sol = false;
  int pos = 0;
  for (size_t i = 0; i < S.length(); i++) {
    if (S[i] == T[0] || S[i] == '?') {
      bool cur_sol = true;
      for (size_t j = 1; j < T.length(); j++) {
        if(i + j >= S.length() || (S[i+j] != '?' && S[i+j] != T[j]){
          cur_sol = false;
          break;
        }
      }
      if(cur_sol){
        pos = i;
        sol = true;
        break;
      }
    } // if
  } // i

  string ans = S;
  for (size_t i = 0; i < T.length(); i++){
    ans[i + pos] = T[i];
  }

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

  if (!sol) ans = "UNRESTORABLE";

  cout << ans << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:68: error: expected ')' before '{' token
   35 |         if(i + j >= S.length() || (S[i+j] != '?' && S[i+j] != T[j]){
      |           ~                                                        ^
      |                                                                    )
a.cc:39:7: error: expected primary-expression before '}' token
   39 |       }
      |       ^
Language: C++


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



int main() {
  //
  char S[64], S_dash[64], T[64], T_dash[64];
  scanf("%s", &S);
  scanf("%s", &T);


  vector<string> candidates;


  int start = 0, len_S = strlen(S), len_T = strlen(T);
  for (int len_q = 1; len_q <= len_T-1; ++len_q) {
    for (start = 0; start <= (len_T - len_q); ++start) {
      // 検索語を作成する
      strcpy(T_dash, T);
      strcpy(S_dash, S);
      for (int i = start; i < len_q + start; ++i) {
        T_dash[i] = '?';
      }

      //
      char *c;
      if( (c = strstr(S_dash, T_dash)) != NULL){
//        cout << T_dash << endl;
        strcpy(c, T);
//        cout << S_dash << endl;

        //
        for (int i = 0; i < len_S; ++i) {
          if(S_dash[i] == '?') S_dash[i] = 'a';
        }
        candidates.push_back(string(S_dash));
      }
    }
  }

  if(candidates.size() == 0){
    cout << "UNRESTORABLE" << endl;
  }else{
    sort(candidates.begin(), candidates.end());
    for(string c: candidates){
      cout << c << endl;
      break;
    }
  }




  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:25:26: error: 'strlen' was not declared in this scope
   25 |   int start = 0, len_S = strlen(S), len_T = strlen(T);
      |                          ^~~~~~
a.cc:11:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   10 | #include <queue>
  +++ |+#include <cstring>
   11 | using namespace std;
a.cc:26:32: error: 'len_T' was not declared in this scope; did you mean 'len_q'?
   26 |   for (int len_q = 1; len_q <= len_T-1; ++len_q) {
      |                                ^~~~~
      |                                len_q
a.cc:29:7: error: 'strcpy' was not declared in this scope
   29 |       strcpy(T_dash, T);
      |       ^~~~~~
a.cc:29:7: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:37:16: error: 'strstr' was not declared in this scope
   37 |       if( (c = strstr(S_dash, T_dash)) != NULL){
      |                ^~~~~~
a.cc:37:16: note: 'strstr' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
bool check(string s,string t){
    bool j = true;
    int l = s.size();
    for(int i = 0;i < l;i++){
        if(s[i] == '?' || s[i] == t[i]);
        else j = false;
    }
    return j;
}
int main(){
    bool judge = false;
    string s,t;
    cin >> s >> t;
    int s_siz = s.size();
    int t_siz = t.size();
    reverse(s.begin(),s.end());
    reverse(t.begin(),t.end());
    for(int i = 0;i <= s_siz - t_siz;i++){
        judeg = true;
        if(i == s_siz - t_siz){
            cout << "UNRESTORABLE" << endl;
            judge = false;
            break;
        }
        string sub = s.substr(i,t_siz);
        if(check(sub,t)){
            for(int j = 0;j < t_siz;j++)s[i+j] = t[j];
            break;
        }
    }
    reverse(s.begin(),s.end());
    if(judge){
        for(int i = 0;i < s_siz;i++){
            if(s[i] == '?')cout << "a";
            else cout << s[i];
        }
    }
    //cin >> s;
}

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

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

bool match(string &s, string t, int i){
	for(int j = 0; j< t.size(); j++){
		if(s[i+j] != t[j] && s[i+j] != '?') return false;
		else s[i+j] = t[j];
	}
	for(int j = 0; j< s.size(); j++){
		if(s[j] == '?') s[j] = 'a';
	}
	return true;
}

int main(){
	string s, t;
	cin >> s >> t;
	for(int i=s.size()-t.size(); i>=0 i--){
		if(match(s, t, i)) {
			cout << s;
			return 0;
		}
	}
	cout << "UNRESTORABLE";
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:19:42: error: expected ';' before 'i'
   19 |         for(int i=s.size()-t.size(); i>=0 i--){
      |                                          ^~
      |                                          ;
Language: C++

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

int main(){
  string s,t;
  cin>>s >>t;
  int n=s.size(),m=t.size();
  
  if(n<l){
    cout<<"UNRESTORABLE"<<endl;
    return 0;
  }
  
  vector<string> ans;
  
  for(int i=0;i<n-m+1;i++){
    bool ok =true;
    string u = s;
    for(int j=0;j<m;j++){
      if(u[i+j]!='?'&&t[j]!=u[i+j]){
        ok = false;
        break;
      }
      u[i+j]=t[j];
    }
    if(ok){
      for(int k=0;k<n;k++){
        if(u[i]=='?')u[i]='a';
      }
      ans.push_back(u);
    }
  }
  
  if(ans.empty()){
    cout<<"UNRESTORABLE"<<endl;
    return 0;
  }
  
  sort(ans.begin(),ans.end());
  
  cout<<ans[0]<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: 'l' was not declared in this scope
    9 |   if(n<l){
      |        ^
Language: Java

package alg1;

import java.util.ArrayList;
import java.util.Scanner;

public class atcoder {

	public atcoder() {
		
	}
	
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		String  s = sc.next();
		String t = sc.next();
		int count = 0;
		for(int i=t.length(); i<s.length(); i++) {
			String subs = s.substring(i - t.length(), i);
			for(int j=0; j<t.length(); j++) {
				if(subs.charAt(j) == '?' || subs.charAt(j) == t.charAt(j)) {
					count++;
				}
				else break;
			}
		}
		
	}
	

}

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

//  Created by liszt on 2019/07/28.
#include<bits/stdc++.h>
using namespace std;

int main(){
    string s,t; cin>>s >>t;
    int n=s.size(),l=t.size();
    
    bool ok=false;
    for(int i=0;i<n-l+1;i++){
        int cnt=0;
        for(int j=0;j<l;j++){
            if(s[i+j]!='?'&&s[i+j]!=t[j])cnt++;
        }
        if(cnt==0){
            ok=true;
            for(j=0;j<l;j++)s[i+j]=t[j];
        }
    }
    
    if(!ok){
        cout<<"UNRESTORABLE"<<endl;
        return 0;
    }
    
    for(int i=0;i<n;i++){
        if(s[i]=='?')s[i]='a';
    }
    
    cout<<s<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 'j' was not declared in this scope
   17 |             for(j=0;j<l;j++)s[i+j]=t[j];
      |                 ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int lmatch(string t, string p){
  for(int i = 0; i < t.size(); i++){
    int j = 0;
    int lm = -1;
    while(t[i+j] == p[j] || t[i+j] == '?'){
      j++;
    }
    if(j >= p.size()) lm = i;
  }
  return lm;
}

int main(){
  string s, p;
  cin >> s >> p;
  
  int m = lmatch(s, p);
  if(m == -1){
    cout << "UNRESTORABLE";
    return 0;
  }else{
    for(int i = 0; i < s.size(); i++){
      if((i < m || i >= m + p.size()) && s[i] == '?') s[i] = 'a';
      else if ((i < m || i >= m + p.size()) && s[i] != '?') continue;
      else s[i] = p[i - m];
    }
    cout << s;
  }
}


Compiler output:
a.cc: In function 'int lmatch(std::string, std::string)':
a.cc:15:10: error: 'lm' was not declared in this scope; did you mean 'tm'?
   15 |   return lm;
      |          ^~
      |          tm
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int fmatch(string t, string p){
  for(int i = 0; i < t.size(); i++){
    int j = 0;
    while(t[i+j] == p[j] || p[j] == '?'){
      j++;
    }
    if(j == p.size() - 1) return i;
  }
  return -1;
}

int main(){
  stirng s, p;
  cin >> s >> p;
  
  int m = fmatch(s, p);
  if(m == -1){
    cout << "UNRESTORABLE";
    return -1;
  }else{
    for(int i = 0; i < s.size(); i++){
      if((i < m || i >= m + p.size()) && s[i] == '?') s[i] = 'a';
      else s[i] = p[i - m];
    }
    cout << s;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:3: error: 'stirng' was not declared in this scope
   18 |   stirng s, p;
      |   ^~~~~~
a.cc:19:10: error: 's' was not declared in this scope
   19 |   cin >> s >> p;
      |          ^
a.cc:19:15: error: 'p' was not declared in this scope
   19 |   cin >> s >> p;
      |               ^
Language: C++

#include <iostream>
#include <vector>
#include <map>

using namespace std;

int firstmatch(string s, string p, char w){
  for(int i = 0; i < s.size(), i++){
    int j = 0;
    while(s[i+j] == p[j] || s[i+j] == w)j++;
    if(j == p.size() - 1) return i;
  }
  return -1;
}


int main(){
  string s, p;
  cin >> s >> p;
  int m = firstmatch(s, p, '?');
  if(m == -1) cout << "UNRESOLVED";
  else{
    for(int i = 0; i < s.size(); i++){
      if(i < m && s[i] == '?') s[i] = 'a';
      else if(i >= m && i < m + p.size()) s[i] = p[i - m];
      else if(i >= m + p.size() && s[i] == '?') s[i] = 'a';
    }
  }
  cout << s;
}


Compiler output:
a.cc: In function 'int firstmatch(std::string, std::string, char)':
a.cc:8:35: error: expected ';' before ')' token
    8 |   for(int i = 0; i < s.size(), i++){
      |                                   ^
      |                                   ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
 int wari(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }
 int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
 int souwa(int a){
  return a*(a+1)/2;
 }
 int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
signed main(){
  string a,b,s;
  int c=1;
  cin>>a>>b;
  vector<string> d;
  for(int i=0;i<a.size()-b.size()+1;i++){
    s=a;
    for(int j=0;j<b.size();j++){
      if(a[i+j]!='?'&&a[i+j]==b[j])
        break;
      else{
        if(a[i+j]=='?')
        s[i+j]=b[j];
        else
          s[i+j]=a[i+j];
      }
      if(j==b.size()-1)){
        for(int k=0;k<s.size();k++){
          if(s[k]=='?')
            s[k]='a';
        }
        d.push_back(s);
      }
    }
  }
    Sort(d);
    cout<<d.at(0)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:73:24: error: expected primary-expression before ')' token
   73 |       if(j==b.size()-1)){
      |                        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
 int wari(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }
 int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
 int souwa(int a){
  return a*(a+1)/2;
 }
 int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
signed main(){
  string a,b,s;
  int c=1;
  cin>>a>>b;
  vector<string> d;
  for(int i=0;i<a.size()-b.size()+1;i++){
    s=a;
    for(int j=0;j<b.size();j++){
      if(a[i+j]!='?'&&a[i+j]==b[j])
        break;
      else{
        if(a[i+j]=='?')
        s[i+j]=b[j];
        else
          s[i+j]=a[i+j];
      }
      if(j==b.size()-1)){
        for(int k=0;k<s.size();k++){
          if(s[k]=='?')
            s[k]='a';
        }
        d.push_back(s);
      }
    }
  }
    Sort(d);
    cout<<d.at(0)<<endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:73:24: error: expected primary-expression before ')' token
   73 |       if(j==b.size()-1)){
      |                        ^
a.cc:83:25: error: expected '}' at end of input
   83 |     cout<<d.at(0)<<endl;
      |                         ^
a.cc:57:14: note: to match this '{'
   57 | signed main(){
      |              ^
Language: C++

#include<bits/stdc++>
using namespace std;
int main (void){
  string S[50],T[50];
  int i,j;
  cin >> "S" >> "T";
  for(i=0;i<=49;i=i+1){
  if(T[0]==S[i]){
    for(j=0;j<=49;j=j+1){
       S[i]=T[j]
    }
  }elseif(!(T[0]==S[i])){
    S[i]='?';
  } 
  }
  replace(S.bigin,S.end,'?','a');
  cout << "S" << endl;
}

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

#include<bits\stdc++.h>
using namespace std;
int main()
{
	string s,t;
	bool judge=true,sj=true;
	int x;
	cin>>s>>t;
	if(s.size()<t.size())
	{
		cout<<"UNRESTORABLE";
		return 0;
	}    
	for(int i=0;i<s.size();i++)
	{
		if(s[i]==t[0])
		{
			for(int j=1;j<t.size();j++)
	    	    if(s[i+j]!='?')
	            {
	        	    judge=false;
	        	    break;
			    }
		    if(judge==true)
		    {
		    	for(int j=0;j<t.size();j++)
		            s[i+j]=t[j];
		        for(int i=0;i<s.size();i++)
	                if(s[i]=='?')
	                    s[i]='a';
		        break;
			}
		}
		if(i<s.size()-1)
		    judge=true;	
	}
    for(int i=0;i<s.size();i++)
	    if(s[i]=='?')
	    {
	    	cout<<"UNRESTORABLE";
	    	return 0;
		}
	cout<<s;
	return 0;
}

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

n=input()
m=input()
le=len(m)
check=0
for i in range(len(n)-le,-1,-1):
    count=0
    for j in range(le):
        if m[j]==n[i+j]:
            count+=1
    if le-count==n[i:i+le].count('?'):
        n=n[0:i]+m+n[i+le:len(n)]
        check=1
        n=n.replace('?','a')
if check==1:
    print(n)
else:
    print("UNRESTORABLE")

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

#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <utility>
#include <cstdio>
#include <vector>
#include <string>
#include <string.h>
#include <queue>
#include <stack>
#include <cmath>
#include <set>
#include <map>
int GCD(int a, int b) {
	return b ? GCD(b, a%b) : a;
}
//sort(a, a + N, greater<int>())   // descend
//sort(a, a+N)                    //  ascend

using ll = long long;
using namespace std;

int wh = 0;



int main() {
	string s, t;
	cin >> s >> t;
	bool ppy = false;
	bool ppx = false;
	int x = s.length() - t.length();

	for (int i = 0; i < s.length(); i++) {
		if (s.substr(i, t.length()) == t) {
			ppy = true;
			break;
		}
	}

	if (ppy == false) {
	for (int i = x; i >= 0; i--) {
		int p = i;
		int h = 0;
		wh = i;
		ppx = true;
		while (p < i + t.length()) {
			if (s[p] == t[h] || s[p] == '?') {
				p++;
				h++;
			}
			else {
				ppx = false;
				break;
			}
		}
		if (ppx) break;
	}
}

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

	string ans2 = ans1;

	ans2.replace(wh, t.length(), t);

	if(ppy) cout << ans1;
	else if (ppx) cout << ans2;
	else cout<< "UNRESTORABLE";

}


Compiler output:
a.cc: In function 'int main()':
a.cc:65:21: error: 'ans2' was not declared in this scope; did you mean 'ans1'?
   65 |                 if (ans2[i] == '?') ans[i] = 'a';
      |                     ^~~~
      |                     ans1
a.cc:65:37: error: 'ans' was not declared in this scope; did you mean 'ans1'?
   65 |                 if (ans2[i] == '?') ans[i] = 'a';
      |                                     ^~~
      |                                     ans1
Language: C++

#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <utility>
#include <cstdio>
#include <vector>
#include <string>
#include <string.h>
#include <queue>
#include <stack>
#include <cmath>
#include <set>
#include <map>
int GCD(int a, int b) {
	return b ? GCD(b, a%b) : a;
}
//sort(a, a + N, greater<int>())   // descend
//sort(a, a+N)                    //  ascend

using ll = long long;
using namespace std;

int wh = 0;

int main() {
	string s, t;
	cin >> s >> t;
	bool ppx = true;
	int x = s.length() - t.length();
	for (int i =x; i >=0; i--) {
		int p = i;
		int h = 0;
		wh = i;
		ppx = true;
		while (p < i + t.length()) {
			if (s[p] == t[h] || s[p] == '?') {
				p++;
				h++;
			}
			else  {
				ppx = false;
				break;
			}
		}
		if (ppx) break;
	}

	string ans = s;
	in j = 0;
	for (int i = wh; i < wh + t.length(); i++) {
		if (ans[i] != '?') ans.replace(i, 1, t[j]);
		j++;
	}

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


	if(ppx) cout << ans;
	else cout<< "UNRESTORABLE";

}


Compiler output:
a.cc: In function 'int main()':
a.cc:51:9: error: 'in' was not declared in this scope; did you mean 'yn'?
   51 |         in j = 0;
      |         ^~
      |         yn
a.cc:53:56: error: 'j' was not declared in this scope
   53 |                 if (ans[i] != '?') ans.replace(i, 1, t[j]);
      |                                                        ^
a.cc:54:17: error: 'j' was not declared in this scope
   54 |                 j++;
      |                 ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define print(s) cout << s << endl
#define acc(v) accumulate(v.begin(), v.end(), 0)
#define cinv(n,v) rep(i,n) cin >> v[i]
using namespace std;
const int INF = 1e9;
typedef long long ll;
typedef vector<int> vint;
typedef vector<string> vstr;
typedef vector<char> vchar;
const ll LINF = 1e18;
const ll MOD = 1e9 + 7;
// const lint MOD = 998244353;
int x_pos[4] = {1,0,-1,0}, y_pos[4] = {0,1,0,-1};
int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}
char upper(char c){
	return c-0x20;
}
char lower(char c){
	return c+0x20;
}

int gcd(int x, int y) {
  if (y == 0) return x;
  return gcd(y, x%y);
}

int main (){
	string s,t; cin >> s >> t;
	vector<int> v;
	rep(i,s.size()){
		bool found = true;
		rep(j,t.size()){
			if (i+j >= s.size()){
				found = false;
				break;
			}
			if (s[i+j] != t[j] && s[i+j] != '?'){
				found = false;
				break;
			}
		}
		if (found){
			v.push_back(j)
		}
	}
	if (v.size()){
		rep(i,s.size()){
			if (*max_element(all(v))==i){
				cout << t;
				i += t.size()-1;
				continue;
			}
			if (s[i]=='?'){
				cout << 'a';
			}else{
				cout << s[i];
			}
		}
		cout << endl;
		return 0;
	}
	cout << "UNRESTORABLE" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:37: error: 'j' was not declared in this scope
   52 |                         v.push_back(j)
      |                                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main()
{
    string s,t;
    string x;
    cin>>s>>t;
    x=s;
    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]==t[j]||s[i+j]=='?'){continue;}
            else{flag = false;break;}
        }
        if(flag){
            int idx = i;
            for(int j=0;j<t.size();j++,l++){
                if(x[idx+j]=='?'){
                    x[idx+j] = t[j];
                }
            }
            for(int m=0;m<x.size();m++){
                if(x[m]=='?'){
                    x[m] = 'a';
                }
            }
            cout << x << endl;
            return 0;
        }
    }
    cout<<"UNRESTORABLE"<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:40: error: 'l' was not declared in this scope
   18 |             for(int j=0;j<t.size();j++,l++){
      |                                        ^
Language: C

#include <bits/stdc++.h>
using namespace std;
 
int main()
{
    string s,t;
    string x;
    cin>>s>>t;
    x=s;
    for(int i=0;i<s.size();i++){
        bool flag = true;
        int value=i;
        for(int j=0;j<t.size();j++){
            if(s[value]==t[j]||s[value]=='?'){value++; continue;}
            else{flag = false;break;}
        }
        if(flag){
            int l = i;
            for(int j=0;j<t.size();j++,l++){
                    x[l] = t[j];
            }
            for(int m=0;m<x.size();m++){
                if(x[m]=='?'){
                    x[m] = 'a';
                }
            }
            cout << x << endl;
            return 0;
        }
    }
    cout<<"UNRESTORABLE"<<endl;
    return 0;
}

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

#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;

int a[100],b[100],ans[100],l,ll;
char s[100];

void print(int id){
	for(int i=1;i<id;i++)
	if(a[i]!=0)ans[i]=a[i];
	else ans[i]='a';
	for(int i=1;i<=ll;i++)
	ans[i+id-1]=b[i];
	for(int i=1;i<=l;i++)
	printf("%c",ans[i]);
}

int main(void){
	scanf("%s",s);
	l=strlen(s);
	printf("UNRESTORABLE");
	return 0;
	for(int i=0;i<strlen(s);i++)
	if(s[i]=='?')a[i+1]=0;
	else a[i+1]=(int)s[i];
	scanf("%s",s);
	ll=strlen(s);
	for(int i=0;i<strlen(s);i++)
	b[i+1]=s[i];
	for(int i=l-ll+1;i>=1;i--){
		bool tmp=1;
		for(int j=0;j<ll;j++)
		if(a[i+j]!=b[j+1]&&a[j+i]!=0){
			tmp=0;
			break;
		}
		if(tmp==1){
			print(i);
			return 0;
		}
	}
	printf();
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:43:15: error: too few arguments to function 'int printf(const char*, ...)'
   43 |         printf();
      |         ~~~~~~^~
In file included from /usr/include/c++/14/cstdio:42,
                 from a.cc:1:
/usr/include/stdio.h:363:12: note: declared here
  363 | extern int printf (const char *__restrict __format, ...);
      |            ^~~~~~
Language: C++

#include<cstdio>
#include<cstring>
char s[60],t[60];
int n,m;
bool check(int k,char ch)
{
	for(int i=k;i<t+k;i++)
		if(s[i]!=t[i-k]&&s[i]!=ch)return 0;
	return 1;
}
int main()
{
	scanf("%s%s",s,t);
	n=strlen(s);
	m=strlen(t);
	for(int i=0;i<n;i++)
		if(check(i,' '))
		{
			for(int j=0;j<n;j++)
				if(s[j]=='?')s[j]='a';
			puts("s");
			return 0;
		}
	for(int i=n-1;i>=0;i--)
		if(check(i,'?'))
		{
			for(int j=i;j<i+m;j++)s[j]=t[j-i];
			for(int j=0;j<n;j++)
				if(s[j]=='?')s[j]='a';
			puts(s);
			return 0;
		}
	puts("UNRESTORABLE");
	return 0;
}


Compiler output:
a.cc: In function 'bool check(int, char)':
a.cc:7:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |         for(int i=k;i<t+k;i++)
      |                     ~^~~~
Language: C++

#include<cstdio>
#include<cstring>
char s[60],t[60];
int n,m;
bool check(int k,char ch)
{
	for(int i=k;i<t+k;i++)
		if(s[i]!=t[i-k]&&s[i]!=ch)return 0;
	return 1;
}
int main()
{
	scanf("%s%s",s,t);
	n=strlen(s);
	m=strlen(t);
	for(int i=0;i<n;i++)
		if(check(i,' '))
		{
			for(int j=0;j<n;j++)
				if(s[j]=='?')s[j]='a';
			puts("s");
			return 0;
		}
	for(int i=n-1;i>=0;i--)
		if(check(i,'?'))
		{
			for(int j=i;j<i+m;j++)s[j]=t[j-i];
			for(int j=0;j<n;j++)
				if(s[j]=='?')s[j]='a';
			puts(s);
			return 0;
		}
	puts("UNRESTORABLE");
	return 0;
}

Compiler output:
a.cc: In function 'bool check(int, char)':
a.cc:7:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |         for(int i=k;i<t+k;i++)
      |                     ~^~~~
Language: C++

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

bool match(const std::string& expr, const std::string& value) {
  if (expr.size() != value.size()) {
    return false;
  } else {
    for (int i=0; i<expr.size(); i++) {
      if (expr[i] != '?' && expr[i] != value[i]) return false;
    }
    return true;
  }
}

std::string search(const std::string& S, const std::string& T) {
  std::vector<std::string> cands;
  for (int i=0; i<=S.size()-T.size(); i++) {
    if (match(S.substr(i, T.size()), T)) {
      std::string cand(S);
      cand.replace(i, T.size(), T);
      std::replace(std::begin(cand), std::end(cand), '?', 'a');
      cands.push_back(cand);
    }
  }
  if (cands.empty()) {
    return "UNRESTORABLE";
  } else {
    std::string min_str = cands[0];
    for (int i=1; i<cands.size(); i++) {
      if (min_str.compare(cands[i]) < 0) min_str = cands[i];
    }
    return min_str;
  }
}

int main() {
  std::string S, T;
  std::cin >> S;
  std::cin >> T;
  if (T.size() > S.size()) {
    std::cout << "UNRESTORABLE" << std::endl;
  } else {
    std::cout << search(S, T) << std::endl;
  }
}

Compiler output:
a.cc: In function 'std::string search(const std::string&, const std::string&)':
a.cc:22:12: error: 'replace' is not a member of 'std'
   22 |       std::replace(std::begin(cand), std::end(cand), '?', 'a');
      |            ^~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
string s,t;
int m=-1;
cin>>s>>t;
if(s.size()<t.size()){
cout<<“UNRESTORABLE”<<endl;
}
else{
for(int i=0;i<=s.size()-t.size();i++){
  bool f=true;
  for(int j=0;j<t.size();j++){
    if(s.at(i+j)==t.at(j)||s.at(i+j)=='?')continue;
    else{
      f=false;
      break;
    }
  }
  if(f){
    m=i;
    break;
  }
}
if(m==-1){
cout<<"UNRESTORABLE"<<endl;
}
else{
for(int i=m;i<t.size()+m;i++){
s.at(i)=t.at(i-m);
}
for(int i=0;i<s.size();i++){
if(s.at(i)=='?'){
s.at(i)='a';
}
}
cout<<s<<endl;
}
}
}


Compiler output:
a.cc:8:7: error: extended character “ is not valid in an identifier
    8 | cout<<“UNRESTORABLE”<<endl;
      |       ^
a.cc:8:7: error: extended character ” is not valid in an identifier
a.cc: In function 'int main()':
a.cc:8:7: error: '\U0000201cUNRESTORABLE\U0000201d' was not declared in this scope
    8 | cout<<“UNRESTORABLE”<<endl;
      |       ^~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
string s,t;
int m=-1;
cin>>s>>t;
if(s.size()<t.size()){
cout <<“UNRESTORABLE”<<endless;
}
else{
for(int i=0;i<=s.size()-t.size();i++){
  bool f=true;
  for(int j=0;j<t.size();j++){
    if(s.at(i+j)==t.at(j)||s.at(i+j)=='?')continue;
    else{
      f=false;
      break;
    }
  }
  if(f){
    m=i;
    break;
  }
}
if(m==-1){
cout<<"UNRESTORABLE"<<endl;
}
else{
for(int i=m;i<t.size()+m;i++){
s.at(i)=t.at(i-m);
}
for(int i=0;i<s.size();i++){
if(s.at(i)=='?'){
s.at(i)='a';
}
}
cout<<s<<endl;
}
}
}


Compiler output:
a.cc:8:8: error: extended character “ is not valid in an identifier
    8 | cout <<“UNRESTORABLE”<<endless;
      |        ^
a.cc:8:8: error: extended character ” is not valid in an identifier
a.cc: In function 'int main()':
a.cc:8:8: error: '\U0000201cUNRESTORABLE\U0000201d' was not declared in this scope
    8 | cout <<“UNRESTORABLE”<<endless;
      |        ^~~~~~~~~~~~~~
a.cc:8:24: error: 'endless' was not declared in this scope
    8 | cout <<“UNRESTORABLE”<<endless;
      |                        ^~~~~~~
Language: C++

#include<algorithm>
#include<climits>
#include<cmath>
#include<cstdlib>
#include<iomanip>
#include<iostream>
#include<numeric>
#include<string>
using namespace std;

long gcd(long x, long y) { if (x > y) { return gcd(y, x); } long r; while (y != 0) { r = x % y; x = y; y = r; }return x; }
long lcm(long x, long y) { return(x / gcd(x, y)) * y; }
void indexsort(long* first, long* last, long* func) { sort(first, last, [&](long a, long b) {return func[a] < func[b]; }); }
//--------------------

int main() {

	string res = "UNRESTORABLE";
	
	string S, T; cin >> S >> T;
	long slen = S.length();
	long tlen = T.length();

	for (int i = slen - tlen; i >= 0; i++) {
		string isT; isT = S.substr(i, tlen);

		for (int i = 0; i < tlen; i++) if ()

	}


	cout << res << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:52: error: expected primary-expression before ')' token
   27 |                 for (int i = 0; i < tlen; i++) if ()
      |                                                    ^
a.cc:29:9: error: expected primary-expression before '}' token
   29 |         }
      |         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
string s,t;
cin>>s>>t;
int m=-1;
for(int i=s.size()-1;i>=t.size();i--){
int j;
for(j=t.size()-1;j>=0//範囲外アクセスしない最小の数;j--){
if(s.at(i)==t.at(j)||s.at(i)=='?'){
continue;
}
else break;
}
if(j=-1){
m=i-t.size()+1;//何文字目からを入れ替えるかメモ
break;
}
}
if(m!=-1){
for(int i=m;i<t.size();i++){
s.at(i)=t.at(i-m);
}
for(int i=0;i<s.size();i++){
if(s.at(i)=='?'){
s.at(i)='a';
}
}
cout<<s<<endl;
}
else cout<<"UNRESTORABLE"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: expected ';' before 'if'
    9 | for(j=t.size()-1;j>=0//範囲外アクセスしない最小の数;j--){
      |                      ^
      |                      ;
   10 | if(s.at(i)==t.at(j)||s.at(i)=='?'){
      | ~~                    
a.cc:10:1: error: expected primary-expression before 'if'
   10 | if(s.at(i)==t.at(j)||s.at(i)=='?'){
      | ^~
a.cc:9:22: error: expected ')' before 'if'
    9 | for(j=t.size()-1;j>=0//範囲外アクセスしない最小の数;j--){
      |    ~                 ^
      |                      )
   10 | if(s.at(i)==t.at(j)||s.at(i)=='?'){
      | ~~                    
a.cc:15:4: error: 'j' was not declared in this scope
   15 | if(j=-1){
      |    ^
a.cc:16:3: error: 'i' was not declared in this scope
   16 | m=i-t.size()+1;//何文字目からを入れ替えるかメモ
      |   ^
a.cc:17:1: error: break statement not within loop or switch
   17 | break;
      | ^~~~~
a.cc: At global scope:
a.cc:20:1: error: expected unqualified-id before 'if'
   20 | if(m!=-1){
      | ^~
a.cc:31:1: error: expected unqualified-id before 'else'
   31 | else cout<<"UNRESTORABLE"<<endl;
      | ^~~~
a.cc:32:1: error: expected declaration before '}' token
   32 | }
      | ^
Language: C++

s = input()
t = input()

ptr = []

for i in range(len(s)-len(t)+1):
	for j in range(len(t)):
		if(t[j] != s[i+j] and s[i+j] != '?'):
			print(i,j,t[j],s[i+j])
			break
		elif(j == len(t) - 1):
			ptr.append(i)
		else:
			pass

if ptr == []:
	print('UNRESTORABLE')
else:
	ptr = max(ptr)
	ans = s[0:ptr].replace('?','a') + t + s[ptr+len(t):].replace('?','a')
	print(ans)

Compiler output:
a.cc:17:15: warning: multi-character literal with 12 characters exceeds 'int' size of 4 bytes
   17 |         print('UNRESTORABLE')
      |               ^~~~~~~~~~~~~~
a.cc:1:1: error: 's' does not name a type
    1 | s = input()
      | ^
Language: C++

import re
Sd = input().strip()
T = input().strip()
Sd = Sd.replace('?','.')
ls, lt = len(Sd), len(T)
if ls < lt :
    print('UNRESTORABLE')
else :
    ans = []
    for i in range(ls - lt + 1) :
        m = re.match(Sd[i:1 + lt], T)
        if m is None :
            continue
        ans.append((Sd[:i] + T + Sd[i + lt:]).replace('.','a'))
    if not ans :
        print('UNRESTORABLE')
    else :
        print(min(ans))


Compiler output:
a.cc:7:11: warning: multi-character literal with 12 characters exceeds 'int' size of 4 bytes
    7 |     print('UNRESTORABLE')
      |           ^~~~~~~~~~~~~~
a.cc:16:15: warning: multi-character literal with 12 characters exceeds 'int' size of 4 bytes
   16 |         print('UNRESTORABLE')
      |               ^~~~~~~~~~~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import re
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 998244353
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
int main(){
  string s;cin>>s;
  string t;cin>>t;
  int i,j,k,l;
  string sp=s;
  string ans;
  ans="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz";
  i=0;
  while(i<s.size()-t.size()+1){
    bool reached = false;
    s=sp;
    for(j=i;j<i+t.size();j++){
      if(s[j]!=t[j-i] and s[j]!='?') break;
      if(j==i+t.size()-1) reached=true;
    }
    if(reached){
      for(j=i;j<i+t.size();j++){
        s[j]=t[j-i];
      }
      for(j=0;j<s.size();j++){
        if(s[j]=='?') s[j]='a';
      }
    }
    if(reached) ans=min(ans,s);
    i++;
    //cout<<i<<endl;
  }
  if(reached) cout<<ans<<endl;
  else cout<<"UNRESTORABLE"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:51:6: error: 'reached' was not declared in this scope
   51 |   if(reached) cout<<ans<<endl;
      |      ^~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
string ans="";
void make(string s,string t,int curs)
{
	for(i=0;i<s.size();i++)
	{
		if(i<curs||i>=curs+t.size())
		{
			if(s[i]=='?')
				s[i]='a';
		}
		else
		{
			if(s[i]=='?')
				s[i]=t[i-curs];
			if(s[i]!=t[i-curs])
				return;
		}
	}
	if(ans==""||ans>s)
		ans=s;
}
int main(){
	string S,T;
	cin>>S>>T;
	for(i=0;i<s.size()-t.size()+1)
		make(S,T,i);
	if(ans=="")
		cout<<"UNRESTORABLE";
	else
		cout<<ans;
	return 0;
}

Compiler output:
a.cc: In function 'void make(std::string, std::string, int)':
a.cc:6:13: error: 'i' was not declared in this scope
    6 |         for(i=0;i<s.size();i++)
      |             ^
a.cc: In function 'int main()':
a.cc:27:13: error: 'i' was not declared in this scope
   27 |         for(i=0;i<s.size()-t.size()+1)
      |             ^
a.cc:27:19: error: 's' was not declared in this scope
   27 |         for(i=0;i<s.size()-t.size()+1)
      |                   ^
a.cc:27:28: error: 't' was not declared in this scope
   27 |         for(i=0;i<s.size()-t.size()+1)
      |                            ^
a.cc:27:38: error: expected ';' before ')' token
   27 |         for(i=0;i<s.size()-t.size()+1)
      |                                      ^
      |                                      ;
Language: C++

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

int pos(string x,string y){

	int xn=x.size(),yn=y.size();
	if(xn<yn)return -1;

	for (int i=xn-yn;i>=0;i--){
		bool ok=true;

	for(int j=0;j<yn;j++){
		if(x[i+j]!=y[j] && x[i+j]!='?')ok=false;
	}
	if(ok)return i;
	}
	return -1;
}

int main(){
	string s,t;cin >>s >>t;
	int x=pos(s,t);
	if(x==-1){
	cout<<"UNRESTOREBLE"<<endl;
	return 0;
	}
	bool exists=s.find(d);
	if(!exists){	s.replace(x,t.size(),t);}
	replace(s.begin(),s.end(),'?','a');
	cout<<s<<endl;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:28: error: 'd' was not declared in this scope
   27 |         bool exists=s.find(d);
      |                            ^