Submission #1723102
Source Code Expand
#include<bits/stdc++.h> #define ll long long using namespace std; int main(){ string s,t; int l; bool flag = false; cin >> s >> t; for(int i = 0; i < s.size(); i++){ for(int j = 0; j < t.size() && (i + j) < s.size(); j++){ if(s[i + j] != t[j] && s[i + j] != '?')break; if(j == (t.size() - 1)){ flag = true; l = i; } } } if(flag){ for(int i = 0; i < s.size(); i++){ if(l == i){ for(int j = 0; j < t.size(); j++){ cout << t[j]; } i += (t.size()-1); } else if(s[i] == '?')cout << "a"; else cout << s[i]; } cout << endl; }else{ cout << "UNRESTORABLE" << endl; } return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Dubious Document 2 |
User | hanahana |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 879 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | s1.txt, s2.txt |
All | in01.txt, in02.txt, in03.txt, in04.txt, in05.txt, in06.txt, in07.txt, in08.txt, in09.txt, in10.txt, in11.txt, in12.txt, s1.txt, s2.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
in01.txt | AC | 1 ms | 256 KB |
in02.txt | AC | 1 ms | 256 KB |
in03.txt | AC | 1 ms | 256 KB |
in04.txt | AC | 1 ms | 256 KB |
in05.txt | AC | 1 ms | 256 KB |
in06.txt | AC | 1 ms | 256 KB |
in07.txt | AC | 1 ms | 256 KB |
in08.txt | AC | 1 ms | 256 KB |
in09.txt | AC | 1 ms | 256 KB |
in10.txt | AC | 1 ms | 256 KB |
in11.txt | AC | 1 ms | 256 KB |
in12.txt | AC | 1 ms | 256 KB |
s1.txt | AC | 1 ms | 256 KB |
s2.txt | AC | 1 ms | 256 KB |