Submission #2227637


Source Code Expand

def i1():
 return int(input())
def i2():
 return [int(i) for i in input().split()]
s=input()
t=input()
y=[]
import re
for i in range(len(s)-len(t)+1):
 x=s[:i]
 r=0
 for j in range(len(t)):
   if s[i+j]!="?" and s[i+j]!=t[j]:
      r=1
   else:
      x+=t[j]
 if r==0:
  if i+len(t)<=len(s)-1:
   x+=s[i+len(t):]
       
  y.append(x.replace("?","a"))
y.sort()
if len(y):
 print(y[0])
else:
 print("UNRESTORABLE")

Submission Info

Submission Time
Task C - Dubious Document 2
User tacloth
Language PyPy3 (2.4.0)
Score 300
Code Size 438 Byte
Status AC
Exec Time 175 ms
Memory 38404 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 2
AC × 14
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 173 ms 38256 KB
in02.txt AC 175 ms 38256 KB
in03.txt AC 169 ms 38256 KB
in04.txt AC 171 ms 38256 KB
in05.txt AC 171 ms 38256 KB
in06.txt AC 170 ms 38256 KB
in07.txt AC 171 ms 38256 KB
in08.txt AC 171 ms 38404 KB
in09.txt AC 170 ms 38256 KB
in10.txt AC 169 ms 38256 KB
in11.txt AC 165 ms 38256 KB
in12.txt AC 167 ms 38256 KB
s1.txt AC 169 ms 38256 KB
s2.txt AC 167 ms 38256 KB