Submission #3599237


Source Code Expand

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
int main(){
    string s,t;
    cin >> s >> t;
    string ans = "UNRESTORABLE";
    string temp;
    bool flag = false;
    for(int i=s.length()-1;i>=t.length()-1;i--){
        if(s.substr(i,1)=="?"){
            temp = s.substr(i-(t.length()-1),t.length());
            for(int j=0;j<t.length();j++){
                if(t.substr(j,1)!=temp.substr(j,1)&&temp.substr(j,1)!="?"){
                    break;
                }
                if(j==t.length()-1){
                    s.replace(i-(t.length()-1),i,t);
                    flag = true;
                    break;
                }
            }
        }
        if(flag == true){
            break;
        }
    }
    
    if(flag == true){
    replace(s.begin(),s.end(),'?','a');
    ans = s;
    }
     c

Submission Info

Submission Time
Task C - Dubious Document 2
User a_ma_ne
Language C++14 (GCC 5.4.1)
Score 0
Code Size 918 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:36:6: error: ‘c’ was not declared in this scope
      c
      ^
./Main.cpp:36:6: error: expected ‘}’ at end of input