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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s404446086 | p03565 | u255673886 | 1586019916 | Python | PyPy3 (2.4.0) | py | Runtime Error | 173 | 38256 | 1214 | import sys
readline = sys.stdin.buffer.readline
from collections import deque
from copy import copy,deepcopy
from itertools import permutations,combinations
from pprint import pprint
def myinput():
return map(int,input().split())
def mycol(data,col):
return [ row[col] for row in data ]
def mysort(data,col):... |
s624528875 | p03565 | u255673886 | 1586018567 | Python | PyPy3 (2.4.0) | py | Runtime Error | 174 | 38384 | 996 | import sys
readline = sys.stdin.buffer.readline
from collections import deque
from copy import copy,deepcopy
from itertools import permutations,combinations
from pprint import pprint
def myinput():
return map(int,input().split())
def mycol(data,col):
return [ row[col] for row in data ]
def mysort(data,col):... |
s661940522 | p03565 | u724687935 | 1585740185 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 455 | S = input()
T = input()
offset = len(S) - len(T)
ans = []
for d in range(offset + 1):
A = ''
Td = '?' * d + T
for i in range(len(S)):
if i < len(Td) and S[i] != Td[i] and '?' not in [S[i], Td[i]]:
break
else:
c = S[i] if Td[i] == '?' else Td[i]
A += c
... |
s365075356 | p03565 | u724687935 | 1585732708 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 558 | Sx = input()
T = input()
offset = len(Sx) - len(T) + 1
check = [1] * offset
ans = 'UNRESTORABLE'
if len(Sx) >= len(T):
for d in range(offset):
for j in range(len(T)):
check[d] &= (Sx[j + d] == T[j] or Sx[j + d] == '?')
if any(check):
k = max(k for k, c in enumerate(check) if c... |
s346546721 | p03565 | u757030836 | 1585578644 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3188 | 215 | import re
s = iput().replace("?",".")
t = input()
for i in range(len(s)-len(t)+1):
if re.match(s[i:i+len(t)],t):
s = s.replace(".","a")
print(s[:i] + t + s[i+len(t):])
exit()
print("UNRESTORABLE")
|
s787501221 | p03565 | u576432509 | 1585503913 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 533 | sd=list(input())
t=list(input())
for i in range(len(sd)-len(t)+1):
ii=len(sd)-len(t)-i
yn=""
for j in range(len(t)):
if sd[ii+j]!=t[j] and sd[ii+j]!="?":
yn="NG"
break
if yn=="NG":
continue
else:
yn="yes"
break
if yn=="NG":
print("UN... |
s341499683 | p03565 | u576432509 | 1585503568 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 568 | sd=list(input())
t=list(input())
for i in range(len(sd)-len(t)+1):
ii=len(sd)-len(t)-i
yn=""
for j in range(len(t)):
if sd[ii+j]!=t[j] and sd[ii+j]!="?":
yn="NG"
break
if yn=="NG":
continue
else:
yn="yes"
break
if yn=="NG":
print("UN... |
s872081912 | p03565 | u576432509 | 1585503413 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 593 | sd=list(input())
t=list(input())
sd=list(sts)
t=list(ts)
for i in range(len(sd)-len(t)+1):
ii=len(sd)-len(t)-i
yn=""
for j in range(len(t)):
if sd[ii+j]!=t[j] and sd[ii+j]!="?":
yn="NG"
break
if yn=="NG":
continue
else:
yn="yes"
break
if... |
s574659716 | p03565 | u576432509 | 1585435667 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 640 | sd=list(input())
t=list(input())
#sts="?tc????"
#ts="coder"
#sts="??p??d??"
#ts="abc"
#sd=list(sts)
#t=list(ts)
for i in range(len(sd)-len(t)+1):
ii=len(sd)-len(t)-i
yn=""
for j in range(len(t)):
if sd[ii+j]!=t[j] and sd[ii+j]!="?":
yn="NG"
break
if yn=="NG":
c... |
s816263148 | p03565 | u576432509 | 1585435300 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 659 | sd=list(input())
t=list(input())
#sts="?tc????"
#ts="coder"
#sts="??p??d??"
#ts="abc"
#sd=list(sts)
#t=list(ts)
for i in range(len(sd)-len(t)):
ii=len(sd)-len(t)-i
yn=""
for j in range(len(t)):
if sd[ii+j]!=t[j] and sd[ii+j]!="?":
yn="NG"
break
if yn=="NG":
con... |
s750689415 | p03565 | u576432509 | 1585434715 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 647 | sd=list(input())
t=list(input())
#sts="?tc????"
#ts="coder"
#sts="??p??d??"
#ts="abc"
#sd=list(sts)
#t=list(ts)
for i in range(len(sd)-len(t)):
ii=len(sd)-len(t)-i
yn=""
for j in range(len(t)):
if sd[ii+j]!=t[j] and sd[ii+j]!="?":
yn="NG"
break
if yn=="NG":
con... |
s755937925 | p03565 | u134520518 | 1585184415 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 390 | s = input()
t = input()
ans = []
for i in range(len(s)-(len(t)-1)):
f = True
for j in range(len(t)):
if s[-(j+i+1)] != t[-(j+1)] and s[-(j+i+1)] != '?':
f = False
if f == True:
s = s[:-(len(t)+i)] + t + s[len(s)-1-i:0]
s = s.replace('?','a')
ans.append(s)
if l... |
s943419058 | p03565 | u672898046 | 1584915027 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3188 | 343 | import re
s = input()
s = s.replace('?', '.')
t = input()
if len(t) > len(s):
print("UNRESTORABLE")
else:
r = []
for i in range(len(s)-len(t)+1):
m = re.match(s[i:i+len(t)], t)
if m is None:
continue
r.append((s[:i]+t+s[i+len(t):]).replace(".","a"))
if not r:
print('UNRESTORABLE')
quit... |
s697314998 | p03565 | u672898046 | 1584914750 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3188 | 347 | import re
s = input()
s = s.replace('?', '.')
t = input()
r = []
if len(t) > len(s):
print("UNRESTORABLE")
else:
for i in range(len(s)-len(t)+1):
m = re.match(s[i:i+len(t)], t)
if m is None:
continue
r.append((s[:i]+t+s[i+len(t):]).replace(".","a"))
if not r:
print('UNRESTORABLE')
quit()... |
s285160572 | p03565 | u515052479 | 1584804970 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 712 | s = list(input())
t = list(input())
n_s = len(s)
n_t = len(t)
last_num = -1
base = [i for i,x in enumerate(s) if x == str(t[0]) or "?"]
if n_s >= n_t:
for i in base:
if n_s - i >= n_t:
sign = 0
for j in range(i,i+n_t):
if not ((s[j] == t[j-i]) or (s[j] == "?")):
sign = 1
... |
s420692150 | p03565 | u515052479 | 1584804273 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 705 | s = list(input())
t = list(input())
n_s = len(s)
n_t = len(t)
last_num = -1
base = [i for i,x in enumerate(s) if x == str(t[0])]
if n_s >= n_t:
for i in base:
if n_s - i >= n_t:
sign = 0
for j in range(i,i+n_t):
if not ((s[j] == t[j-i]) or (s[j] == "?")):
sign = 1
i... |
s189573542 | p03565 | u515052479 | 1584803858 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3192 | 622 | s = list(input())
t = list(input())
n_s = len(s)
n_t = len(t)
last_num = -1
base = [i for i,x in enumerate(s) if x == str(t[0])]
for i in base:
if n_s - i >= n_t:
sign = 0
for j in range(i,i+n_t):
if not ((s[j] == t[j-i]) or (s[j] == "?")):
sign = 1
if sign == 0:
last_num =... |
s217914762 | p03565 | u935558307 | 1584795832 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 257 | s = input()
t = input()
tLen = len(t)
"""
sの中の?を.に置換する
"""
s.replace("?",".")
print(s)
for i in range(tLen,len(s)+1):
#[-i:(-i+tLen)]の区間の文字列が、tにマッチするかを調べる。マッチするなら置換する。 |
s775664888 | p03565 | u644972721 | 1584602831 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 614 | s = list(input())
t = list(input())
ans = [-1, -1]
if len(t) <= len(s):
for i in range(len(s) - len(t) + 1):
c = 1
for j in range(len(t)):
if s[i + j] != "?" and t[j] != s[i + j]:
c = 0
break
if c == 1:
ans = [i, i + len(t)]
if ans != ... |
s088010709 | p03565 | u051842502 | 1584596005 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3316 | 844 | from collections import deque
original_S=deque(input())
original_T=deque(input())
S=original_S.copy()
T=original_T.copy()
restored_S=deque()
while len(S)>=len(T)>0:
s=S.pop()
t=T.pop()
if s==t or s=='?':
restored_S.appendleft(t)
else:
copied_S=original_S.copy()
re_restored_S=... |
s716037825 | p03565 | u051842502 | 1584592537 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3316 | 793 | from collections import deque
original_S=deque(input())
original_T=deque(input())
S=original_S.copy()
T=original_T.copy()
restored_S=deque()
while len(S)>=len(T)>0:
s=S.pop()
t=T.pop()
if s==t or s=='?':
restored_S.appendleft(t)
else:
re_restored_S=deque()
for n in range(len(... |
s259496828 | p03565 | u734001128 | 1584237479 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 655 | import sys
input = sys.stdin.readline
s = input().rstrip("\n")
t = input().rstrip("\n")
flg = False
#cnt = 0
if len(s)-len(t)+1<0:
print("UNRESTOABLE")
sys.exit(0)
for i in range(len(s)-len(t)+1):
cnt = 0
for j in range(len(t)):
#print(s[i+j],t[j])
if s[i+j] == t[j] or s[i+j] == '?':
... |
s063314540 | p03565 | u372102441 | 1584233966 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 645 | #n = int(input())
#l = list(map(int, input().split()))
'''
A=[]
B=[]
for i in range():
a, b = map(int, input().split())
A.append(a)
B.append(b)'''
import sys
input = sys.stdin.readline
s = input()
t = input()
flg = False
cnt = 0
for i in range(len(s)-len(t)+1):
cnt = 0
for j in range(len(t)):
... |
s589460465 | p03565 | u373047809 | 1584215178 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 308 | import re
s, t = input().replace('?', '.'), input()
l, m = len(s), len(t)
if l < m:
print("UNRESTORABLE")
exit()
can = [] # candidates
for i in range(l - m + 1):
if re.match(s[i:i + m], t)
can.append((s[:i] + t + s[i + m:]).replace('.', 'a'))
print(min(can) if can else "UNRESTORABLE") |
s628900438 | p03565 | u263824932 | 1584070088 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 909 | SS=input()
T=input()
listT=[a for a in T]
TN=len(listT)
listSS=[b for b in SS]
SSN=len(listSS)
n=SSN-TN
numbers=[]
suuji=0
if n<0:
print('UNRESTORABLE')
else:
for c in range(n + 1):
number = 0
e=0
for d in range(TN):
if listSS[c + d] == listT[d] or listSS[c + d] == '?':
... |
s840782885 | p03565 | u097317219 | 1583961192 | Python | PyPy3 (2.4.0) | py | Runtime Error | 169 | 38384 | 549 | s = list(input())
t = list(input())
s_copy = s
ans_list = []
n = len(s)
m = len(t)
flag = 0
flag_2 = 0
for i in range(n):
if s[i] == "?" or s[i] == t[flag]:
if flag == m-1:
flag_2 = 1
for j in range(flag,-1,-1):
s[i-(m-1-j)] = t[j]
ans_list.append(s)
s = s_copy
else:
flag... |
s477994302 | p03565 | u568576853 | 1583899083 | Python | PyPy3 (2.4.0) | py | Runtime Error | 176 | 38512 | 485 | import copy
s=list(map(str,input()))
t=list(map(str,input()))
def converta(s):
for i in range(len(s)):
if s[i]=='?':
s[i]='a'
return s
res=[]
for i in range(len(s)-len(t)+1):
c=copy.copy(s)
ok=True
for j in range(len(t)):
if t[j]!=s[i+j] and s[i+j]!='?':
ok=False
... |
s007602965 | p03565 | u941434715 | 1583878681 | Python | Python (3.4.3) | py | Runtime Error | 304 | 19836 | 505 | #coding: utf-8
import math
import heapq
import bisect
import numpy as np
from collections import Counter
#from scipy.misc import comb
S = input()
T = input()
start = -1
for i in range(len(S)-len(T),-1,-1):
flg = 1
for j in range(len(T)):
if S[i+j] != '?' and S[i+j] != T[j]:
flg = 0
... |
s962999755 | p03565 | u703214333 | 1583872032 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 308 | s=input()
t=input()
f=1
tmp=0
if len(s)<len(t):
print("UNRESTORABLE")
exit()
n=len(s)
m=len(t)
for i in range(n-m+1):
x=s[i:i+m]
for j in range(m+1): #
if j==m:
print((s[:i]+t+s[i+m:]).replace("?","a"))
if x[j]=="?":
continue
elif x[j]!=t[j]:
break
print("UNRESTORABLE") |
s563098718 | p03565 | u097317219 | 1583813614 | Python | PyPy3 (2.4.0) | py | Runtime Error | 181 | 38384 | 412 | s = list(input())
t = list(input())
n = len(s)
m = len(t)
flag = 0
flag_2 = 0
for i in range(n):
if s[i] == "?" or s[i] == t[flag]:
if flag == m-1:
flag_2 = 1
for j in range(flag,-1,-1):
s[i-(m-1-j)] = t[j]
break
else:
flag += 1
else:
flag = 0
if n<m:
flag_2 = 0
if flag... |
s726465064 | p03565 | u857070771 | 1583736595 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3064 | 348 | sd=input()
t=input()
n=len(sd)
m=len(t)
if n<m:
print("UNRESTORABLE")
exit(0)
for i in range(n-m,-1,-1):
t_kana=sd[i:i+m]
for j in range(m):
if j==m :
print(sd[:i]+t+sd[i+len(t):]).replace("?","a")
if t_kana=="?":
continue
elif t_kamo[j]!=t[j]:
... |
s606593582 | p03565 | u219417113 | 1583622841 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 1028 | S = input()
T = input()
len_t = len(T)
def t_index_is_valid(t_index, start, end):
if S[t_index+start:t_index+end]:
for j, t_ in enumerate(T):
if S[t_index+start+j] == "?" or S[t_index+start+j] == t_:
pass
else:
return False
return True
el... |
s808096752 | p03565 | u505830998 | 1583534653 | Python | PyPy3 (2.4.0) | py | Runtime Error | 173 | 38384 | 1453 | import sys
input_methods=['clipboard','file','key']
using_method=1
input_method=input_methods[using_method]
IN=lambda : map(int, input().split())
mod=1000000007
#+++++
def is_ok(sd, st, t):
if len(sd) < st+len(t):
return False
for i, c in enumerate(sd[st:st+len(t)]):
if c != '?' and t[i] != c:
return False... |
s909052153 | p03565 | u222840844 | 1583464657 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 2438 | ##Hint for matching: We get the one that has the most match
#For each space in the interval: Match each blank and count it (The T is given to have at most n-1 matches where n is the length of T)
#For absolute match: it has n-1 matches
#For local match: it has the maximum matches
#For no match: The T belongs to the l... |
s730381097 | p03565 | u222840844 | 1583464580 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 2465 | ##Hint for matching: We get the one that has the most match
#For each space in the interval: Match each blank and count it (The T is given to have at most n-1 matches where n is the length of T)
#For absolute match: it has n-1 matches
#For local match: it has the maximum matches
#For no match: The T belongs to the l... |
s798138518 | p03565 | u222840844 | 1583464543 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 2458 | ##Hint for matching: We get the one that has the most match
#For each space in the interval: Match each blank and count it (The T is given to have at most n-1 matches where n is the length of T)
#For absolute match: it has n-1 matches
#For local match: it has the maximum matches
#For no match: The T belongs to the l... |
s615689234 | p03565 | u222840844 | 1583457983 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 1277 | S = input()
T = input()
code = S
match = 0
maxmatch = 0
maxmatchloc = -1
hasmatch = False
if (len(T) <= len(S)):
for x in range(len(S)-(len(T)-1)):
match = 0
for i in range(len(T)):
if (S[x+i] == T[i]):
if (maxmatch == -1):
... |
s871076298 | p03565 | u222840844 | 1583452396 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 728 | S = input()
T = input()
code = S
match = 0
maxmatchloc = 0
if (len(T) <= len(S)):
for x in range(len(S)):
match = 0
for i in range(len(T)):
if (S[x+i] == T[i]):
match += 1
if (S[x+i] != T[i] and S[x+i] != '?'):
match = 0
break
... |
s586992758 | p03565 | u222840844 | 1583437528 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 457 | S = input()
T = input()
code = S
if (len(T) > S):
for x in range(len(S)):
if (S[x] == '?'):
code = code[:x] + 'a' + code[x+1:]
for x in range(len(S)-(len(T)-1),-1,-1):
if (x == -1):
print('UNRESTORABLE')
elif (S[x:x+len(T)] == (('?')*len(T)) or (S[x:x+len(T)] == ... |
s365565855 | p03565 | u222840844 | 1583435295 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 1070 | def start(S,T):
for x in range(len(S)-(len(T)-1)):
if (S[x] == T[0] and (S[x+(len(T)-1)] == (T[len(T)-1]) or (S[x+(len(T)-1)] == '?'))):
return x
return len(S)
def delete(A,code):
for x in range(len(code)):
if code[x] in A:
A.remove(code[x])
return A
S = in... |
s856549557 | p03565 | u222840844 | 1583435061 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 1069 | def start(S,T):
for x in range(len(S)-(len(T)-1)):
if (S[x] == T[0] and (S[x+(len(T)-1)] == (T[len(T)-1]) or (S[x+(len(T)-1)] == '?'))):
return x
return len(S)
def delete(A,code):
for x in range(len(code)):
if code[x] in A:
A.remove(code[x])
return A
S = in... |
s589946545 | p03565 | u222840844 | 1583434322 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 1111 | ##Dubious Document 2
def start(S,T):
for x in range(len(S)-(len(T)-1)):
if (S[x] == T[0] and (S[x+(len(T)-1)] == (T[len(T)-1]) or (S[x+(len(T)-1)] == '?'))):
return x
return len(S)
def delete(A,code):
for x in range(len(code)):
if code[x] in A:
A.remove(code[x])
... |
s087234083 | p03565 | u371409687 | 1583364385 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 458 | s=list(input())
t=list(input())
ans=[0 for _ in range(len(s))]
for i in range(len(s)-len(t)+1):
cnt=0
for j in range(len(t)):
if s[i+j]=='?' or s[i+j]==t[j]:
cnt+=1
if cnt==len(t):
ans[i]=i
mark=ans.index(max(ans))
if sum(ans)!=0:
for j in range(len(s)):
if mark<=j an... |
s506660589 | p03565 | u549579601 | 1583359131 | Python | PyPy3 (2.4.0) | py | Runtime Error | 168 | 38384 | 541 | s = list(input())
s_ = "".join(s)
t = list(input())
begin = t[0]
len_t = len(t) - 1
ok = 0
for i in range(len(s)):
ok = 0
if s[i] == begin:
for j in range(1, len_t):
if s[i+j] == "?":
ok += 1
else:
break
if ok == len_t - 1:
fo... |
s011879198 | p03565 | u641851773 | 1583290456 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 1190 | #!/usr/bin/env python3
import sys
DEBUG = False
def read_int_list(sep = " "):
return [int(s) for s in sys.stdin.readline().rstrip().split(sep)]
def read_int():
return int(sys.stdin.readline())
def dprint(*args, **kwargs):
if DEBUG:
print(*args, **kwargs)
return
def solve(s, t):
if len... |
s903477743 | p03565 | u995062424 | 1583208160 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 505 | S = input()[::-1]
T = input()[::-1]
Flg = False
ans1 = "z"*len(S)
pos = ""
num = 0
for i in range(len(S)-len(T)+1):
sl = ""
sl = S[i:(i+len(T))]
for j in range(len(T)):
pos = ""
if(sl[j] == T[j]):
if(sl.count("?") >= len(T)-1):
pos += S[:i]+T+S[(i+len(T)):]
... |
s448510585 | p03565 | u572012241 | 1583206089 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3188 | 220 | import re
s = input()
t = input()
for i in range(len(s) - len(t), -1, -1):
if re.fullmatch(s[i:i + len(t)].replace("?", "."), t):
print((s[:i] + t + s[i+len(t)]).replace("?","a"))
break
else:
print("UNRESTORABLE") |
s780121945 | p03565 | u934868410 | 1583017799 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 445 | s = input()
t = input()
if len()
def match(i):
for j in range(len(t)):
if not s[i+j] == '?' and s[i+j] != t[j]:
return False
return True
for i in range(len(s) - len(t), -1, -1):
if not match(i):
continue
for j in range(i):
print('a' if s[j] == '?' else s[j], end='')
print(t, end='')
fo... |
s166806000 | p03565 | u553605501 | 1582847428 | Python | PyPy3 (2.4.0) | py | Runtime Error | 167 | 38256 | 496 | import sys
from itertools import permutations
import math
from operator import itemgetter
s=input()
t=input()
flag2=True
for i in reversed(range(len(s))):
if s[i]==t[0]:
flag=True
for j in range(1,len(t)):
if (s[i+j]!=t[j]) & (s[i+j]!='?'):
flag=False
if flag:
... |
s155850218 | p03565 | u391667116 | 1582603365 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 496 | sp = input()
t = input()
ls = len(sp)
lt = len(t)
ok = 1
s = list(sp)
print(s)
for i in range(ls):
ok = 1
for j in range(lt):
if (sp[i+j] == t[j]) or (sp[i+j] == '?'):
continue
ok = 0
break
if ok == 1:
for si in range(i, i+lt):
s[si] = t[si - i]
... |
s382891038 | p03565 | u840974625 | 1582089781 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3064 | 883 | s = list(input())
t = list(input())
flag = True
s_len = len(s)
t_len = len(t)
max_ha = 0
l = []
max_save = 0
save = 0
count = 0
for i in range(s_len):
if s[i] == '?':
s[i] = 'a'
count += 1
max_ha += 1
max_save = i
if count == t_len and flag:
save = i - count + 1... |
s171949163 | p03565 | u840974625 | 1582088845 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 567 | s = list(input())
t = list(input())
flag = True
s_len = len(s)
t_len = len(t)
save = 0
count = 0
for i in range(s_len):
if s[i] == '?':
s[i] = 'a'
count += 1
if count == t_len and flag:
save = i - count + 1
flag = False
elif count < t_len and s[i] == t[count]:
... |
s304415683 | p03565 | u840974625 | 1582088709 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 549 | s = list(input())
t = list(input())
flag = True
s_len = len(s)
t_len = len(t)
save = 0
count = 0
for i in range(s_len):
if s[i] == '?':
s[i] = 'a'
count += 1
if count == t_len and flag:
save = i - count + 1
flag = False
elif s[i] == t[count]:
count += 1
... |
s645442956 | p03565 | u314050667 | 1581439016 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 519 | SS = input()
T = input()
L_S = len(SS)
L_T = len(T)
COND = 0
for i in range(L_S-L_T+1):
cond = 1
t = ('?' * i) + T + ('?' * (L_S-L_T-i))
ans = ''
for j in range(L_S):
if SS[j] == '?' and t[j] == '?':
ans += 'a'
elif SS[j] == '?' and t[j] != '?':
ans += t[j]
elif SS[j] != '?' and t[j] == '?':
a... |
s141957607 | p03565 | u314050667 | 1581438936 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 494 | SS = input()
T = input()
L_S = len(SS)
L_T = len(T)
COND = 0
for i in range(L_S-L_T+1):
cond = 1
t = ('?' * i) + T + ('?' * (L_S-L_T-i))
ans = ''
for j in range(L_S):
if SS[j] == '?' and t[j] == '?':
ans += 'a'
elif SS[j] == '?' and t[j] != '?':
ans += t[j]
elif SS[j] != '?' and t[j] == '?':
a... |
s985984512 | p03565 | u431981421 | 1581435011 | Python | PyPy3 (2.4.0) | py | Runtime Error | 165 | 38256 | 393 | S = input()
T = input()
t = len(T)
ans = "UNRESTORABLE"
answers = []
for index, s in enumerate(S):
if index + t > len(S):
break
if s != '?' and s != T[0]:
continue
for a in range(1, t):
if S[index+a] != '?' and S[index+a] != T[a]:
break
else:
ans = S[0:index] + T + S[index+t:-1]
... |
s123832006 | p03565 | u414458988 | 1581311114 | Python | PyPy3 (2.4.0) | py | Runtime Error | 162 | 38256 | 202 | import re
s=input().replace("?",".")
t=input()
for i in range(len(s)-lent(t)+1):
if re.match(s[i:i+len(t)],t):
s=s.replace(".","a")
print(s[:i]+t+s[i+len(t):])
exit()
print("UNRESTORABLE") |
s069784073 | p03565 | u692515710 | 1580839838 | Python | Python (3.4.3) | py | Runtime Error | 75 | 4184 | 624 | def solve(sequence, term):
count = 0
for t in term:
count = 0
for i, s in enumerate(sequence):
if t == s or s == "?":
count += 1
else:
count = 0
if count == len(term):
newSeq = sequence[:i - count+1] + term + seq... |
s998147373 | p03565 | u692515710 | 1580839586 | Python | Python (3.4.3) | py | Runtime Error | 75 | 4188 | 588 | def solve(sequence, term):
count = 0
for t in term:
count = 0
for i, s in enumerate(sequence):
if t == s or s == "?":
count += 1
else:
count = 0
if count == len(term):
newSeq = sequence[:i - count+1] + term + seq... |
s534930276 | p03565 | u255382385 | 1580681630 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 513 | s = input()
t = input()
s_len = len(s)
t_len = len(t)
result = ''
for i in range(s_len - t_len, -1, -1):
match = False
s_part = s[i:i + t_len]
for j in range(t_len + 1):
if j == t_len:
result = (s[0:i] + t + s[i + t_len:]).replace('?', 'a')
match = True
break
... |
s520972519 | p03565 | u255382385 | 1580681513 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 509 | s = input()
t = input()
s_len = len(s)
t_len = len(t)
result = ''
for i in range(s_len - t_len, -1, -1):
match = False
s_part = s[i:i + t_len]
for j in range(t_len + 1):
if j == t_len:
result = (s[0:i] + t + s[i + 5:]).replace('?', 'a')
match = True
break
... |
s846191592 | p03565 | u853819426 | 1580494990 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 275 | fS, T = input(), input()
j = 0
k = 0
for i, c in enumerate(S):
if j == len(T):
break
if c in (T[j], '?'):
j += 1
else:
j = 0
k = i + 1
if k < len(S):
S = S[:k].replace('?', 'a') + T + S[k+len(T):].replace('?', 'a')
else:
S = 'UNRESTORABLE'
print(S) |
s144116202 | p03565 | u002459665 | 1580269406 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 1088 | S = input()
T = input()
if len(S) < len(T):
print('UNRESTORABLE')
else:
raise Exception()
# pos = []
# # Sのi文字目をスタートとしたときにマッチするか
# for i in range(len(S)-len(T)+1):
# # print('S[i]', S[i])
# match = True
# for j in range(len(T)):
# # print('-', T[j], S[i+j])
#... |
s727834414 | p03565 | u681444474 | 1580186047 | Python | PyPy3 (2.4.0) | py | Runtime Error | 167 | 38384 | 531 | # coding: utf-8
# Your code here!
# coding: utf-8
S=list(input())
T=list(input())
m=len(S)
n=len(T)
S.reverse()
T.reverse()
A=[]
for i in range(max(0,m-n+1)):
flg=True
#ans=copy.deepcopy(S)
for j in range(n):
if S[i+j]!='?':
if S[i+j]!=T[j]:
flg=False
if flg:
... |
s228588029 | p03565 | u095426154 | 1580174696 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 461 | # coding: utf-8
S=list(input())
T=list(input())
S.reverse()
T.reverse()
for i in range(len(S)-len(T)):
flg=True
for j in range(len(T)):
if not(S[i+j]=="?"):
if S[i+j]!=T[j]:
flg=False
if flg:
for k in range(len(T)):
S[i+k]=T[k]
break
... |
s935772896 | p03565 | u591295155 | 1579638589 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 602 | S = input()
T = input()
moji = []
for i in range(len(S)):
j = 0
cnt = 0
while j < len(T) and i+len(T)-1 < len(S):
if S[i+j] == T[j] or S[i+j] == '?':
cnt += 1
else:
break
j += 1
if cnt == len(T):
moji0 = ''
if i == 0: moji0 = ... |
s421770826 | p03565 | u591295155 | 1579638467 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 568 | S = input()
T = input()
moji = []
for i in range(len(S)):
j = 0
cnt = 0
while j < len(T) and i+len(T)-1 < len(S):
if S[i+j] == T[j] or S[i+j] == '?':
cnt += 1
else:
break
j += 1
if cnt == len(T):
moji0 = ''
if i == 0: moji0 = ... |
s296920133 | p03565 | u169138653 | 1579638258 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 459 | s=input()
t=input()
a=-1
n=len(s)
k=len(t)
if k>n:
print('UNRESTORABLE')
else:
ans=str()
for i in range(n):
ok=True
if n-i>=k:
for j in range(k):
if t[j]!=s[i+j] and s[i+j]!='?':
ok=False
if ok:
a=i
if a==-1:
print('UNRESTORABLE')
else:
for i in range(n):
... |
s377813049 | p03565 | u591295155 | 1579637499 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2106 | 42060 | 345 | S = input()
T = input()
for i in range(len(S)):
j = 0
cnt = 0
moji = []
while j < len(T) and i+len(T)-1 < len(S):
if S[i+j] == T[j] or S[i+j] == '?':
cnt += 1
if cnt == len(T):
moji0 = S[0:i]+T+S[i+len(T)]
moji1 = moji0.replace('?', 'a')
moji.append(moji... |
s356887514 | p03565 | u591295155 | 1579637439 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3064 | 345 | S = input()
T = input()
for i in range(len(S)):
j = 0
cnt = 0
moji = []
while j < len(T) and i+len(T)-1 < len(S):
if S[i+j] == T[j] or S[i+j] == '?':
cnt += 1
if cnt == len(T):
moji0 = S[0:i]+T+S[i+len(T)]
moji1 = moji0.replace('?', 'a')
moji.append(moji... |
s146516616 | p03565 | u853010060 | 1579283256 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 543 | S = list(input())
T = list(input())
for n in range(len(S)):
if S[n] == T[0]:
noOfnext = 0
for m in range(n+1, len(S)):
if S[m] == "?":
noOfnext += 1
else:
break
if noOfnext < len(T)-1:
continue
else:
for ... |
s078718164 | p03565 | u474423089 | 1578528460 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 412 | s_d=input()
t=input()
for i in range(len(s_d)-len(t),-1,-1):
flag = True
for j,k in zip(s_d[i:i+len(t)],t):
if j != "?" and j != k:
flag=False
break
if flag:
s_d = s_d[:i]+t+s_d[i+len(t)+1:]
break
if not flag:
print("UNRESTORABLE")
else:
for i in s_d:
... |
s213977154 | p03565 | u540761833 | 1578030628 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 533 | s = input()
t = input()
flag = False
tq = '?'*len(t)
start = []
for i in range(len(s)-len(t)+1):
if s[i] == t[0]:
start.append(i)
for j in range(len(t)):
if s[i+j] == t[j] or s[i+j] == '?':
continue
else:
start.pop(-1)
if s[i:i+len(t)] == t... |
s063970898 | p03565 | u540761833 | 1578030468 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 601 | s = input()
t = input()
flag = False
tq = '?'*len(t)
start = []
for i in range(len(s)-len(t)+1):
if s[i] == t[0]:
start.append(i)
flag = True
for j in range(len(t)):
if s[i+j] == t[j] or s[i+j] == '?':
continue
else:
flag = False
... |
s548831357 | p03565 | u540761833 | 1578030355 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 601 | s = input()
t = input()
flag = False
tq = '?'*len(t)
start = []
for i in range(len(s)-len(t)+1):
if s[i] == t[0]:
start.append(i)
flag = True
for j in range(len(t)):
if s[i+j] == t[j] or s[i+j] == '?':
continue
else:
flag = False
... |
s540168297 | p03565 | u058809975 | 1578013204 | Python | PyPy3 (2.4.0) | py | Runtime Error | 160 | 38256 | 668 |
def main():
S_=input()
T=input()
U=[]
if len(S_)<len(T):
print('UNRESTORABLE')
return
for i in range(len(S_)-len(T)+1):
flag=True
for j in range(len(T)):
if S_[i+j]!='?' and S_[i+j]!=T[j]:
flag=False
break
if flag:
S=['a']*len(S_)
for k in range(i):
... |
s755554532 | p03565 | u058809975 | 1578013157 | Python | PyPy3 (2.4.0) | py | Runtime Error | 164 | 38256 | 668 |
def main():
S_=input()
T=input()
U=[]
if len(S_)<len(T):
print('UNRESTORABLE')
return
for i in range(len(S_)-len(T)+1):
flag=True
for j in range(len(T)):
if S_[i+j]!='?' and S_[i+j]!=T[j]:
flag=False
break
if flag:
S=['a']*len(S_)
for k in range(i):
... |
s500573605 | p03565 | u058809975 | 1578013131 | Python | PyPy3 (2.4.0) | py | Runtime Error | 173 | 38384 | 668 |
def main():
S_=input()
T=input()
U=[]
if len(S_)<len(T):
print('UNRESTORABLE')
return
for i in range(len(S_)-len(T)+1):
flag=True
for j in range(len(T)):
if S_[i+j]!='?' and S_[i+j]!=T[j]:
flag=False
break
if flag:
S=['a']*len(S_)
for k in range(i):
... |
s051735542 | p03565 | u955125992 | 1577599177 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 628 | s = str(input())
t = str(input())
s_l =[]
for i in range(len(s)):
s_l.append(s[i])
a = len(s) - len(t)
while a >= 0:
insert = False
string = True
i = 0
while i < len(t):
if s[a + i] != "?" and s[a + i] != t[i]:
string = False
break
i += 1
if str... |
s791714204 | p03565 | u955125992 | 1577599143 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3064 | 568 | s = str(input())
t = str(input())
s_l =[]
for i in range(len(s)):
s_l.append(s[i])
a = len(s) - len(t)
while a >= 0:
insert = False
count = 0
for i in range(0, len(t)):
if s[a + i] == "?" or s[a + i] == t[i]:
count += 1
if count == len(t):
for i in range(len(t)):
... |
s731452540 | p03565 | u191874006 | 1577558535 | Python | PyPy3 (2.4.0) | py | Runtime Error | 177 | 38512 | 1186 | #!/usr/bin/env python3
import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collection... |
s657153342 | p03565 | u191874006 | 1577558120 | Python | PyPy3 (2.4.0) | py | Runtime Error | 169 | 38384 | 1266 | #!/usr/bin/env python3
import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collection... |
s037802320 | p03565 | u191874006 | 1577556701 | Python | PyPy3 (2.4.0) | py | Runtime Error | 175 | 38384 | 1261 | #!/usr/bin/env python3
import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collection... |
s819086030 | p03565 | u191874006 | 1577556615 | Python | PyPy3 (2.4.0) | py | Runtime Error | 185 | 38384 | 1263 | #!/usr/bin/env python3
import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collection... |
s412177539 | p03565 | u788137651 | 1577547249 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 1912 | #
# ⋀_⋀
# (・ω・)
# ./ U ∽ U\
# │* 合 *│
# │* 格 *│
# │* 祈 *│
# │* 願 *│
# │* *│
#  ̄
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,hypot,log #log2ないyp
from heapq import heappop, heappush, heappushpop
from collections import Counter,de... |
s808643224 | p03565 | u957872856 | 1577333238 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 436 | S = input()
T = input()
ind = 0
w = ""
for i in range(len(S)):
if S[i] == "?" or S[i] == T[ind]:
ind += 1
if ind == len(T):
w += T
for j in range(i+1,len(S)):
w += S[j]
break
else:
for k in range(ind, 0 , -1):
w += S[i-k]
ind = 0
w += S[i]
if ind < len(T):
print... |
s381712560 | p03565 | u957872856 | 1577333229 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 447 | S = input()
T = input()
ind = 0
w = ""
for i in range(len(S)):
if S[i] == "?" or S[i] == T[ind]:
ind += 1
if ind == len(T):
w += T
for j in range(i+1,len(S)):
w += S[j]
break
else:
for k in range(ind, 0 , -1):
w += S[i-k]
ind = 0
w += S[i]
if ind < len(T):
print... |
s602688533 | p03565 | u560988566 | 1577316163 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 771 | s = input()
t = input()
ans = "UNRESTORABLE"
i = 0
while i < len(s)-len(t)+2:
flag = False
if s[i] == t[0] or s[i] == "?":
for j in range(1,len(t)):
if s[i+j] == "?" or s[i+j] == t[j]:
flag = True
else:
flag = False
break
... |
s448974993 | p03565 | u905582793 | 1576951359 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 373 | s=input()
t=input()
ls=len(s)
lt=len(t)
if ls<lt:
print("UNRESTORABLE")
exit()
for i in range(ls-lt,-1,-1):
for j in range(i,i+lt):
if s[j]==t[j] or s[j]=="?":
continue
else:
break
else:
for k in range(i,i+lt):
s[k]=t[k]
for l in range(ls):
if s[l]=="?":
s[l]="a"
... |
s443975983 | p03565 | u777068250 | 1576831707 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 670 | def getLastMatch(s,t):
for i in range(len(s)-len(t), -1, -1):
if s[i] == '?' or s[i] == t[0]:
match = True
for j in range(len(t)):
if s[i+j] == '?': continue
if s[i+j] != t[j]:
match = False
break
if ... |
s459599222 | p03565 | u560988566 | 1576193058 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 596 | s = input()
t = input()
ans = "UNRESTORABLE"
ls = []
for i in range(len(t)):
for j in range(i, len(s)-len(t)+i+1):
if s[j] == t[i]:
for k in range(len(t)):
if t[i+k] != s[j+k] and s[j+k] != "?":
break
if k == len(t)-1:
tm... |
s241030971 | p03565 | u457423258 | 1576102000 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 555 | import sys
import os
f = open('/Users/murakiyusuke/coding/atcoder/input.txt','r')
sys.stdin = f
S=input()
T=input()
def match(S,T):
for i in range(len(T)):
if S[i]==T[i] or S[i]=='?':
continue
else:
return False
return True
if len(T)>len(S):
print('UNRESTORABLE')
... |
s190191071 | p03565 | u780475861 | 1576026650 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 345 | ss, t = input(), input()
lt = len(t)
lss = len(ss)
for i in range(0, lss - lt + 1):
tss = ss[i : i + lt]
tb = True
for a, b in zip(tss, t):
if a == '?':
continue
elif a != b:
tb = False
break
if tb:
ss = ss[: i] + t + ss[i + lt:]
break
if tb:
print(ss.replace('?', 'a'))
else... |
s298526794 | p03565 | u698919163 | 1575855194 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 597 | S = input()
T = input()
import sys
j = 0
flag = 0
check = 0
while j < len(S):
flag = S.find(T[0],j)
if flag != -1:
for i in range(len(T)-1):
if S[flag+1+i] == '?' or S[flag+1+i] == T[i+1]:
check += 1
if check == len(T)-1:
Snew = S[:flag] + T + S[flag+le... |
s991006903 | p03565 | u887675488 | 1575653072 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 1038 | def ABC076C_DubiousDocument2():
Sd = list(input().strip())
T = list(input().strip())
tlen = len(T)
slen = len(Sd)
ans = 'UNRESTORABLE'
nowPos = 0
for pos in range(slen - 1, -1, -1):
if pos < (tlen - 1):
break
if(T[tlen - (slen - 1 - pos) - 1] == Sd[pos]) or (Sd[... |
s239529703 | p03565 | u887675488 | 1575652434 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 1032 | def ABC076C_DubiousDocument2():
Sd = list(input().strip())
T = list(input().strip())
tlen = len(T)
slen = len(Sd)
ans = 'UNRESTORABLE'
nowPos = 0
for pos in range(slen - 1, -1, -1):
if pos < tlen:
break
if(T[tlen - (slen - 1 - pos) - 1] == Sd[pos]) or (Sd[pos] =... |
s736748943 | p03565 | u325282913 | 1575351501 | Python | PyPy3 (2.4.0) | py | Runtime Error | 171 | 38384 | 582 | S = input()
T = input()
count = 0
flg = False
while True:
flg = False
for i in range(1,len(T)+1):
if S[-i-count] != T[-i] and S[-i-count] != '?':
count += 1
flg = True
break
if count == len(S) - len(T) + 1:
print('UNRESTORABLE')
exit()
if not f... |
s607479011 | p03565 | u325282913 | 1575351028 | Python | PyPy3 (2.4.0) | py | Runtime Error | 166 | 38256 | 586 | S = input()
T = input()
count = 0
flg = False
while True:
flg = False
for i in range(1,len(T)+1):
if S[-i-count] != T[-i] and S[-i-count] != '?':
count += 1
flg = True
break
if count == len(S) - len(T):
print('UNRESTORABLE')
exit()
if not flg:
... |
s784997998 | p03565 | u325282913 | 1575350891 | Python | PyPy3 (2.4.0) | py | Runtime Error | 168 | 38640 | 582 | S = input()
T = input()
count = 0
flg = False
while True:
flg = False
for i in range(1,len(T)+1):
if S[-i-count] != T[-i] and S[-i-count] != '?':
count += 1
flg = True
break
if count == len(S) - len(T):
print('UNRESTORABLE')
exit()
if not flg:
... |
s997877435 | p03565 | u325282913 | 1575350844 | Python | PyPy3 (2.4.0) | py | Runtime Error | 169 | 38640 | 565 | S = input()
T = input()
count = 0
flg = False
while True:
flg = False
for i in range(1,len(T)+1):
if S[-i-count] != T[-i] and S[-i-count] != '?':
count += 1
flg = True
break
if count == len(S) - len(T):
print('UNRESTORABLE')
exit()
if not flg:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.