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
s062714706
p03565
u354638986
1524848331
Python
Python (3.4.3)
py
Runtime Error
18
3064
573
s_d = [i for i in input()] t = input() flg = True for i in range(len(s_d)-1, -1, -1): if len(s_d) - i >= len(t) and s_d[i] == '?' or s_d[i] == t[0]: j, n = i+1, 1 while j < len(s_d) - 1: if s_d[j] == '?' or s_d[j] == t[n]: j += 1 n += 1 else: ...
s410337104
p03565
u354638986
1524846505
Python
Python (3.4.3)
py
Runtime Error
18
3064
547
s_d = [i for i in input()] t = input() flg = True for i in range(len(s_d)-1, -1, -1): if len(s_d) - i >= len(t) and s_d[i] == '?' or s_d[i] == t[0]: j, n = i+1, 1 while s_d[j] == '?' or s_d[j] == t[n]: j += 1 n += 1 if j > len(s_d) - 1: break ...
s183305508
p03565
u143492911
1524752989
Python
Python (3.4.3)
py
Runtime Error
17
3064
437
s=list(input()) t=list(input()) sl=len(s) tl=len(t) for k in range(sl-tl+2): judge=True for i in range(tl): if s[i+k]==t[i] or s[i+k]=="?": pass else: judge=False break if judge: for i in range(tl): s[i+k]=t[i] for i in range(sl...
s844584321
p03565
u143492911
1524448718
Python
Python (3.4.3)
py
Runtime Error
17
3064
402
s=list(input()) t=list(input()) sl=len(s) tl=len(t) for i in range(sl-tl,-1,-1): j=0 while j<tl: if s[j+1]==t[j] or s[j+i]=="?": j+=1 else: break if j==tl: for i in range(tl): s[i+k]=t[k] for j in range(sl): if s[j]=="?": ...
s757834250
p03565
u667024514
1521772156
Python
Python (3.4.3)
py
Runtime Error
20
3064
505
s = list(str(input())) t = list(str(input())) ans = [] an = 0 if len(s) < len(t): print("UNRESTORABLE") exit() for i in range(len(s)-len(t)+1): cou = s[i:i+len(t)] for k in range(len(t)): if s[i+k] != t[k] and s[i+k] != "?" and t[k] != "?": break if k == len(t)-1: ...
s589913048
p03565
u667024514
1521669099
Python
Python (3.4.3)
py
Runtime Error
17
3064
557
s = list(str(input())) n = list(str(input())) ans = [] for i in range(len(s)-len(n)+1): nu = [] for m in range(i):nu.append(s[m]) for k in range(len(n)): if s[i + k] != n[k] and s[i+k]!="?" and n[k] != "?": break if k == len(n)-1: nu += n for h in range(le...
s654609786
p03565
u319612498
1521471437
Python
Python (3.4.3)
py
Runtime Error
17
3064
363
s=input() t=input() n=len(s)-len(t)+1 lst=[] for i in range(n): tot=0 ss=s for j in range(len(t)): if ss[i+j]==t[j] or ss[i+j]=="?": tot+=1 if tot==len(t): for j in range(len(t)): ss[i+j]=t[j] ss=ss.replace("?","a") lst.append(ss) lst.sort() print(...
s956856133
p03565
u941884460
1521263195
Python
Python (3.4.3)
py
Runtime Error
17
3192
473
s = input() t = input() cand = [] if len(s) < len(t): print('UNRESTORABLE') else: for i in range(len(s)): if s[i] != t[0] and s[i] != '?': continue else: for j in range(len(t)): if s[i+j] != t[j] and s[i+j] != '?': break elif j == (len(t)-1): cand.append(i) ...
s646993417
p03565
u941884460
1521263091
Python
Python (3.4.3)
py
Runtime Error
17
3064
473
s = input() t = input() cand = [] if len(s) < len(t): print('UNRESTORABLE') else: for i in range(len(s)): if s[i] != t[0] and s[i] != '?': continue else: for j in range(len(t)): if s[i+j] != t[j] and s[i+j] != '?': break elif j == (len(t)-1): cand.append(i) ...
s644107406
p03565
u820351940
1520372578
Python
Python (3.4.3)
py
Runtime Error
17
3060
351
s = input() t = input() def match(s1, s2): if len(s1) < len(s2): return False for i, j in zip(s1, s2): if i != j and i != "?": return False return True result = [] for i in range(50): if match(s[i:], t): result.append((s[:i] + t + s[i + len(t):]).replace("?", "a")) ...
s465032922
p03565
u875361824
1519151976
Python
Python (3.4.3)
py
Runtime Error
17
2940
473
``` def main(): s = input() t = input() f(s, t) def f(s, t): l_t =len(t) for i in reversed(range(len(s)-l_t+1)): b = s[i:i+l_t] c = sum(c1 == c2 or c2 == "?" for c1, c2 in zip(t, b)) if c == len(t): print(s[:i], t, s[i+l_t:]) ans = s[:i].replace("?"...
s768998135
p03565
u562016607
1517416570
Python
Python (3.4.3)
py
Runtime Error
17
3064
468
Sd = input() T = input() if len(Sd) < len(T): print("UNRESTORABLE") else: D = [] for i in range(len(Sd) - len(T) + 1): flag = 1 S = Sd for j in range(len(T)): if Sd[i+j] == "?" or Sd[i+j] == T[j]: S = S[:i+j]+T[j]+S[i+j+1:] else: ...
s398571452
p03565
u052746401
1516779981
Python
Python (3.4.3)
py
Runtime Error
17
3064
608
S = list(input()) T = input() flag = True tmp_ind = len(T)-1 if len(S)>=len(T): for i in range(len(S)-1, -1, -1): if(S[i]=='?' or S[i]==T[tmp_ind]) and flag: if tmp_ind==0: s_ind = i flag = False break tmp_ind -= 1 else: ...
s904912061
p03565
u052746401
1516779725
Python
Python (3.4.3)
py
Runtime Error
17
2940
482
S = list(input()) T = input() flag = True tmp_ind = len(T)-1 for i in range(len(S)-1, -1, -1): if (S[i]=='?' or S[i]==T[tmp_ind]) and flag: if tmp_ind==0: s_ind = i flag = False break tmp_ind -= 1 else: tmp_ind = len(T)-1 if flag: print('UNRESTORABLE') else: j = 0 for i...
s442356794
p03565
u052746401
1516779670
Python
Python (3.4.3)
py
Runtime Error
17
3064
590
S = list(input()) T = input() flag = True tmp_ind = len(T)-1 if len(S)>=len(T): for i in range(len(S)-1, -1, -1): if (S[i]=='?' or S[i]==T[tmp_ind]) and flag: if tmp_ind==0: s_ind = i flag = False break tmp_ind -= 1 else: ...
s821426148
p03565
u443630646
1513120075
Python
Python (3.4.3)
py
Runtime Error
18
3064
1089
hint = input() t = input() s = [] c = 0 for x in hint: s.append(x) found = False for i in t: if hint.rfind(i) > -1: for j in range(len(t)): if len(t) - t.index(i) <= len(hint) - hint.rfind(i): if hint[hint.rfind(i) - t.index(i) + j] == t[j] or "?" == hint[hint.rfind(i) - t....
s152688365
p03565
u443630646
1513120006
Python
Python (3.4.3)
py
Runtime Error
18
3064
1112
hint = input() t = input() s = [] c = 0 for x in hint: s.append(x) found = False for i in t: if hint.rfind(i) > -1: for j in range(len(t)): if len(t) - t.index(i) <= len(hint) - hint.rfind(i): if hint[hint.rfind(i) - t.index(i) + j] == t[j] or "?" == hint[hint.rfind(i) - t....
s702936551
p03565
u443630646
1513119687
Python
Python (3.4.3)
py
Runtime Error
18
3064
1111
hint = input() t = input() s = [] c = 0 for x in hint: s.append(x) found = False for i in t: if hint.rfind(i) > -1: for j in range(len(t)): if len(t) - t.index(i) <= len(hint) - hint.rfind(i): if hint[hint.rfind(i) - t.index(i) + j] == t[j] or "?" == hint[hint.rfind(i) - t....
s770920586
p03565
u443630646
1513119611
Python
Python (3.4.3)
py
Runtime Error
21
3700
1195
hint = input() t = input() s = [] c = 0 for x in hint: s.append(x) found = False for i in t: if hint.rfind(i) > -1: for j in range(len(t)): print(i) print(hint.rfind(i)) print(t.index(i)) if len(t) - t.index(i) <= len(hint) - hint.rfind(i): ...
s346872063
p03565
u443630646
1513092561
Python
Python (3.4.3)
py
Runtime Error
18
3064
892
hint = input() t = input() s = [] c = 0 d = 0 for x in hint: s.append(x) found = False for i in t: if hint.rfind(i) > -1: for j in range(t.index(i), len(t)): if hint[hint.rfind(i) + d] == t[j] or "?" == hint[hint.rfind(i) + d]: d += 1 found = True ...
s402027201
p03565
u443630646
1513092262
Python
Python (3.4.3)
py
Runtime Error
17
3060
849
hint = input() t = input() s = [] c = 0 d = 0 for x in hint: s.append(x) found = False for i in t:??? for j in range(t.index(i), len(t)): if hint[hint.rfind(i) + d] == t[j] or "?" == hint[hint.rfind(i) + d]: d += 1 found = True else: f...
s562180988
p03565
u443630646
1513090875
Python
Python (3.4.3)
py
Runtime Error
19
3064
825
hint = input() t = input() s = [] for x in hint: s.append(x) found = False for i in t: if hint.rfind(i) > -1: for j in range(len(t) - t.index(i)): if hint[hint.rfind(i) + j] == t[t.index(i) + j] or "?" == hint[hint.rfind(i) + j]: found = True else: ...
s963796518
p03565
u443630646
1513089947
Python
Python (3.4.3)
py
Runtime Error
19
3064
1218
hint = input() t = input() s = [] for x in hint: s.append(x) found = False for i in t: if hint.rfind(i) > -1: for j in range(len(t) - t.index(i)): if hint[hint.rfind(i) + j] == t[t.index(i) + j] or "?" == hint[hint.rfind(i) + j]: found = True else: ...
s386809550
p03565
u443630646
1513089737
Python
Python (3.4.3)
py
Runtime Error
19
3064
953
hint = input() t = input() s = [] for x in hint: s.append(x) found = False for i in t: if hint.rfind(i) > -1: for j in range(len(t) - t.index(i)): if hint[hint.rfind(i) + j] == t[t.index(i) + j] or "?" == hint[hint.rfind(i) + j]: found = True else: ...
s249080943
p03565
u443630646
1513039652
Python
Python (3.4.3)
py
Runtime Error
17
3064
607
hint = input() t = input() s = [0 for i in range(len(hint))] found = False def check(index): for i in range(len(t)): if (t[i] == hint[index + i]) or (hint[index + i] == '?'): s[index+i] = t[i] # matching hint and t for j in t: if hint.find(j) > -1: check(int(hint.find(j))) ...
s653414911
p03565
u443630646
1513039569
Python
Python (3.4.3)
py
Runtime Error
17
3064
606
hint = input() t = input() s = [0 for i in range(len(hint))] found = False def check(index): for i in range(len(t)): if (t[i] == hint[index + i]) or (hint[index + i] == '?'): s[index+i] = t[i] # matching hint and t for j in t: if hint.find(j) > 0: check(int(hint.find(j))) ...
s192782598
p03565
u257974487
1512951308
Python
Python (3.4.3)
py
Runtime Error
17
3064
292
import sys s = input() T=input() p = 0 for i in range(len(s)-len(T)+1,0,-1): for j in range(len(T)): if T[j]!=s[i-1+j] and "?"!= s[i-1+j] : p = 1 break if p == 0: s=s[:i-1]+T+s[i+len(T)-1:] s = s.replace('?', 'a') print(s) sys.exit() if p == 1: print("UNRESTORABLE")
s345720468
p03565
u635277286
1512849288
Python
Python (3.4.3)
py
Runtime Error
18
3064
790
def is_substring(s,t,start_index): ok=True j=0 for i in range(start_index, start_index + len(s) - len(t) + 1): if s[i] == t[j] or s[i] == '?': j+=1 else: ok = False break return ok def replace(s, index, changed_char): s_list = list(s) s_list[index] = changed_char t = "".join(s_list) return t def...
s140191066
p03565
u635277286
1512848969
Python
Python (3.4.3)
py
Runtime Error
18
3064
839
def is_substring(s,t,start_index): ok=True j=0 for i in range(start_index, start_index + max(len(s) - len(t) + 1,0)): if s[i] == t[j] or s[i] == '?': j+=1 else: ok = False break return ok def replace(s_list, index, changed_char): s_list[index] = changed_char t = "".join(s_list) return t def main(...
s030207107
p03565
u635277286
1512848740
Python
Python (3.4.3)
py
Runtime Error
18
3064
799
def is_substring(s,t,start_index): ok=True j=0 for i in range(start_index, start_index + max(len(s) - len(t) + 1,0)): if s[i] == t[j] or s[i] == '?': j+=1 else: ok = False break return ok def replace(s_list, index, changed_char): s_list[index] = changed_char t = "".join(s_list) return t def main(...
s449375221
p03565
u635277286
1512848527
Python
Python (3.4.3)
py
Runtime Error
19
3064
785
def is_substring(s,t,start_index): ok=True j=0 for i in range(start_index, start_index + len(s) - len(t) + 1): if s[i] == t[j] or s[i] == '?': j+=1 else: ok = False break return ok def replace(s_list, index, changed_char): s_list[index] = changed_char t = "".join(s_list) return t def main(): s=s...
s157507349
p03565
u751863169
1511720989
Python
Python (3.4.3)
py
Runtime Error
17
3064
762
#!/usr/bin/env python def main(): Sdash = input() T = input() if len(Sdash) < len(T): print("UNRESTORABLE") S = "" for i in range(len(Sdash)): is_matched = True for j in range(len(T)): if i + j >= len(Sdash) or (Sdash[i + j] != '?' and Sdash[i + j] != T[j]): ...
s733355111
p03565
u751863169
1511634548
Python
Python (3.4.3)
py
Runtime Error
17
3064
703
#!/usr/bin/env python def main(): Sdash = input() T = input() S = "" for i in range(len(Sdash)): is_matched = True for j in range(len(T)): if i + j >= len(Sdash) or (Sdash[i + j] != '?' and Sdash[i + j] != T[j]): is_matched = False break ...
s446288805
p03565
u395287676
1509941770
Python
Python (3.4.3)
py
Runtime Error
100
9200
1674
# -*- coding: utf-8 -*- import unittest from unittest import skip from test.support import captured_stdout from src.bin.main import main, _main from unittest.mock import MagicMock, patch class TestMain(unittest.TestCase): @staticmethod def mock_of_inputs(): # Use this mock if a contest requires interactive...
s534517813
p03565
u163892325
1509802425
Python
Python (3.4.3)
py
Runtime Error
18
2940
370
=str(input()) T=str(input()) SL=len(S) TL=len(T) a=[] for i in range(SL-TL+1): count=0 for j in range(TL): if S[i+j] == '?' or S[i+j]==T[j]: count += 1 if count==TL: ans = S[:i].replace('?','a')+T+S[i+TL:].replace('?','a') a.append(ans) if len(a)==0: print...
s833380001
p03565
u126747509
1509725513
Python
Python (3.4.3)
py
Runtime Error
17
3064
606
def main(): s = list(input()) t = list(input()) #print(s) #print(t) #print(len(s)-len(t)+1) for i in range(len(s)-len(t)+1): flag = True for j in range(len(t)): if s[i+j] == '?': continue if s[i+j] == t[j]: continue ...
s350662369
p03565
u126747509
1509724120
Python
Python (3.4.3)
py
Runtime Error
17
3064
497
def main(): s = list(input()) t = list(input()) for i in range(len(s)-len(t)+1): flag = True for j in range(len(t)): if s[-(i+j)] != t[-j] and s[-(i+j)] != '?': flag = False break if flag: s[len(s)-(len(t)+i):len(s)-i] = t ...
s484223177
p03565
u126747509
1509723102
Python
Python (3.4.3)
py
Runtime Error
18
3064
447
def main(): s = input() t = input() for i in range(len(s)-len(t)+1): flag = True for j in range(len(t)): if s[i+j] != t[j] and s[i+j] != '?': flag = False break if flag: s = s[:i] + t + s[i+len(t):] #break if f...
s380262216
p03565
u126747509
1509722813
Python
Python (3.4.3)
py
Runtime Error
24
3064
446
def main(): s = input() t = input() for i in range(len(s)-len(t)+1): flag = True for j in range(len(t)): if s[i+j] != t[j] and s[i+j] != '?': flag = False break if flag: s = s[:i] + t + s[i+len(t):] break if fl...
s524873480
p03565
u126747509
1509722522
Python
Python (3.4.3)
py
Runtime Error
17
3064
425
def main(): s = input() t = input() for i in range(len(s)-len(t)+1): flag = True for j in range(len(t)): if s[i+j] != t[j] and s[i+j] != '?': flag = False if flag: s = s[:i] + t + s[i+len(t):] break; if flag: print(s.r...
s725994250
p03565
u126747509
1509722340
Python
Python (3.4.3)
py
Runtime Error
17
3064
428
def main(): s = input() t = input() for i in range(len(s)-len(t)+1): flag = True for j in range(len(t)): if s[i+j] != t[j] and s[i+j] != '?': flag = False if flag: s = s.replace(s[i:i+len(t)], t) break; if flag: print(...
s959632788
p03565
u341087021
1509503042
Python
Python (3.4.3)
py
Runtime Error
18
3064
530
s = input() t = input() def is_restorable(a,b): ans = True for x,y in zip(a,b): if x == y or x == '?': pass else: ans = False break return ans s = s[::-1] t = t[::-1] s_ = list(s) can_restore = False anchor = [0,0] for i,x in enumerate(s): if not c...
s958032923
p03565
u112581208
1509396665
Python
Python (3.4.3)
py
Runtime Error
17
3188
482
S_prime = input() T = input() replaced = 'UNRESTORABLE' matched = True if len(S_prime) < len(T): cout << replaced << endl; for i in range(len(S_prime) - len(T) + 1): for k in range(len(T)): if S_prime[i + k] != T[k] and S_prime[i + k] != '?': matched = False break match...
s585016442
p03565
u274907892
1509312207
Python
PyPy2 (5.6.0)
py
Runtime Error
38
28012
112
X = 1 N = input() K = input() for i in range(N): if(X*2 < X+K): X *= 2 else: X += K print(X)
s536622541
p03565
u621935300
1509309616
Python
Python (2.7.6)
py
Runtime Error
12
2568
499
import sys S0=raw_input() T=list(raw_input()) l=len(T) ans="" for i in range(len(S0)-l+1): S1=list(S0) for j in range(l): #print i+j,j,S1[i+j],T[j] if S1[i+j]!=T[j] and S1[i+j]!="?": #print "break" break else: #print "else" for j in range(l): S1[i+j]=T[j] S_tmp=(''.join(S1)).replace('?','a') ...
s081926802
p03565
u621935300
1509309287
Python
Python (2.7.6)
py
Runtime Error
12
2820
478
import sys S0=raw_input() T=list(raw_input()) l=len(T) ans="" for i in range(len(S0)-l+1): S1=list(S0) for j in range(l): #print i+j,j,S1[i+j],T[j] if S1[i+j]!=T[j] and S1[i+j]!="?": #print "break" break else: #print "else" for j in range(l): S1[i+j]=T[j] S_tmp=(''.join(S1)).replace('?','a') ...
s885525875
p03565
u621935300
1509307849
Python
Python (2.7.6)
py
Runtime Error
12
2692
387
import sys S0=raw_input() S1=list(S0) T=list(raw_input()) #print S1 #print T l=len(T) S=[] for i in range(3): for j in range(l): #print i+j,j,S1[i+j],T[j] if S1[i+j]!=T[j] and S1[i+j]!="?": #print "break" break else: #print "else" for j in range(l): S1[i+j]=T[j] if S0==''.join(S1): print "UNRES...
s834046197
p03565
u227020436
1509294163
Python
Python (3.4.3)
py
Runtime Error
18
3064
692
#!/usr/bin/python # AtCoder Beginner Contest 076 # C - Dubious Document 2 from sys import stdin def match(S, pos, T): for i in range(len(T)): if S[pos + i] != '?' and S[pos + i] != T[i]: return False return True def solve(S, T): minS = '~' * len(S) for pos in range(len(S) - len(T) + 1): # S[po...
s957329513
p03565
u439176910
1509286262
Python
Python (3.4.3)
py
Runtime Error
17
3064
461
a = list(input()) b = list(input()) a_l = len(a) b_l = len(b) for i in range(1,a_l-b_l+2): if a_l < b_l: f=False break f = True for j in range(1,b_l+1): if not(b[b_l-j] == a[a_l-i-j+1] or a[a_l-i-j+1] == "?"): f = False break if f: for j in rang...
s074741309
p03565
u439176910
1509286092
Python
Python (3.4.3)
py
Runtime Error
17
3064
413
a = list(input()) b = list(input()) a_l = len(a) b_l = len(b) for i in range(1,a_l-b_l+2): f = True for j in range(1,b_l+1): if not(b[b_l-j] == a[a_l-i-j+1] or a[a_l-i-j+1] == "?"): f = False break if f: for j in range(1,b_l+1): a[a_l-i-j+1] = b[b_l-j] ...
s937631132
p03565
u439176910
1509285486
Python
Python (3.4.3)
py
Runtime Error
17
3064
411
a = list(input()) b = list(input()) a_l = len(a) b_l = len(b) for i in range(1,a_l-b_l+2): f = True for j in range(1,b_l+1): if not(b[b_l-j] == a[a_l-i-j+1] or a[a_l-i-j+1] == "?"): f = False break if f: for j in range(1,b_l+1): a[a_l-i-j+1] = b[b_l-j] ...
s990093995
p03565
u536081558
1509252808
Python
Python (2.7.6)
py
Runtime Error
10
2696
425
a = raw_input() b = raw_input() a = list(a) b = list(b) n = len(a) m = len(b) z = '' for i in range(n - m + 1): flag = True for j in range(m): if a[i + j] != b[j] and a[i + j] != '?': flag = False if not flag: continue c = a for j in range(m): c[i + j] = b[j] for i in range(n): if c[i] == '?': c[i] ...
s886531290
p03565
u642905089
1509247955
Python
Python (3.4.3)
py
Runtime Error
21
3316
1128
from collections import defaultdict Ss = input() T = input() Tdic = defaultdict(lambda: len(T)) for idx,i in enumerate(T): Tdic[i] = len(T) -(idx+1) Tdic[T[-1]] = len(T) Tdic["?"] = 1 Flag = False mutchdic = dict() mutch = 0 head = len(T)-1 while(1): for i in range(len(T)): if ...
s923852645
p03565
u023041408
1509246381
Python
Python (3.4.3)
py
Runtime Error
17
3192
1577
def getResult(S, i, T): res = "" for k in range(0, len(S)): if k < i: res = res + S[k] elif k >= i and k < i+len(T): res = res + T[k-i] else: res = res + S[k] S = res.replace('?', 'a') return S res_list = [] res = False for i in range(0, len(...
s561925741
p03565
u785205215
1509246010
Python
Python (3.4.3)
py
Runtime Error
31
3692
1144
from sys import stdin, stdout from collections import defaultdict def readLine_int_list():return list(map(int, stdin.readline().split())) def readLine_int_list_reverse(): return list(map(int, stdin.readline().split())).reverse() def readAll_int(): return list(map(int, stdin)) def readLine_str_list():return list(map(str...
s183298698
p03565
u346308892
1509245530
Python
Python (3.4.3)
py
Runtime Error
17
3064
486
def compair(x,y): if len(x)!=len(y): return False for i in range(len(x)): if x[i]!=y[i] and x[i]!='?': return False return True ss=input() T=input() flg=False for i in reversed(range(len(ss)-1)): if compair(ss[i:(i+len(T) )],T): flg=True break ss=list(s...
s485264239
p03565
u346308892
1509245377
Python
Python (3.4.3)
py
Runtime Error
17
3064
443
def compair(x,y): if len(x)!=len(y): return False for i in range(len(x)): if x[i]!=y[i] and x[i]!='?': return False return True ss=input() T=input() flg=False for i in reversed(range(len(ss)-1)): if compair(ss[i:(i+len(T) )],T): flg=True break ss=list(s...
s880683070
p03565
u346308892
1509245309
Python
Python (3.4.3)
py
Runtime Error
17
3064
401
def compair(x,y): print("comp",x,y) if len(x)!=len(y): return False for i in range(len(x)): if x[i]!=y[i] and x[i]!='?': return False return True ss=input() T=input() flg=False for i in reversed(range(len(ss)-1)): if compair(ss[i:(i+len(T) )],T): flg=True ...
s162490360
p03565
u813098295
1509245268
Python
Python (2.7.6)
py
Runtime Error
11
2696
1563
def solve(): S = raw_input() T = raw_input() if len(S) == len(T): for j in range(len(T)): if T[j] != S[j] and S[j] != "?": print "UNRESTORABLE" return 0 else: pass print T return 0 if len(S) < len(T): ...
s879310958
p03565
u488497128
1509245239
Python
Python (3.4.3)
py
Runtime Error
17
3064
592
import sys S = sys.stdin.readline().strip() T = sys.stdin.readline().strip() if S.find(T) > -1: ans = S.replace("?", "a") print(ans) else: index = -1 for i in range(len(S)): b = True for j in range(len(T)): if (i + j > (len(S)-1)) or ((S[i + j] != "?") and (S[i + j] != T[...
s904928620
p03565
u260764548
1509245218
Python
Python (3.4.3)
py
Runtime Error
2104
3064
819
# -*- coding:utf-8 -*- import sys S_p = input() T = input() def search_mask_text(S_p,T,T_p): for i in range(len(T_p)): if T_p[i] == '?': T_p_n = T_p[0:i] + T[i] + T_p[i+1:len(T_p)] if T_p_n != T: index_S = S_p.find(T_p_n) if index_S != -1: ...
s685821848
p03565
u260764548
1509245174
Python
Python (3.4.3)
py
Runtime Error
2104
31092
876
# -*- coding:utf-8 -*- import sys S_p = input() T = input() def search_mask_text(S_p,T,T_p): for i in range(len(T_p)): if T_p[i] == '?': T_p_n = T_p[0:i] + T[i] + T_p[i+1:len(T_p)] print(i) print(T_p_n) if T_p_n != T: index_S = S_p.find(T_p_n...
s074081986
p03565
u104922648
1509244914
Python
Python (3.4.3)
py
Runtime Error
17
3060
199
words = input() key = input() for i in range(len(words)): if words[i:i+len(key)] == key: words[i:i+len(key)] = key print(words.replace('?', 'a')) else: print('UNRESTORABLE')
s754041152
p03565
u147628962
1509244868
Python
Python (3.4.3)
py
Runtime Error
17
3064
448
s_=input() t=input() ans=[] n=len(s_) m=len(t) ind=0 dic={} for i in range(n-m+1): con1=True for j in range(m): if s_[i+j] !=t[j] and s_[i+j]!='?': con1=False dic.clear() break else: dic[i+j]=t[j] if con1: lis=list(s_) if len(dic)!=0: for key in dic: lis[key]=dic[key] lis=''.join(lis)...
s660784938
p03565
u346308892
1509244791
Python
Python (3.4.3)
py
Runtime Error
17
3064
465
def compair(x,y): print("comp",x,y) if len(x)!=len(y): return False for i in range(len(x)): if x[i]!=y[i] and x[i]!='?': return False return True ss=input() T=input() flg=False for i in reversed(range(len(ss)-1)): if compair(ss[i:(i+len(T) )],T): flg=True ...
s885792382
p03565
u104922648
1509244768
Python
Python (3.4.3)
py
Runtime Error
17
3060
178
words = input() key = input() for i in range(len(words)): if words[i:i+len(key)] == key: words[i:i+len(key)] = key index = i else: print('UNRESTORABLE')
s386496584
p03565
u112902287
1509244672
Python
Python (3.4.3)
py
Runtime Error
17
3064
472
s_ = input() t = input() ls = len(s_) lt = len(t) for i in range(ls): nows = s_[ls-i-lt:ls-i] if len(nows) < lt: break isSame = True for j in range(lt): if nows[j] == "?" or nows[j] == t[j]: continue else: isSame = False break if isSame: ...
s205629891
p03565
u642905089
1509244518
Python
Python (3.4.3)
py
Runtime Error
20
3316
1116
from collections import defaultdict Ss = input() T = input() Tdic = defaultdict(lambda: len(T)) for idx,i in enumerate(T): Tdic[i] = len(T) -(idx+1) Tdic[T[-1]] = len(T) Tdic["?"] = 1 Flag = False mutchdic = dict() mutch = 0 head = len(T)-1 while(1): for i in range(len(T)): if...
s899931320
p03565
u925364229
1509244410
Python
Python (3.4.3)
py
Runtime Error
17
3064
634
S_raw = input() T_raw = input() S = list(S_raw) T = list(T_raw) i = 0 j = 0 j_list = [] S_list = [] lt = len(T) ls = len(S) while True: if j == ls or i == lt: if not i == lt: print("UNRESTORABLE") exit(0) elif j != ls: j_list.append(j) i = 0 j = j - lt + 2 else: j_list.append(j) break ...
s634729203
p03565
u023041408
1509244305
Python
Python (3.4.3)
py
Runtime Error
17
3064
986
import sys S = sys.stdin.readline().rstrip() T = sys.stdin.readline().rstrip() def checkValid(S, i, T): if S[i] == T[0]: for j in range(0, len(T)): if S[i+j] == T[j] or S[i+j] == '?': pass else: return False else: return False return ...
s042085927
p03565
u147628962
1509244212
Python
Python (3.4.3)
py
Runtime Error
17
3064
377
s_=input() t=input() n=len(s_) m=len(t) ind=0 dic={} for i in range(n-m+1): con1=True for j in range(m): if s_[i+j] !=t[j] and s_[i+j]!='?': con1=False dic.clear() break else: dic[i+j]=t[j] if con1: lis=list(s_) if len(dic)!=0: for key in dic: lis[key]=dic[key] lis=''.join(lis) lis=lis.repl...
s445972856
p03565
u677421794
1509244120
Python
Python (3.4.3)
py
Runtime Error
17
3064
651
# -*- coding: utf-8 -*- s = input() t = input() ansstr = [] for i in range(len(s)-len(t)+1)[::-1]: tmpstr = s[i:i+len(t)] flg = True for j in range(len(t)): if(tmpstr[j] == '?'): pass elif(tmpstr[j] == t[j]): pass else: flg = False if(...
s208131402
p03565
u023041408
1509243999
Python
Python (3.4.3)
py
Runtime Error
18
3064
959
import sys S = sys.stdin.readline() T = sys.stdin.readline() def checkValid(S, i, T): if S[i] == T[0]: for j in range(0, len(T)): if S[i+j] == T[j] or S[i+j] == '?': pass else: return False else: return False return True def getResu...
s481874376
p03565
u341855122
1509243936
Python
Python (3.4.3)
py
Runtime Error
22
3316
481
s = input() t = input() s = s[::-1] t = t[::-1] import re s2 = s.replace("?","9") temp = "" for i in t: temp += "("+i+"|9)" M = re.search(temp,s2) temp = [] if M: c = 0 while(c<len(s)): print(temp,c) if M.start()<=c and c < M.start() + len(t): temp.append(t[c]) c+=1 ...
s020003256
p03565
u147628962
1509243822
Python
Python (3.4.3)
py
Runtime Error
17
3064
357
s_=input() t=input() n=len(s_) m=len(t) ind=0 dic={} for i in range(n-m+1): con1=True for j in range(m): if s_[i+j] !=t[j] and s_[i+j]!='?': con1=False dic.clear() break else: dic[i+j]=t[j] if con1: lis=list(s_) for key in dic: lis[key]=dic[key] lis=''.join(lis) lis=lis.replace('?','a') print(...
s337735265
p03565
u214617707
1509243559
Python
Python (3.4.3)
py
Runtime Error
18
3064
1212
S = input() T = input() rec = [] for i in range(len(S)): flag = True Z = S for j in range(len(T)): if Z[i] == T[j]: for e in range(i - j): if Z[e] == "?": Z = Z.replace("?", "a", 1) for k in range(len(T)): if Z[i + k - j] ==...
s000464777
p03565
u677421794
1509243430
Python
Python (3.4.3)
py
Runtime Error
17
3064
634
# -*- coding: utf-8 -*- s = input() t = input() ansstr = [] for i in range(len(s)-len(t)+1): p = len(s)-len(t)-i tmpstr = s[p:p+len(t)] flg = True for j in range(len(t)): if(tmpstr[j] == '?'): pass elif(tmpstr[j] == t[j]): pass else: f...
s706925785
p03565
u482770395
1509243080
Python
Python (3.4.3)
py
Runtime Error
17
3064
570
S = input().strip() T = input().strip() rS = [] for i in range(len(S)): rS.append(S[i]) for i in range(len(rS) - len(T)): eq = True for j in range(len(T)): if not(rS[- i - j - 1] == T[- j - 1] or rS[- i - j - 1] == "?"): eq = not(eq) break if eq: for j in range(le...
s024251430
p03565
u007808656
1509243060
Python
PyPy3 (2.4.0)
py
Runtime Error
199
38640
256
s_=input() t=input() p=re.compile(s_.replace("?",".")) t_s=len(s_)-len(t) t_e=t_s+len(t) for t_s in range(t_s,-1,-1): s=s_[:t_s]+t+s_[t_e:] if(p.match(s)): s=s.replace("?","a") print(s) break else: print("UNRESTORABLE")
s503064532
p03565
u007808656
1509242964
Python
PyPy3 (2.4.0)
py
Runtime Error
167
40484
244
s_=input() t=input() t_s=len(s_)-len(t) t_e=t_s+len(t) for t_s in range(t_s,-1,-1): s=s_[:t_s]+t+s_[t_e:] if(re.match(s_.replace("?","."),s)): s=s.replace("?","a") print(s) break else: print("UNRESTORABLE")
s973234400
p03565
u214617707
1509242884
Python
Python (3.4.3)
py
Runtime Error
18
3064
656
S = input() T = input() rec = [] for i in range(len(S)): flag = True Z = S for j in range(len(T)): if Z[i] == T[j]: for e in range(i - j): if Z[e] == "?": Z = Z.replace("?", "a", 1) for k in range(len(T)): if Z[i + k - j] ==...
s181199399
p03565
u214617707
1509242813
Python
Python (3.4.3)
py
Runtime Error
18
3064
685
S = input() T = input() rec = [] for i in range(len(S)): flag = True Z = S for j in range(len(T)): if Z[i] == T[j]: for e in range(i - j): if Z[e] == "?": Z = Z.replace("?", "a", 1) for k in range(len(T)): if Z[i + k - j] ==...
s827805422
p03565
u482770395
1509242583
Python
Python (3.4.3)
py
Runtime Error
18
3064
548
S = input().strip() T = input().strip() rS = [] for i in range(len(S)): rS.append(S[i]) for i in range(len(rS) - len(T), -1, -1): eq = True for j in range(len(T)): if not(rS[i + j] == T[j] or rS[i + j] == "?"): eq = not(eq) break if eq: for j in range(len(T)): ...
s657569213
p03565
u214617707
1509242513
Python
Python (3.4.3)
py
Runtime Error
17
3064
734
S = input() T = input() rec = [] for i in range(len(S)): flag = True Z = S for j in range(len(T)): if Z[i] == T[j]: for e in range(i - j): if Z[e] == "?": Z = Z.replace("?", "a", 1) print(Z[i]) print(T[j]) for k in r...
s571650621
p03565
u214617707
1509242315
Python
Python (3.4.3)
py
Runtime Error
17
3064
724
S = input() T = input() rec = [] for i in range(len(S)): flag = True Z = S for j in range(len(T)): if Z[i] == T[j]: for e in range(i-j): if Z[e] == "?": Z = Z.replace("?","a",1) print(Z[i]) print(T[j]) for k in range...
s932524383
p03565
u007808656
1509242169
Python
PyPy3 (2.4.0)
py
Runtime Error
179
38640
302
s_=input() t=input() filled_idx=[i for i in range(len(s_)) if s_[i]!="?"] t_s=len(s_)-len(t) t_e=t_s+len(t) for t_s in range(t_s,-1,-1): s=s_[:t_s]+t+s_[t_e:] if(all(s[i]==s_[i] for i in filled_idx)): s=s.replace("?","a") print(s) break else: print("UNRESTORABLE")
s858199846
p03565
u007808656
1509242049
Python
Python (3.4.3)
py
Runtime Error
17
3064
302
s_=input() t=input() filled_idx=[i for i in range(len(s_)) if s_[i]!="?"] t_s=len(s_)-len(t) t_e=t_s+len(t) for t_s in range(t_s,-1,-1): s=s_[:t_s]+t+s_[t_e:] if(all(s[i]==s_[i] for i in filled_idx)): s=s.replace("?","a") print(s) break else: print("UNRESTORABLE")
s630628828
p03565
u893209854
1509241829
Python
Python (3.4.3)
py
Runtime Error
17
3064
407
import sys s = input() t = input() l = len(t) if t in s: print(s.replace('?', 'a')) sys.exit() for i in range(len(s) - l + 1): m = -1 f = True for j in range(l): if s[i:i+l][j] == '?' or s[i:i+l][j] == t[j]: pass else: f = False if f: m = i if m < ...
s648303177
p03565
u112581208
1509241714
Python
Python (3.4.3)
py
Runtime Error
17
3060
452
from IPython import embed S_prime = input() T = input() replaced = 'UNRESTORABLE' matched = True for i in range(len(S_prime) - len(T) + 1): for k in range(len(T)): if S_prime[i + k] != T[k] and S_prime[i + k] != '?': matched = False break matched = True if matched: ...
s146651020
p03565
u665415433
1509241345
Python
Python (3.4.3)
py
Runtime Error
17
3064
1320
Sd_ = input() T_ = input() Sd = [] T = [] S = [] check = False for i in range(len(Sd_)): Sd.append(Sd_[i]) for i in range(len(T_)): T.append(T_[i]) num = 0 for a in range(len(Sd)-1,0,-1): if Sd[a] is '?': num += 1 else: num = 0 if num >= len(T): for m in range(len(T)): ...
s491570030
p03565
u062864034
1509241301
Python
Python (3.4.3)
py
Runtime Error
17
3064
498
S1 = input() T = input() if len(S1) < T: print("UNRESTORABLE") quit() for i in range(len(S1)-len(T)+1): flag1 = True flag2 = True for s,t in zip(S1[i:i+len(T)],T): if s == "?" or s == t: pass else: flag1 = False break if flag1: flag2...
s294678761
p03565
u425448230
1509241108
Python
Python (3.4.3)
py
Runtime Error
18
3064
653
S = input() T = input() S = list(S) T = list(T) not_find = False start_i = 0 for i in range(s_l - t_l + 1): start_i = s_l - i - t_l here = True for j in range(t_l): if S[start_i+j] == T[j] or S[start_i+j] == '?': here = True else: here = False break ...
s880718354
p03565
u676264453
1509241092
Python
Python (3.4.3)
py
Runtime Error
17
3064
546
import sys def match(a, b): for i in range(len(a)): if a[i] != '?' and b[i] != '?' and a[i] != b[i]: return False return True Y=str(input()) T=str(input()) S = '' if match(T,Y[-len(T):]): S = Y[:-len(T)] + T A = S.replace('?','a') print(A) sys.exit() else: for i in ran...
s642360807
p03565
u062864034
1509241044
Python
Python (3.4.3)
py
Runtime Error
17
3064
445
S1 = input() T = input() for i in range(len(S1)-len(T)+1): flag1 = True flag2 = True for s,t in zip(S1[i:i+len(T)],T): if s == "?" or s == t: pass else: flag1 = False break if flag1: flag2 = False S1 = S1.replace(S1[i:i+len(T)],T) ...
s211602791
p03565
u839857256
1509240738
Python
Python (3.4.3)
py
Runtime Error
18
3064
1102
s = input() t = input() flag = 0 count = 0 for i in range(len(s)): if s[i] == '?' or s[i] in t: if count == 0: start = i count += 1 else: if count >= len(t): for j in range(count - len(t) + 1): check = 0 for k in range(len(t)): ...
s171700920
p03565
u893209854
1509240661
Python
Python (3.4.3)
py
Runtime Error
17
3060
339
s = input() t = input() l = len(t) for i in range(len(s) - l + 1): m = -1 f = True for j in range(l): if s[i:i+l][j] == '?' or s[i:i+l][j] == t[j]: pass else: f = False if f: m = i if m < 0: print('UNRESTORABLE') else: print((s[0:m] + t + s[m+l:])....
s777672510
p03565
u443170850
1509240543
Python
Python (3.4.3)
py
Runtime Error
17
3064
615
S_ = input() T = input() loop = len(S_) - len(T) + 1 stringlist = [] # check S_ in T for n in range(loop): chance = True for i in range(len(T)): if S_[n+i] == T[i] or S_[n+i] == "?": pass else: chance = False break if chance: tmp = S_[:n] + T + S...
s625171709
p03565
u443170850
1509240287
Python
Python (3.4.3)
py
Runtime Error
17
3064
613
S_ = input() T = input() loop = len(S_) - len(T) + 1 stringlist = [] # check S_ in T for n in range(loop): chance = True for i in range(len(T)): if S_[n+i] == T[i] or S_[n+i] == "?": pass else: chance = False break if chance: tmp = S_[:n] + T + S...
s475866979
p03565
u656771711
1509240195
Python
Python (2.7.6)
py
Runtime Error
11
2568
284
Sd=raw_input() T=raw_input() for index in range(len(Sd)-len(T),0,-1): flag=True for ind2 in range(len(T)): if not Sd[index+ind2] in ('?',T[ind2]): flag=False if flag: newS=Sd[:index]+T break if not flag: print "UNRESTORABLE" else: newS=newS.replace('?','a') print newS
s360263244
p03565
u942033906
1509239775
Python
Python (3.4.3)
py
Runtime Error
17
3188
376
S = input() T = input() start = len(S) - len(T) end = len(S) ans = '' while start >= 0: test = S[start:end] solve = True for i in range(len(T)): c1,c2 = test[i],T[i] if c1 != c2 and c1 != '?': solve = False break if solve: ans = S[:start] + T + S[end:] break start -= 1 end -= 1 if len(ans > 0): p...