Submission #2531903
Source Code Expand
#include<algorithm> #include<iostream> #include<cstdio> #include<map> #include<set> using namespace std; string s, t; set<string> S; void Work() { int lens = s.size(); int lent = t.size(); for(int i = 0; i < lens; i++) { if(s[i] == '?' || s[i] == t[0]) { string tmp = s; for(int j = 0; j < i; j++) if(tmp[j] == '?') tmp[j] ='a'; bool can = false; for(int j = 0; j < lent; j++) { if(tmp[i+j]!= '?' && tmp[i+j] != t[j]) break; tmp[i+j] = t[j]; if(j == lent - 1) can = true; } if(can) { for(int j = i + lent; j < lens; j++) if(tmp[j] == '?') tmp[j] = 'a'; S.insert(tmp); } } } if(S.size() == 0) cout << "UNRESTORABLE" << endl; else cout << *S.begin() << endl; } int main() { cin >> s >> t; Work(); }
Submission Info
Submission Time | |
---|---|
Task | C - Dubious Document 2 |
User | vjudge1 |
Language | Bash (GNU bash v4.3.11) |
Score | 0 |
Code Size | 1085 Byte |
Status | RE |
Exec Time | 3 ms |
Memory | 504 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 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 | RE | 3 ms | 504 KB |
in02.txt | RE | 2 ms | 504 KB |
in03.txt | RE | 2 ms | 504 KB |
in04.txt | RE | 3 ms | 504 KB |
in05.txt | RE | 2 ms | 504 KB |
in06.txt | RE | 2 ms | 504 KB |
in07.txt | RE | 3 ms | 504 KB |
in08.txt | RE | 2 ms | 504 KB |
in09.txt | RE | 2 ms | 504 KB |
in10.txt | RE | 3 ms | 504 KB |
in11.txt | RE | 2 ms | 504 KB |
in12.txt | RE | 3 ms | 504 KB |
s1.txt | RE | 2 ms | 504 KB |
s2.txt | RE | 2 ms | 504 KB |