s_id stringlengths 10 10 | p_id stringlengths 6 6 | u_id stringlengths 10 10 | date stringlengths 10 10 | language stringclasses 1
value | original_language stringclasses 11
values | filename_ext stringclasses 1
value | status stringclasses 1
value | cpu_time stringlengths 1 5 | memory stringlengths 1 7 | code_size stringlengths 1 6 | code stringlengths 1 539k |
|---|---|---|---|---|---|---|---|---|---|---|---|
s644055797 | p03565 | u633548583 | 1575259397 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 310 | sd=input()
t=input()
n=len(sd)
m=len(t)
s=[]
for i in range(n-m,-1,-1):
t_kamo=sd[i:i+m]
for j in range(m+1):
if j==m:
print((sd[:i]+t+sd[i+m:]).replace("?","a"))
if t_kamo[j]=="?":
continue
elif t_kamo[j]!=t[j]:
break
print("UNRESTORABLE") |
s163599240 | p03565 | u633548583 | 1575259234 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 310 | sd=input()
t=input()
n=len(sd)
m=len(t)
s=[]
for i in range(n-m,-1,-1):
t_kamo=sd[i:i+m]
for j in range(m+1):
if j==m:
print((sd[:i]+t+sd[i+m:]).replace("?","a"))
if k_kamo[j]=="?":
continue
elif k_kamo[j]!=t[j]:
break
print("UNRESTORABLE") |
s039969481 | p03565 | u379959788 | 1575238102 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 631 | # ABC076C
S = input()
T = input()
for i in range(len(S) - len(T) + 1):
if S[i] == "?" or S[i] == T[0]:
k = 1
flag = True
while k < len(T):
if S[i+k] == "?":
k += 1
else:
if S[i + k] == T[k]:
k += 1
e... |
s898218630 | p03565 | u379959788 | 1575237117 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 596 | # ABC076C
S = input()
T = input()
check = -1
flag = True
for i in range(len(S)):
flag = True
if S[i] != T[0]:
continue
k = 1
while k < len(T):
if S[i+k] == "?":
k += 1
else:
if S[i+k] == T[k]:
k += 1
else:
flag =... |
s574431850 | p03565 | u047178225 | 1575221668 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 341 | S = input()
T = input()
m = len(S)
n = len(T)
ans = 0
if m >= n:
for i in range(m+1-n):
for j in range(n):
if S[i+j] != T[j] and S[i+j] != "?":
break
else:
S = S[0:i] + T + S[i+n+1:]
ans = 1
if ans == 1:
print(S.replace("?", "a"))
else:
p... |
s442323587 | p03565 | u047178225 | 1575213142 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 853 | S = input()
T = input()
sl = list(S)
tl = list(T)
n = len(tl)
w = "?" * n
ans = 0
if len(S) >= n:
if w in S:
ans = 1
S.replace(w, T)
sl = list(S)
for i in range(n):
if tl[i] in sl:
j = sl.index(tl[i])
#print(j, tl[i])
sl2 = sl[j-i:j]
... |
s488740051 | p03565 | u047178225 | 1575157032 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 603 | S = input()
T = input()
sl = list(S)
tl = list(T)
n = len(tl)
w = "?" * n
ans = 0
if w in S:
ans = 1
S.replace(w, T)
sl = list(S)
for i in range(n):
if tl[i] in sl:
j = sl.index(tl[i])
try:
sl2 = sl[j-i:j+n-i]
except:
continue
#print(sl2)
# #p... |
s403261580 | p03565 | u047178225 | 1575156713 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 489 | S = input()
T = input()
sl = list(S)
tl = list(T)
n = len(tl)
w = "?" * n
ans = 0
if w in S:
ans = 1
S.replace(w, T)
sl = list(S)
for i in range(n):
if tl[i] in sl:
j = sl.index(tl[i])
sl2 = sl[j-i:j+n-i]
#print(sl2)
#print(tl)
for k in range(n):
if sl2[k] != tl[k] and sl2[k] != "?... |
s601166770 | p03565 | u688375653 | 1575149965 | Python | PyPy3 (2.4.0) | py | Runtime Error | 178 | 38256 | 360 | S=input()
T=input()
s_len =len(S)
t_len =len(T)
for head in range(len(S)-t_len,0,-1):
flg=True
for s,t in zip(S[head:head+t_len],T):
if not(s==t or "?"==s):
flg=False
if flg:
break
if flg:
S=list(S)
S[head:head+t_len] = T
S="".join(S)
S=S.replace("?","a")
... |
s717608726 | p03565 | u919025034 | 1574936730 | Python | PyPy3 (2.4.0) | py | Runtime Error | 175 | 38256 | 536 | S_d,T = list(input()),list(input())
if len(S_d) < len(T):
print("UNRESTORABLE");exit()
flag = 1
for i in range(-len(T),-len(S_d)-1,-1):
key = 0
for j in range(len(T)):
if S_d[i+j]=="?" or S_d[i+j]==T[j]:
key+=1
else:
break
if key == len(T):
st=len(S_d)+i
break
else:
st=-1
if... |
s253466554 | p03565 | u919025034 | 1574936335 | Python | PyPy3 (2.4.0) | py | Runtime Error | 174 | 38640 | 514 | S_d,T = list(input()),list(input())
if len(S_d) < len(T):
print("UNRESTORABLE");exit()
flag = 1
for i in range(-len(T),-len(S_d)-1,-1):
key = 0
for j in range(len(T)):
if S_d[i+j]=="?" or S_d[i+j]==T[j]:
key+=1
if key == len(T):
st=len(S_d)+i
break
else:
st=-1
if st==-1:
print(UNRES... |
s348693067 | p03565 | u734876600 | 1574568002 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 552 | ss = list(input())
t = list(input())
s = ""
for c in ss:
cnt = len(t)
if c == "?" or c == t[0]:
d = ss.index(c)
copy = ss.copy()
for i in range(d, d + len(t)):
if ss[i] == t[i - d] or ss[i] == "?":
copy[i] = t[i - d]
cnt -= 1
else:
... |
s249898360 | p03565 | u734876600 | 1574567878 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 523 | ss = list(input())
t = list(input())
s = ""
for c in ss:
cnt = len(t)
if c == "?" or c == t[0]:
d = ss.index(c)
copy = ss.copy()
for i in range(d, d + len(t)):
if ss[i] == t[i - d] or ss[i] == "?":
copy[i] = t[i - d]
cnt -= 1
else:
... |
s621086325 | p03565 | u577138895 | 1574433693 | Python | PyPy3 (2.4.0) | py | Runtime Error | 161 | 38256 | 459 | S_dash = list(map(str, input()))
T = list(map(str, input()))
for i in reversed(range(len(S_dash) - len(T) + 1)):
flg = 1
for j in range(len(T)):
if S_dash[i + j] != "?" and S_dash[i + j] != T[j]:
flg = 0
break
if flg:
for j in range(len(T)):
S_dash[i + j] = T[j]
break
if flg:
for i in range(len(... |
s617492236 | p03565 | u577138895 | 1574433646 | Python | PyPy3 (2.4.0) | py | Runtime Error | 163 | 38256 | 452 | S_dash = list(map(str, input()))
T = list(map(str, input()))
for i in reversed(range(len(S_dash) - len(T) + 1)):
flg = 1
for j in range(len(T)):
if S_dash[i + j] != "?" and S_dash[i + j] != T[j]:
flg = 0
break
if flg:
for j in range(len(T)):
S_dash[i + j] = T[j]
break
if flg:
for i in range(len(... |
s736459119 | p03565 | u577138895 | 1574169887 | Python | PyPy3 (2.4.0) | py | Runtime Error | 165 | 38256 | 443 | S_dash = list(map(str, input()))
T = list(map(str, input()))
for i in reversed(range(len(S_dash) - len(T) + 1)):
flg = 1
for j in range(len(T)):
if S_dash[i + j] != "?" and S_dash[i + j] != T[j]:
flg = 0
break
if flg:
for j in range(len(T)):
S_dash[i + j] = T[j]
break
if flg:
for i in range(len(... |
s747239405 | p03565 | u609061751 | 1573893272 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3444 | 531 | import copy
S = input()
T = input()
I = []
S1 = []
for k in range(len(S)):
if S[k] == '?':
S1.append("a")
else:
S1.append(S[k])
for i in range(len(S)-len(T) + 1):
S_ = copy.deepcopy(S1)
flag = 1
for j in range(i, i + len(T)):
if S[j] != T[j-i] and S[j] != "?":
fla... |
s887621954 | p03565 | u609061751 | 1573893049 | Python | Python (3.4.3) | py | Runtime Error | 25 | 3444 | 530 | import copy
S = input()
T = input()
I = []
S1 = []
for k in range(len(S)):
if S[k] == '?':
S1.append("a")
else:
S1.append(S[k])
for i in range(len(S)-len(T) + 1):
S_ = copy.deepcopy(S1)
flag = 1
for j in range(i, i + len(T)):
if S[j] != T[j-i] and S[j] != "?":
fla... |
s255565188 | p03565 | u156896646 | 1573794197 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 394 | ef agree(s1, t1):
for i in range(len(t1)):
if not(s1[i] == t1[i] or s1[i] =='?'):
return False
return True
s = input()
t = input()
ls, lt = len(s), len(t)
ss =[]
for i in range(ls - lt +1):
#print(s[i:i+lt], t)
if agree(s[i:i+lt], t):
ss.append( (s[:i]+t).replace('?', 'a... |
s034719197 | p03565 | u386170566 | 1573702828 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 681 | s = list(input())
t = list(input())
a = len(s)
b = len(t)
#最小の文字列となるためには前にaを固めたほうが良いため後ろから入れる
for i in range(a-b,-1,-1):
t_kamo = s[i:i+b]
count = 0
for j in range(b):
if t_kamo[j] == t[j] or t_kamo[j] == "?":
count += 1
if count == b:
#replaceメソット(リストには使えない,strに直接使う?)
... |
s053212270 | p03565 | u637551956 | 1573678325 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 447 | S=list(str(input()))
T=list(str(input()))
len_T=len(T)
len_S=len(S)
ST=len_S-len_T
for i in range(ST+1):
judge=True
S_strip=S[ST-i:len_S-i]
for j,k in zip(T,S_strip):
if j==k or k=='?':
pass
else:
judge=False
break
if judge:
S[ST-i:len_S-i]=T
... |
s941925664 | p03565 | u637551956 | 1573677473 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 451 | S=list(str(input()))
T=list(str(input()))
len_T=len(T)
len_S=len(S)
ST=len_S-len_T
for i in range(ST+1):
judge=True
S_strip=S[ST-i:len_S-i]
for j,k in zip(T,S_strip):
if j==k or k=='?':
continue
else:
judge=False
break
if judge:
S[ST-i:len_S-i]... |
s538315578 | p03565 | u637551956 | 1573677060 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 451 | S=list(str(input()))
T=list(str(input()))
len_T=len(T)
len_S=len(S)
ST=len_S-len_T
for i in range(ST+1):
judge=True
S_strip=S[ST-i:len_S-i]
for j,k in zip(T,S_strip):
if j==k or k=='?':
continue
else:
judge=False
break
if judge:
S[ST-i:len_S-i]... |
s967290088 | p03565 | u637551956 | 1573675465 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 523 | S=list(str(input()))
T=list(str(input()))
len_T=len(T)
len_S=len(S)
for i in range(len_S-len_T+1):
judge=True
S_strip=S[i:i+len_T]
for j,k in zip(T,S_strip):
if j==k or k=='?':
continue
else:
judge=False
break
if judge:
S_letter="".join(S_strip... |
s240330252 | p03565 | u637551956 | 1573675334 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 523 | S=list(str(input()))
T=list(str(input()))
len_T=len(T)
len_S=len(S)
for i in range(len_S-len_T+1):
judge=True
S_strip=S[i:i+len_T]
for j,k in zip(T,S_strip):
if j==k or k=='?':
continue
else:
judge=False
break
if judge:
S_letter="".join(S_strip... |
s994726234 | p03565 | u469953228 | 1573600821 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 350 | s=input()
t=input()
score = 0
L = []
for i in range(len(s)-len(t)+1):
cut = s[i:i+len(t)]
for j in range(len(t)):
if cut[j] == t[j] or cut[j] =="?":
score += 1
if score == len(t):
s = s[:i] + t + s[i+len(t):]
L.append(s.replace("?","a"))
score = 0
if L = []:
print("UNRESTORABLE")
else:
L =... |
s614752932 | p03565 | u153902122 | 1573540813 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 335 | S = input()
T = input()
for i in reversed(range(len(S) - len(T) + 1)):
if checker(S[i:(i + len(T))], T):
S = S.replace('?', 'a')
print(S[:i] + T + S[i + len(T):])
exit()
print('UNRESTORABLE')
exit()
def checker(s, t):
for i in range(len(s)):
if s[i] != "?" and s[i] != t[i]:
return Fal... |
s661676118 | p03565 | u153902122 | 1573540759 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 335 | S = input()
T = input()
for i in reversed(range(len(S) - len(T) + 1)):
if checker(S[i:(i + len(T)), T]):
S = S.replace('?', 'a')
print(S[:i] + T + S[i + len(T):])
exit()
print('UNRESTORABLE')
exit()
def checker(s, t):
for i in range(len(s)):
if s[i] != "?" and s[i] != t[i]:
return Fal... |
s259507772 | p03565 | u153902122 | 1573540675 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 333 | S = input()
T = input()
for i in reversed(range(len(S) - len(T) + 1)):
if checker(S[i:(i + len(T)), T]):
S = S.replace('?', 'a')
print(S[:i] + T + S[i + len(T):])
return
print('UNRESTORABLE')
def checker(s, t):
for i in range(len(s)):
if s[i] != "?" and s[i] != t[i]:
return False... |
s173252753 | p03565 | u779455925 | 1573503268 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 391 | Sz=list(input())
T=list(input())
for i in range(len(Sz)-len(T),-1,-1):
Flag=1
for s in range(len(T)):
if not (Sz[i+s]=="?" or Sz[i+s]==T[s]):
Flag=0
break
if Flag:
for s in range(len(T)):
Sz[i+s]=T[s]
break
for i in range(len(Sz)):
if Sz[i]=... |
s263660085 | p03565 | u252828980 | 1573441463 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 495 | a = list(input())
b = list(input())
c = len(a)
d = len(b)
flag = False
for i in range(c-d+1):
li = [0]*c
for k in range(c):
li[k] = a[k]
for j in range(d):
if b[j] == a[i+j] or a[i+j] == "?":
flag = True
li[i+j] = b[j]
elif b[j] != a[i+j]:
flag = ... |
s516360337 | p03565 | u073549161 | 1573060689 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 665 | s = input()
t = input()
for i in range(len(s) - len(t) + 1):
can = True
for j in range(len(t)):
if s[i + j] == "?" or s[i + j] == t[j]:
continue
else:
can = False
break
if can:
break
if can:
res = []
for j in range(i):
if s[j] == "?... |
s498296222 | p03565 | u215315599 | 1573009375 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3064 | 670 | S = input()
T = input()
i = 0
j = 0
flg1 = True
flg2 = False
while i < len(S):
while j < len(T):
if S[i] == T[j] or S[i] == "?":
if flg1:
tmp = i
flg1 = False
j += 1
else:
flg1 = True
i = tmp
j = 0
if... |
s622708664 | p03565 | u215315599 | 1573008923 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 11976 | 679 | S = input()
T = input()
i = 0
j = 0
flg1 = True
print(i)
while i < len(S):
print(i)
while j < len(T):
if S[i] == T[j] or S[i] == "?":
if flg1:
tmp = i
flg1 = False
j += 1
else:
flg1 = True
i = tmp
j = 0
... |
s803147661 | p03565 | u768896740 | 1572566159 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 710 | s = list(input())
t = list(input())
def check_context(a, b):
ss = s.copy()
if a <= b:
return []
if len(s[a:]) < len(t[b:]):
return []
ss[a-b:a-b+len(t)] = t[:]
return ss
x = []
count = 0
for i in range(len(s)):
if s[i] == '?':
continue
for j in range(len(t)):
... |
s631199482 | p03565 | u768896740 | 1572481443 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 534 | s = list(input())
t = list(input())
def check_context(a, b):
ss = s.copy()
if a <= b:
return []
if len(s[a:]) < len(t[b:]):
return []
ss[a-b:a-b+len(t)] = t[:]
return ss
for i in range(len(s)):
for j in range(len(t)):
if s[i] == t[j]:
x = check_context(i,... |
s790031011 | p03565 | u768896740 | 1572481376 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 514 | s = list(input())
t = list(input())
def check_context(a, b):
ss = s.copy()
if a <= b:
return []
if len(s[a:]) < len(t[b:]):
return []
ss[a-b:a-b+len(t)] = t[:]
return ss
for i in range(len(s)):
for j in range(len(t)):
if s[i] == t[j]:
x = check_context(i,... |
s748230828 | p03565 | u117348081 | 1572452181 | Python | PyPy3 (2.4.0) | py | Runtime Error | 181 | 38256 | 370 | s = input()
t = input()
n = len(s)
m = len(t)
ans = []
for i in range(n-m+1):
flag = True
for j in range(m):
if s[i+j]!="?" and s[i+j]!=t[j]:
flag = False
break
if flag:
tmp = (s[:i] + t + s[(i+m):]).raplace("?","a")
ans.append(tmp)
ans.sort()
if len(ans)>0:... |
s123049437 | p03565 | u117348081 | 1572452060 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 358 | s = input()
t = input()
n = len(s)
m = len(t)
ans = []
for i in range(n-m+1):
flag = True
for j in range(m):
if s[i+j]!="?" and s[i+j]!=t[j]:
flag = False
break
if flag:
tmp = (s[:i]+t+s[(i+m):]).raplace("?","a")
ans.append(tmp)
ans.sort()
if ans:
print(a... |
s768157952 | p03565 | u117348081 | 1572451836 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 497 | s = input()
t = input()
n = len(s)
m = len(t)
i = 0
j = 0
point = []
if n<m:
print("UNRESTORABLE")
exit()
while i<n:
if s[i]==t[j] or s[i]=="?":
j+=1
i+=1
else:
j=0
i+=1
if j==m:
point.append(i-m)
j = 0
i -=m
i+=1
if len(point)==0:
... |
s176000463 | p03565 | u117348081 | 1572451800 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 493 | s = input()
t = input()
n = len(s)
m = len(t)
i = 0
j = 0
point = []
if n<m:
print("UNRESTORABLE")
exit()
while i<n:
if s[i]==t[j] or s[i]=="?":
j+=1
i+=1
else:
j=0
i+=1
if j==m:
point.append(i-m)
j = 0
i -=m
i+=1
if len(point)==0:
... |
s244469983 | p03565 | u117348081 | 1572451763 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 516 | s = input()
t = input()
n = len(s)
m = len(t)
i = 0
j = 0
point = []
if n<m:
print("UNRESTORABLE")
exit()
while i<n:
if s[i]==t[j] or s[i]=="?":
j+=1
i+=1
else:
j=0
i+=1
if j==m:
point.append(i-m)
j = 0
i -=m
i+=1
if len(point)==0:
... |
s979060191 | p03565 | u117348081 | 1572450630 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 683 | s = list(input())
t = list(input())
n = len(s)
m = len(t)
i = 0
j = 0
point = []
if n<m:
print("UNRESTORABLE")
exit()
while i<n:
if s[i]==t[j] or s[i]=="?":
j+=1
i+=1
else:
j=0
i+=1
if j==m:
point.append(i-m)
if len(point)==0:
print("UNRESTORABLE")
ex... |
s932073746 | p03565 | u965436898 | 1572403852 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 1208 | import re
s1 = input()
t = input()
pre = ""
count = 0
ans = ""
start = 0
end = 0
it = ""
for w in s1:
if count > len(t) - 1:
dif = count - (len(t) - 1)
count -= dif
it = it[dif:]
print(f"count is{count}" )
if w == t[count]:
count += 1
it += w
elif pre == "?" and w == t[0]:
count = 1
... |
s458535497 | p03565 | u965436898 | 1572401927 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3188 | 1040 | import re
s1 = input()
t = input()
pre = ""
count = 0
ans = ""
start = 0
end = 0
it = ""
for w in s1:
if w == t[count]:
count += 1
it += w
elif pre == "?" and w == t[0]:
count += 1
it += w
elif w != "?" and pre == "?":
pre = w
count = 0
it = ""
elif w == "?" and pre == "?":
coun... |
s349500097 | p03565 | u965436898 | 1572401872 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3188 | 1039 | import re
s1 = input()
t = input()
pre = ""
count = 0
ans = ""
start = 0
end = 0
it = ""
for w in s1:
if w == t[count]:
count += 1
it += w
elif pre == "?" and w == t[0]:
count = 1
it += w
elif w != "?" and pre == "?":
pre = w
count = 0
it = ""
elif w == "?" and pre == "?":
count... |
s004819022 | p03565 | u965436898 | 1572401535 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3188 | 1038 | import re
s1 = input()
t = input()
pre = ""
count = 0
ans = ""
start = 0
end = 0
it = ""
for w in s1:
if w == t[count]:
count += 1
it += w
elif pre == "?" and w == t[0]:
count = 1
it = w
elif w != "?" and pre == "?":
pre = w
count = 0
it = ""
elif w == "?" and pre == "?":
count ... |
s829839501 | p03565 | u965436898 | 1572400906 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3188 | 980 | import re
s1 = input()
t = input()
pre = ""
count = 0
ans = ""
start = 0
end = 0
it = ""
for w in s1:
if w == t[count]:
count += 1
it += w
elif w != "?" and pre == "?":
pre = w
count = 0
it = ""
elif w == "?" and pre == "?":
count += 1
it += w
else:
if w == "?":
pre = w
... |
s488496431 | p03565 | u965436898 | 1572358760 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3188 | 980 | import re
s1 = input()
t = input()
pre = ""
count = 0
ans = ""
start = 0
end = 0
it = ""
for w in s1:
if w != "?" and pre == "?":
pre = w
count = 0
it = ""
elif w == "?" and pre == "?":
count += 1
it += w
elif w == t[count]:
count += 1
it += w
else:
if w == "?":
pre = w
... |
s258320934 | p03565 | u672494157 | 1572116591 | Python | PyPy3 (2.4.0) | py | Runtime Error | 190 | 38768 | 1768 | import sys
from functools import reduce
import copy
import math
from pprint import pprint
import collections
import bisect
sys.setrecursionlimit(4100000)
def inputs(num_of_input):
ins = [input() for i in range(num_of_input)]
return ins
def int_inputs(num_of_input):
ins = [int(input()) for i in range(n... |
s247357587 | p03565 | u136654378 | 1571785152 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3188 | 1060 | #!/usr/bin/env python3
import re
No = "UNRESTORABLE"
def main():
S = input()
T = input()
T_LEN = len(T)
match_index = []
for i in range(len(S) - T_LEN + 1):
for idx in range(T_LEN):
if S[i:i+T_LEN][idx] == T[idx] or S[i:i+T_LEN][idx] == "?":
continue
... |
s453728462 | p03565 | u136654378 | 1571785070 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3188 | 1060 | #!/usr/bin/env python3
import re
No = "UNRESTORABLE"
def main():
S = input()
T = input()
T_LEN = len(T)
match_index = []
for i in range(len(S) - T_LEN + 1):
for idx in range(T_LEN):
if S[i:i+T_LEN][idx] == T[idx] or S[i:i+T_LEN][idx] == "?":
continue
... |
s639572356 | p03565 | u989345508 | 1571774541 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 999 | 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] and s[... |
s945925546 | p03565 | u989345508 | 1571774506 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 969 | 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] and s[... |
s446087016 | p03565 | u989345508 | 1571774356 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 939 | 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] and s[... |
s320621403 | p03565 | u989345508 | 1571773836 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 910 | 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] and s[... |
s099981008 | p03565 | u989345508 | 1571773717 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 912 | 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 ... |
s155589959 | p03565 | u989345508 | 1571773476 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3192 | 935 | 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 ... |
s607753951 | p03565 | u475584892 | 1571708259 | Python | PyPy3 (2.4.0) | py | Runtime Error | 283 | 63980 | 929 | def slove():
import sys
import bisect
import collections
import fractions
import heapq
import itertools
input = sys.stdin.readline
s = str(input().rstrip('\n'))
t = str(input().rstrip('\n'))
if len(t) <= len(s):
for i in range(len(s) - len(t), -1, -1):
b = Tru... |
s938880735 | p03565 | u475584892 | 1571708179 | Python | PyPy3 (2.4.0) | py | Runtime Error | 290 | 63980 | 832 | def slove():
import sys
import bisect
import collections
import fractions
import heapq
import itertools
input = sys.stdin.readline
s = str(input().rstrip('\n'))
t = str(input().rstrip('\n'))
for i in range(len(s) - len(t), -1, -1):
b = True
for j in range(len(t)):... |
s653042993 | p03565 | u475584892 | 1571708134 | Python | PyPy3 (2.4.0) | py | Runtime Error | 320 | 66028 | 866 | def slove():
import sys
import bisect
import collections
import fractions
import heapq
import itertools
input = sys.stdin.readline
s = str(input().rstrip('\n'))
t = str(input().rstrip('\n'))
for i in range(len(s) - len(t), -1, -1):
b = True
for j in range(len(t)):... |
s723997146 | p03565 | u475584892 | 1571707863 | Python | PyPy3 (2.4.0) | py | Runtime Error | 274 | 64236 | 813 | def slove():
import sys
import bisect
import collections
import fractions
import heapq
import itertools
input = sys.stdin.readline
s = str(input().rstrip('\n'))
t = str(input().rstrip('\n'))
for i in range(len(s) - len(t), -1, -1):
b = True
for j in range(len(t)):... |
s975017644 | p03565 | u311379832 | 1571622736 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 562 | import sys
S = input()
T = input()
ans = 'UNRESTORABLE'
if len(S) < len(T):
print(ans)
sys.exit()
if S.count(T) != 0:
S = S.replace('?', 'a')
print(S)
sys.exit()
for i in range(len(S)):
tmp = True
s = i
e = i + len(T)
for j in range(len(T)):
if S[i + j] != '?' and\
... |
s341888345 | p03565 | u311379832 | 1571621091 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 522 | import sys
S = input()
T = input()
ans = 'UNRESTORABLE'
if S.count(T) != 0:
S = S.replace('?', 'a')
print(S)
sys.exit()
for i in range(len(S) - len(T) + 1):
tmp = True
s = i
e = i + len(T)
for j in range(len(T)):
if S[i + j] != '?' and\
S[i + j] != T[j]:
tmp ... |
s409934640 | p03565 | u518042385 | 1571463537 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 586 | w=input()
w1=input()
num=len(w)
num1=len(w1)
start=-1
if num<num1:
b1=False
for i in range(num-num1+1):
b=True
for j in range(num1):
if w[i+j]=="?" or w[i+j]==w1[j]:
pass
else:
b=False
if b:
start=i
if start==-1:
print("UNRESTORABLE")
else:
word=""
if start!=0:
for i in range... |
s073297054 | p03565 | u518042385 | 1571463183 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 587 | w=input()
w1=input()
num=len(w)
num1=len(w1)
start=-1
if num<num1:
b1=False
for i in range(num-num1+1):
b=True
for j in range(num1):
if w[i+j]=="?" or w[i+j]==w1[j]:
pass
else:
b=False
if b:
start=i
if start==-1:
print("UNRESTORABLE")
else:
word=""
if start!=0:
for i in range... |
s502388496 | p03565 | u518042385 | 1571451942 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 588 | w=input()
w1=input()
num=len(w)
num1=len(w1)
if num<num1:
b=False
for i in range(num-num1+1):
b=True
for j in range(num1):
if w[i+j]=="?" or w[i+j]==w1[j]:
pass
else:
b=False
if b:
start=i
break
if not b:
print("UNRESTORABLE")
else:
word=""
if start!=0:
for i in range(s... |
s997481964 | p03565 | u518042385 | 1571451739 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 592 | w=input()
w1=input()
num=len(w)
num1=len(w1)
if num<num1:
b=False
for i in range(num-num1+1):
b=True
for j in range(i,i+num1):
if w[i+j]=="?" or w[i+j]==w1[j]:
pass
else:
b=False
if b:
start=i
break
if not b:
print("UNRESTORABLE")
else:
word=""
if start!=0:
for i in ran... |
s088775729 | p03565 | u518042385 | 1571451593 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 572 | w=input()
w1=input()
num=len(w)
num1=len(w1)
for i in range(num-num1+1):
b=True
for j in range(i,i+num1):
if w[i+j]=="?" or w[i+j]==w1[j]:
pass
else:
b=False
if b:
start=i
break
if not b:
print("UNRESTORABLE")
word=""
else:
if start!=0:
for i in range(start):
if w[i]=... |
s337711343 | p03565 | u126823513 | 1571421693 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 417 | sd = input()
t = input()
li_answer = list()
c_loop = len(sd) - len(t) + 1
for i in range(c_loop):
if all((w_sd == "?" or w_sd == w_t) for w_sd, w_t in zip(sd[i:i + len(t) + 1], t)):
s_tmp = str(sd[0:i] + t + sd[i + len(t):]).replace("?", "a")
li_answer.append(s_tmp)
if li_answer:
print(sorted(... |
s252805492 | p03565 | u518042385 | 1571421495 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 715 | S = list(str(input()))
T = list(str(input()))
s = len(S)
t = len(T)
for i in range(t,s+1):
det = 0
for j in range(t):
if S[-i+j] != T[j] and S[-i+j] != "?":
det = -1
break
if s<t:
det=2
if det == 0:
ans = ["X"] * s
for k in range(t):
ans... |
s109902422 | p03565 | u512007680 | 1571419842 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 675 | S = list(str(input()))
T = list(str(input()))
s = len(S)
t = len(T)
for i in range(t,s+1):
det = 0
for j in range(t):
if S[-i+j] != T[j] and S[-i+j] != "?":
det = -1
break
if det == 0:
ans = ["X"] * s
for k in range(t):
ans[-i+k] = T[k]
fo... |
s110874021 | p03565 | u512007680 | 1571419259 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 673 | S = list(str(input()))
T = list(str(input()))
s = len(S)
t = len(T)
for i in range(t,s+1):
det = 0
for j in range(t):
if S[-i+j] != T[j] and S[-i+j] != "?":
det = -1
break
if det == 0:
ans = [0] * s
for k in range(t):
ans[-i+k] = T[k]
for ... |
s922996537 | p03565 | u215315599 | 1571186959 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 668 | import sys
import os
S = input()
T = input()
cnt = 0 #Tで置き換える必要のある?の個数
i = 1
j = 1
while j < len(S):
if T[-i] == S[-j]:
i += 1
elif S[-j] == "?":
i += 1
cnt += 1
else:
i, cnt = 1, 0
j += 1
if i == len(T) and (T[-i] == S[-j] or S[-j] == "?"):
for l in range(len... |
s400827134 | p03565 | u215315599 | 1571186576 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 645 | import sys
import os
S = input()
T = input()
cnt = 0 #Tで置き換える必要のある?の個数
i = 1
j = 1
while j < len(S):
if T[-i] == S[-j] or S[-j] == "?":
i += 1
cnt += 1
else:
i, cnt = 1, 1
j += 1
if i == len(T) and (T[-i] == S[-j] or S[-j] == "?"):
for l in range(len(S)):
if ... |
s147361582 | p03565 | u215315599 | 1571186478 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 644 | import sys
import os
S = input()
T = input()
cnt = 0 #Tで置き換える必要のある?の個数
i = 1
j = 1
while j < len(S):
if T[-i] == S[-j] or S[-j] == "?":
i += 1
cnt += 1
else:
i, cnt = 1, 1
j += 1
if i == len(T) and (T[-i] == S[-j] or S[-j] == "?"):
for l in range(len(S)):
if S... |
s102308092 | p03565 | u215315599 | 1571058631 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 623 | import sys
S = input()
T = input()
cnt = 0 #Tで置き換える必要のある?の個数
i = 0
j = 0
while j < len(S):
if T[-i] == S[-j] or S[-j] == "?":
i += 1
cnt += 1
else:
i, cnt = 0, 0
j += 1
if i == len(T) and (T[-i] == S[-j] or S[-j] == "?"):
l = 0
for l in range(len(S)):
... |
s713767521 | p03565 | u256031597 | 1570992931 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 747 |
S = input()
T = input()
ans = "UNRESTORABLE"
if len(T)>len(S):
ans = "UNRESTORABLE"
else:
Slr = list(S[::-1])
Tlr = list(T[::-1])
for i in range(len(S)-len(T)+1):
flag = True
for j in range(len(T)):
if Slr[i+j]==Tlr[j] or Slr[i+j]=="?":
pass
... |
s131029801 | p03565 | u256031597 | 1570992885 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 726 |
S = input()
T = input()
if len(T)>len(S):
ans = "UNRESTORABLE"
else:
Slr = list(S[::-1])
Tlr = list(T[::-1])
for i in range(len(S)-len(T)+1):
flag = True
for j in range(len(T)):
if Slr[i+j]==Tlr[j] or Slr[i+j]=="?":
pass
else:
... |
s717757747 | p03565 | u256031597 | 1570992474 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 704 |
S = input()
T = input()
if len(T)>len(S):
ans = "UNRESTORABLE"
else:
Slr = list(S[::-1])
Tlr = list(T[::-1])
for i in range(len(S)-len(T)+1):
flag = True
for j in range(len(T)):
if Slr[i+j]==Tlr[j] or Slr[i+j]=="?":
pass
else:
... |
s649789603 | p03565 | u256031597 | 1570992358 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 567 |
S = input()
T = input()
Slr = list(S[::-1])
Tlr = list(T[::-1])
for i in range(len(S)-len(T)+1):
flag = True
for j in range(len(T)):
if Slr[i+j]==Tlr[j] or Slr[i+j]=="?":
pass
else:
flag = False
break
if flag:
for j in range(len(T)):
... |
s581707838 | p03565 | u202471186 | 1570817326 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 1089 | Sprime = input() # S'の入力
T = input() # Tの入力
S = [] # Sの候補をlistで管理
if len(Sprime) < len(T): # S'の文字列長がTの文字列長よりも短い場合はそもそもSが存在しえない
print("UNRESTORABLE")
exit()
for i in range(len(Sprime) - len(T) + 1): # 左からTを入れられるか見ていく
flag = 0 # 文字が一致しえないことのflagを初期化
if Sprime[i] == T[0] or Sprime[i] == "?":
for j... |
s990272431 | p03565 | u202471186 | 1570817195 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 937 | # coding: utf-8
Sprime = input() # S'の入力
T = input() # Tの入力
S = [] # Sの候補をlistで管理
if len(Sprime) < len(T): # S'の文字列長がTの文字列長よりも短い場合はそもそもSが存在しえない
print("UNRESTORABLE")
exit()
for i in range(len(Sprime) - len(T) + 1): # 左からTを入れられるか見ていく
flag = 0 # 文字が一致しえないことのflagを初期化
if Sprime[i] == T[0] or Sprime[i] == "?... |
s689977298 | p03565 | u223904637 | 1570682651 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 465 | s=list(input())
t=list(input())
n=len(s)
m=len(t)
if m>n:
print('UNRESTORABLE')
exit()
af=0
for i in range(n-m+1):
k=s[n-m-i:n-i]
f=0
for j in range(m):
if k[i]=='?' or k[i]==t[i]:
f+=1
if f==m:
af+=1
s[n-m-i:n-i]=t
break
if af>0:
ans=''
for i ... |
s834523414 | p03565 | u622045059 | 1570422228 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 420 | S = input()
T = input()
t_len = len(T)
found = False
for i in range(len(S)-len(T), -1,-1):
for j in range(len(T)):
if S[i+j] != T[j] and S[i+j] != '?':
break
else:
if i + t_len == len(S):
S = S[:i] + T
else:
S = S[:i] + T + S[i+tlen:]
found = ... |
s543244421 | p03565 | u761989513 | 1570389715 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3188 | 688 | sd = input()
t = input()
n = len(sd)
m = len(t)
ss = []
for i in range(n - m + 1):
flag = True
s = ""
for j in range(m):
if sd[i + j] == "?" or sd[i + j] == t[j]:
continue
else:
flag = False
if flag:
k = 0
for j in range(n):
if j < i or... |
s314897521 | p03565 | u970082363 | 1570317761 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3064 | 601 | import os
def qcount(s,t,count):
if s=="?" or s==t:
count += 1
return count
else:
return 0
S = list(input())
T = list(input())
count = 0
i = 0
result =False
if len(S)>=len(T):
while len(S)-i:
count = qcount(S[i],T[count],count)
if count == len(T):
i = l... |
s343401872 | p03565 | u970082363 | 1570317700 | Python | Python (3.4.3) | py | Runtime Error | 2103 | 3064 | 612 | import os
def qcount(s,t,count):
if s=="?" or s==t:
count += 1
return count
else:
return 0
S = list(input())
T = list(input())
count = 0
i = 0
result =False
if len(S)>=len(T):
while len(S)-i:
count = qcount(S[i],T[count],count)
if count == len(T):
i = le... |
s128093111 | p03565 | u539517139 | 1570219881 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 387 | s=input()
t=input()
u='UNRESTORABLE'
a=[]
if len(s)>=len(t):
for i in range(len(s)-len(t)+1):
f=0
for j in range(i,i+len(t)):
if s[j]!='?' and s[j]!=t[j-i]:
f=1
if f==0:
for j in range(i,i+len(t)):
if s[j]=='?':
m=s[:j]+t[j-i]+s[j+1:]
m=m.replace('?','a')
... |
s278936392 | p03565 | u623687794 | 1570219722 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 320 | s=input()
t=input()
strs=[]
S=len(s)
T=len(t)
for i in range(S-T+1):
flag=0
for j in range(T):
if S[i+j]=="?":
continue
if S[i+j]!=T[j]:
flag=1;break
if flag==0:
posstr=s[:i]+t+s[i+T:]
posstr.replace("?","a")
strs.append(posstr)
if strs==[]:print("UNRESTORABLE")
else:print(strs[0]) |
s977880099 | p03565 | u539517139 | 1570219701 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 349 | s=input()
t=input()
u=['UNRESTORABLE']
if len(s)>=len(t):
for i in range(len(s)-len(t)+1):
f=0
for j in range(i,i+len(t)):
if s[j]!='?' and s[j]!=t[j-i]:
f=1
if f==0:
for j in range(i,i+len(t)):
if s[j]=='?':
m=s[:j]+t[j-i]+s[j+1:]
m=m.replace('?','a')
u.a... |
s648028614 | p03565 | u539517139 | 1570219632 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 349 | s=input()
t=input()
u=['UNRESTORABLE']
if len(s)>=len(t):
for i in range(len(s)-len(t)+1):
f=0
for j in range(i,i+len(t)):
if s[j]!='?' and s[j]!=t[j-i]:
f=1
if f==0:
for j in range(i,i+len(t)):
if s[j]=='?':
m=s[:j]+t[j-i]+s[j+1:]
m=m.replace('?','a')
a.a... |
s665272266 | p03565 | u311636831 | 1570136331 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 523 | S = input()
T = input()
lenS=len(S)
lenT=len(T)
ans=["a"]*lenS
for i in range (lenS):
if(S[i]!="?"):
ans[i]=S[i]
for j in range(lenS-lenT):
flag=1
for i in range (lenS):
if(S[i]=="?"):
ans[i]="a"
for i in range(1,lenT+1):
if((S[lenS-i-j]!="?")&(S[lenS-i-j]!=T[lenT-i... |
s967246643 | p03565 | u033606236 | 1569980029 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 390 | s = input()
S = input()
flag = False
for i in range(len(s)-len(S)+1):
if s[i] == S[0] or s[i] == "?":
a = s[i:i+len(S)]
for j in range(len(S)):
if a[j] == S[j] or a[j] == "?":
continue
break
else:
flag = True
s = s[0:i]+S+s[i+le... |
s019567871 | p03565 | u711539583 | 1569850724 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 421 | s = input()
t = input()
def check(a, b):
if a == '?':
return True
else:
return a == b
cand = []
for i in range(len(s)-len(t)+1):
flag = True
c = list(s)
for j in range(len(t)):
if not check(s[i+j], t[j]):
flag = False
break
c[i+j] = t[j]
if flag:
cs = ''.join(c)
cand(c... |
s437749935 | p03565 | u711539583 | 1569850671 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 419 | s = input()
t = input()
def check(a, b):
if a == '?':
return True
else:
return a == b
cand = []
for i in range(len(s)-len(t)+1):
flag = True
c = list(s)
for j in range(len(t)):
if not check(s[i+j], t[j]):
flag = False
break
c[i+j] = t[j]
if flag:
s = ''.join(c)
cand(s.... |
s476488891 | p03565 | u506910932 | 1569794278 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 542 | s = list(input())
t = list(input())
len_t = len(t)
for i in range(len(s) - len(t) + 1):
tmps = s[i:i + len(t)]
ok = True
for j in range(len(tmps)):
if t[j] == tmps[j] or tmps[j] == '?':
pass
else:
ok = False
break
if ok == True:
for k in range... |
s677867344 | p03565 | u698176039 | 1569341292 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 495 | S = list(input())
T = list(input())
#S = list('??p??d??')
#T = list('abc')
Ns = len(S)
Nt = len(T)
flag = True
for i in range(Ns - Nt+1):
for j in range(Nt):
if not(S[i+j] == T[j] or S[i+j] == '?'):
break
else:
flag = True
break
if flag:
ans = S
for j in range(... |
s181072509 | p03565 | u698176039 | 1569340963 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 448 | S = list(input())
T = list(input())
Ns = len(S)
Nt = len(T)
ans = S
flag = True
for i in range(Ns - Nt+1):
for j in range(Nt):
if not(S[i+j] == T[i+j] or S[i+j] == '?'):
break
else:
flag = True
break
if flag:
for j in range(Nt):
ans[i+j] = T[j]
for k in rang... |
s702048087 | p03565 | u957167787 | 1569177302 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 605 | S = input()
T = input()
N, M = len(S), len(T)
# N>=Mのとき
for i in range(max(0,N-M), -1, -1):
# 今着目しているSの部分
now = S[i:i+M]
# nowにTを入れられるかチェック
for j in range(M):
if now[j] == '?' or now[j] == T[j]:
continue
else:
break
else:
# 入れられるならその部分をTに置換
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.