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
s678985590
p03564
u010090035
1576938888
Python
Python (3.4.3)
py
Runtime Error
18
3064
303
import math n=int(input()) k=int(input()) b=2**n ans=math.inf for i in range(b): bit_b=bin(i)[2:].zfill(n) ans_i=1 for j in range(len(bit_b)): if(bit_b[j]=='0'): ans_i*=2 elif(bit_b[j]=='1'): ans_i+=k if(ans>ans_i): ans=ans_i print(ans)
s493022863
p03564
u518042385
1570138047
Python
Python (3.4.3)
py
Runtime Error
17
2940
107
n=int(input()) m=int(input()) num=1 for i in range(n): if num<k: num*=2 else: num+=k print(num)
s465185855
p03564
u670180528
1568237442
Python
Python (3.4.3)
py
Runtime Error
17
2940
71
n,k=map(int,input().split()) a=1 while a<k and n:a*=2;n-=1 print(a+k*n)
s778165617
p03564
u003501233
1566265193
Python
Python (3.4.3)
py
Runtime Error
17
2940
130
N=int(input()) k=int(input()) ans=1 for i in range(1,n): if ans*2 < ans+k: ans = ans*2 else: ans = ans+k print(ans)
s999557061
p03564
u092278825
1565628506
Python
Python (3.4.3)
py
Runtime Error
20
2940
77
N = input() K = input() c = 1 for i in range(N): c = min(c*2, c+K) print(c)
s698997963
p03564
u651879504
1565142759
Python
Python (3.4.3)
py
Runtime Error
17
2940
105
N = int(input()) K = int(input()) ans = 1 for i in range(N): ans = min(ans * 2 , ans + K) print(an
s931761380
p03564
u102461423
1560368212
Python
Python (3.4.3)
py
Runtime Error
17
2940
133
# 各時点で最小 N,K = map(int,input().split()) answer = 1 for _ in range(N): answer = min(answer*2, answer+K) print(answer)
s832325200
p03564
u507116804
1557366150
Python
Python (3.4.3)
py
Runtime Error
17
2940
100
n=int(input()) k=int(input()) a=1 for i range(n): if a >=k: a=+k else: a=2*a print(a)
s432283653
p03564
u507116804
1557366091
Python
Python (3.4.3)
py
Runtime Error
17
2940
99
n=int(input()) k=int(input()) a=1 for i range(n): if a >=k: a+=k else: a+=a print(a)
s639753881
p03564
u507116804
1557366053
Python
Python (3.4.3)
py
Runtime Error
17
2940
112
n=int(input()) k=int(input()) a=1 for i range(n): if a >=k: a=+k else: a=+a print(a)
s118336429
p03564
u856169020
1557232879
Python
Python (3.4.3)
py
Runtime Error
18
3060
136
N = int(input()) K = int(input()) dp = [0] * (N+10) dp[0] = 1 for i in range(1, N): dp[i] = min(d[i-1] * 2, d[i-1] + K) print(dp[N-1])
s597983059
p03564
u249447366
1555533034
Python
Python (3.4.3)
py
Runtime Error
17
2940
179
xi, yi, xii, yii = map(int, input().split()) dx = xii - xi dy = yii - yi x = xii y = yii for i in range(2): dx, dy = -dy, dx x += dx y += dy print(x, y, end=' ')
s468099960
p03564
u729133443
1551112622
Python
Python (3.4.3)
py
Runtime Error
18
2940
68
n=int(input());k=int(input()),r=1 for _ in[0]*n:r+=min(r,k) print(r)
s808983725
p03564
u931462344
1550215274
Python
Python (3.4.3)
py
Runtime Error
18
3064
742
def check(arr, x, y): d = ((0, -1), (0, 1), (1, -1), (1, 0), (1, 1), (-1, -1), (-1, 0), (-1, 1)) if arr[x][y] == '#': return -1 else: cnt = 0 for dx, dy in d: try: if (x+dx) >=0 and (y+dy) >= 0: if arr[x + dx][y + dy] == '#': ...
s834134492
p03564
u983918956
1542865249
Python
Python (3.4.3)
py
Runtime Error
17
2940
330
#include <bits/stdc++.h> using namespace std; int main() { int N,K; cin >> N >> K; // 初期値とKを比較 小さい方を足す int num = 1; for (int i = 0; i < N; i++) { if (num <= K) { num *= 2; } else { num += K; } } cout << num << endl; }
s298778254
p03564
u115682115
1532335781
Python
Python (3.4.3)
py
Runtime Error
17
3060
110
N = int(input()) K = int(input()) i = 1 for i in range(N): if i >= K: i += K else: i *= 2 print(i)
s698524727
p03564
u095969144
1530636874
Python
Python (3.4.3)
py
Runtime Error
17
2940
125
n = int(input()) k = int(input()) a = 1 for x range(n): if a * 2 > a + k: a + k else : a * 2 print(a)
s551791830
p03564
u391475811
1523462671
Python
Python (3.4.3)
py
Runtime Error
17
2940
109
N,K=map(int,input().split()) cnt=1 for i in range(N): if cnt <= K: cnt*=2 else: cnt+=K print(cnt)
s189217759
p03564
u108784591
1522468465
Python
Python (3.4.3)
py
Runtime Error
17
2940
112
N,K=map(int,raw_input().split()) ans=1 c=0 while c<N: if ans<K: ans=ans*2 else: ans=ans+K c+=1 print(ans)
s204885202
p03564
u702582248
1522453371
Python
Python (3.4.3)
py
Runtime Error
17
2940
98
import math n=int(input()) m=int(input()) s=1 for i in range(n): s = math.min(s*2, s+m) print(s)
s343296818
p03564
u803647747
1521497686
Python
Python (3.4.3)
py
Runtime Error
18
2940
205
N = int(input()) K = int(input()) compare_list = [] for i in range(N-1): start_num = 1 start_num *= 2**(N-i) start_num += K*(i) compare_list.append(start_num) print(min(compare_list))
s670165799
p03564
u803647747
1521497448
Python
Python (3.4.3)
py
Runtime Error
17
3064
328
N = int(input()) K = int(input()) def plus_K(x, num): return x + K*(num) def multip(x, num): return x*(2**(num)) compare_dict = {} for i in range(N-1): start_num = 1 start_num = multip(start_num, i) start_num = plus_K(start_num, N-i) compare_dict[i] = start_num print(min(compare_dict.va...
s954435918
p03564
u855186748
1521316161
Python
Python (3.4.3)
py
Runtime Error
17
2940
127
n,k = list(map(int,input().split())) num=1 for i in range(n): if num>k: num+=k else: num*=2 print(num)
s164329686
p03564
u879082556
1516383387
Python
Python (3.4.3)
py
Runtime Error
17
2940
119
n=int(input()) k=int(input()) a=1 for i in range (1:n): if a < k: a=2*a else: a=a+k print(a)
s338284723
p03564
u019584841
1511414232
Python
Python (3.4.3)
py
Runtime Error
18
2940
108
n=int(input()) k=int(input()) a=1 for i in range(1,n+1): if a >k: a=a+k else: a=2a
s867505961
p03564
u505422196
1509590983
Python
Python (3.4.3)
py
Runtime Error
17
3064
276
n = int(input()) k = int(input()) num = 2**n list = [format(str(i),"b").zfill(n) for i in range(num)] result = [] for i in list: a = 1 for j in len(i): if i[j] == "0": a *= 2 else: a += k result.apppend(a) print(max(result))
s821006064
p03564
u505422196
1509590850
Python
Python (3.4.3)
py
Runtime Error
18
3064
281
n = int(input()) k = int(input()) num = 2**n list = [format(i,"b").zfill(n) for i in range(num)] result = [] for i in list: a = 1 for j in range(len(i)): if i[j] == "0": a *= 2 else: a += k result.append(a) print(min(result))
s858232570
p03564
u708508881
1509553822
Python
Python (3.4.3)
py
Runtime Error
17
2940
101
N=input() K=input() a=1 for i in range(N): if a<K: a*=2 else: a+=K print(a)
s281169883
p03564
u743272507
1509378369
Python
Python (3.4.3)
py
Runtime Error
18
2940
91
n = int(input()) k = (int(input())) a = [(1<<x)+k*(n-x) for x in range(1,n)] print(min(a))
s830775945
p03564
u274907892
1509311906
Python
PyPy2 (5.6.0)
py
Runtime Error
40
27628
95
X = 1 N = input() K = input() for i in range(N): if(X*2 < X+K): X *= 2 else X += K print(X)
s311851828
p03564
u119982147
1509249398
Python
Python (3.4.3)
py
Runtime Error
18
2940
170
N = int(input()) K = int(input()) number = 1 for i in N: if number * 2 < number + K: number = number * 2 else: number = number + K print(number)
s608110615
p03564
u952708174
1509240085
Python
Python (3.4.3)
py
Runtime Error
17
2940
372
def B_Addition_and_Multiplication(N, K): if N==1: return 2 multiply = 0 # 掛け算する回数 add = 0 # 足し算する回数 tmp = 1 while tmp < K: tmp *= 2 multiply += 1 add = N - multiply ans = pow(2, multiply) + K * add return ans N = int(input()) K = int(input()) print(B_Addition_a...
s945851509
p03564
u942033906
1509238959
Python
Python (3.4.3)
py
Runtime Error
17
2940
112
N = int(input()) K = int(input()) ans = 1 for i in range(N) if ans < K: ans *= 2 else: ans += K print(ans)
s560420123
p03565
u750651325
1601249524
Python
Python (3.8.2)
py
Runtime Error
36
10356
1391
import re import sys import math import itertools import bisect from copy import copy from collections import deque,Counter from decimal import Decimal import functools def v(): return input() def k(): return int(input()) def S(): return input().split() def I(): return map(int,input().split()) def X(): return list(inpu...
s958586452
p03565
u750651325
1601248767
Python
Python (3.8.2)
py
Runtime Error
37
10336
1377
import re import sys import math import itertools import bisect from copy import copy from collections import deque,Counter from decimal import Decimal import functools def v(): return input() def k(): return int(input()) def S(): return input().split() def I(): return map(int,input().split()) def X(): return list(inpu...
s630006998
p03565
u651663683
1600392286
Python
PyPy3 (7.3.0)
py
Runtime Error
80
74700
307
s=input() t=input() ls=len(s) lt=len(t) for i in range(ls-lt,-1,-1): f=True for j in range(lt): if not(s[i+j]=="?" or s[i+j]==t[j]): f=False break if f: ns=s[:i]+t+s[i+lt:] print("".join(map(lambda x:"a" if x=="?" else x,list(ns)))) break if not f: print("UNRESTORABLE")
s656646479
p03565
u285443936
1600338182
Python
Python (3.8.2)
py
Runtime Error
25
9080
235
S = input() T = input() ls = len(S) lt = len(T) for i in range(ls-lt+1): for j in range(lt): if S[i] != "?" and S[i] != T[j]: break else: left = i ans = S[:i]+T+S[i+lt:] print(ans.replace("?","a"))
s975877650
p03565
u810625173
1600221333
Python
PyPy3 (7.3.0)
py
Runtime Error
90
74668
385
S = input() T = input() def solve(i): flag = True for j in range(len(T)): if i+j < len(S) and (S[i+j] == "?" or S[i+j] == T[j]): continue else: flag = False break return flag for i in range(len(S)): if solve(i): ansind = i if ansind: ans = S[:ansind] + T + S[ansind+len(T):] an...
s558855607
p03565
u216752093
1600031170
Python
Python (3.8.2)
py
Runtime Error
29
9080
469
s=list(input()) ls=len(s) t=list(input()) lt=len(t) can=set() for i in range(ls-lt,-1,-1): ok=0 for j in range(lt): if s[i+j]==t[j] or s[i+j]=='?': ok+=1 if ok==lt: c=s for k in range(ls): if c[k]=='?': if k<i: c[k]='a' ...
s204691200
p03565
u216752093
1600030290
Python
Python (3.8.2)
py
Runtime Error
26
8984
428
s=list(input()) ls=len(s) t=list(input()) lt=len(t) clear=0 for i in range(ls-lt,-1,-1): ok=0 for j in range(lt): if s[i+j]==t[j] or s[i+j]=='?': ok+=1 if ok==lt: clear=1 break if clear==0: print('UNRESTORABLE') else: for k in range(ls): if s[k]=='?': ...
s062397366
p03565
u682467216
1599873667
Python
PyPy3 (7.3.0)
py
Runtime Error
82
74636
1720
# coding=utf-8 from math import floor, ceil, sqrt, factorial, log, gcd from itertools import accumulate, permutations, combinations, product, combinations_with_replacement from bisect import bisect_left, bisect_right from collections import Counter, defaultdict, deque from heapq import heappop, heappush, heappushpop, h...
s186513057
p03565
u148981246
1599859110
Python
Python (3.8.2)
py
Runtime Error
30
9100
500
sd = input() t = input() for i in range(len(sd) - len(t) + 1): cnt = 0 q = 0 for j in range(len(t)): if sd[i + j] == '?': q += 1 continue if sd[i + j] == t[j]: cnt += 1 if cnt == len(t) - q: idx = i s = sd[:idx] + t + sd[idx + len(t) +...
s321524472
p03565
u306950978
1599849805
Python
PyPy3 (7.3.0)
py
Runtime Error
90
74616
479
s = input() n = len(s) t = input() m = len(t) if n < m: print("UNRESTORABLE") exit() p = False for i in reversed(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: s = s[:i] + t p = True ...
s564341496
p03565
u648315264
1599838994
Python
Python (3.8.2)
py
Runtime Error
33
9432
1408
import math from math import gcd,pi,sqrt INF = float("inf") import sys sys.setrecursionlimit(10**6) import itertools from collections import Counter,deque def i_input(): return int(input()) def i_map(): return map(int, input().split()) def i_list(): return list(i_map()) def i_row(N): return [i_input() for _ in range(N...
s701295794
p03565
u648315264
1599838966
Python
Python (3.8.2)
py
Runtime Error
31
9232
1423
import math from math import gcd,pi,sqrt INF = float("inf") import sys sys.setrecursionlimit(10**6) import itertools from collections import Counter,deque def i_input(): return int(input()) def i_map(): return map(int, input().split()) def i_list(): return list(i_map()) def i_row(N): return [i_input() for _ in range(N...
s695345171
p03565
u825429469
1599663648
Python
Python (3.8.2)
py
Runtime Error
31
9048
628
import sys a,b = [input() for i in range(2)] length = abs(len(a)-len(b)) for i in range(length+1): right_length = length - i temp = '?'*i+b+'?'*right_length #判定 judge = 0 for j in range(len(a)): if a[j] == temp[j] or temp[j] == '?': judge += 1 elif temp[j] != '?' ...
s326506312
p03565
u825429469
1599663151
Python
Python (3.8.2)
py
Runtime Error
24
9080
638
a,b = [input() for i in range(2)] length = abs(len(a)-len(b)) for i in range(length+1): right_length = length - i temp = '?'*i+b+'?'*right_length #判定 judge = 0 for j in range(len(a)): if a[j] == temp[j] or temp[j] == '?': judge += 1 elif temp[j] != '?' and a[j] == ...
s701733852
p03565
u998741086
1599628901
Python
Python (3.8.2)
py
Runtime Error
26
9076
456
#!/usr/bin/env python sp = input() t = input() n = len(sp) m = len(t) ok = False ii = 0 for i in range(n-m+1): for j in range(m): if sp[i+j] != '?' and sp[i+j] == t[j]: ok = True ii = i break if ok: break if not ok: print('UNRESTORABLE') exit()...
s989302498
p03565
u235210692
1599490965
Python
Python (3.8.2)
py
Runtime Error
30
9036
610
s=input() t=input() n=len(s) m=len(t) sentou=-1 def func(s,t,i): if i+m>n: return False check=0 for j in range(i,i+m): if s[j]==t[j-i] or s[j]=="?": check+=1 if check==m: return True return False for i in range(n): if func(s,t,i): sentou=i ans=[] i...
s749203023
p03565
u235210692
1599490893
Python
Python (3.8.2)
py
Runtime Error
27
9052
601
s=input() t=input() n=len(s) m=len(t) sentou=-1 def func(s,t,i): if i+m>n: return False check=0 for j in range(i,i+m): if s[j]==t[j-i] or s[j]=="?": check+=1 if check==m: return True return False for i in range(n): if func(s,t,i): sentou=i ans=[] i...
s724863118
p03565
u349449706
1599449568
Python
PyPy3 (7.3.0)
py
Runtime Error
362
74744
204
import re S,T=open(0) S=S.replace('?','.') s=len(S) t=len(T) B='z'*s c=0 for i in range(s-t+1): if re.search(S[i:i+t],T):A=min(A,(S[:i]+T+S[i+t:]).replace('.','a'));c=1 print(A if c else 'UNRESTORABLE')
s612934101
p03565
u419963262
1599441940
Python
Python (3.8.2)
py
Runtime Error
30
9088
598
s = input() t = input() s_length = len(s) t_length = len(t) ans = '' keep = '' check = False ans_remind = 0 for i in range(s_length): if s[i] == t[0]: check2 = True for j in range(t_length): if (s[i + j] != t[j]) & (s[i + j] != '?'): check2 = False if check2: ...
s777133833
p03565
u623814058
1599010216
Python
Python (3.8.2)
py
Runtime Error
27
9140
399
S=input() T=input() lt=len(T) ls=len(S) S+='%'*lt for i in range(ls-lt+1): # print('***',S[i:i+lt]) flg=1 for j in range(i,i+lt): s=S[j] # print(s,T[j-i]) if s=='?': continue if s=='%' or s!=T[j-i]: flg=0 break if flg==1: break if flg: ...
s475996141
p03565
u650932312
1598972233
Python
Python (3.8.2)
py
Runtime Error
36
9880
721
import re S_hint = input() T = input() ans = [] for i in range(len(T)): num = S_hint.count(T[i]) if num == 0: continue else: index = [] p = -1 for j in range(num): q = S_hint[p+1:].index(T[i])+p+1 index.append(q) p = q for j in in...
s614801787
p03565
u847923740
1598718612
Python
PyPy3 (7.3.0)
py
Runtime Error
86
74708
959
Sp = input() T = input() if len(T) > len(Sp): print("UNRESTORABLE") exit() oklist = [] for i in range(len(Sp) - len(T), -1,Sp = input() T = input() if len(T) > len(Sp): print("UNRESTORABLE") exit() oklist = [] for i in range(len(Sp) - len(T), -1, -1): for j in range(len(T)): if Sp[i + j] != "?" and Sp[i + ...
s814528084
p03565
u343977188
1598412995
Python
Python (3.8.2)
py
Runtime Error
26
9032
454
S=str(input()) T=str(input()) ls=len(S) lt=len(T) ans='' flag=0 for i in range(ls-lt,-1,-1): flag=0 for j in range(lt): if not (S[i+j] == T[j] or S[i+j] == '?'): flag=1 break if flag==0: loc=i flag=0 break if flag==1: print('UNRESTORABLE') else: i=0 while i<ls: if i==loc: ...
s635289817
p03565
u343977188
1598412894
Python
Python (3.8.2)
py
Runtime Error
27
9100
443
S=str(input()) T=str(input()) ls=len(S) lt=len(T) ans='' flag=0 for i in range(ls-lt,-1,-1): flag=0 for j in range(lt): if not (S[i+j] == T[j] or S[i+j] == '?'): flag=1 break if flag==0: loc=i break if flag==0: print('UNRESTORABLE') else: i=0 while i<ls: if i==loc: ans +=...
s811198073
p03565
u343977188
1598412824
Python
Python (3.8.2)
py
Runtime Error
25
9152
435
S=str(input()) T=str(input()) ls=len(S) lt=len(T) ans='' for i in range(ls-lt,-1,-1): flag=0 for j in range(lt): if not (S[i+j] == T[j] or S[i+j] == '?'): flag=1 break if flag==0: loc=i break if loc>-1: print('UNRESTORABLE') else: i=0 while i<ls: if i==loc: ans += T ...
s583697439
p03565
u343977188
1598412613
Python
Python (3.8.2)
py
Runtime Error
27
9160
438
S=str(input()) T=str(input()) ls=len(S) lt=len(T) ans='' for i in range(ls-lt,-1,-1): flag=0 for j in range(lt): if not (S[i+j] == T[j] or S[i+j] == '?'): flag=1 break if flag==0: loc=i break if flag != 0: print('UNRESTORABLE') else: i=0 while i<ls: if i==loc: ans += T ...
s109098621
p03565
u343977188
1598412365
Python
Python (3.8.2)
py
Runtime Error
27
9164
456
S=str(input()) T=str(input()) ls=len(S) lt=len(T) if ls<lt: print('UNRESTORABLE') ans='' for i in range(ls-lt,-1,-1): flag=0 for j in range(lt): if not (S[i+j] == T[j] or S[i+j] == '?'): flag=1 break if flag==0: loc=i break if flag==1: print('UNRESTORABLE') else: i=0 while i<ls: ...
s570138354
p03565
u343977188
1598411928
Python
Python (3.8.2)
py
Runtime Error
30
9092
422
S=str(input()) T=str(input()) ls=len(S) lt=len(T) ans='' for i in range(ls-lt,-1,-1): flag=0 for j in range(lt): if not (S[i+j] == T[j] or S[i+j] == '?'): flag=1 break if flag==0: loc=i break if flag==1: print('UNRESTORABLE') else: i=0 while i<ls: if i==loc: ans+=T ...
s698171850
p03565
u156815136
1598016160
Python
Python (3.8.2)
py
Runtime Error
24
9120
2030
LEEEE #from statistics import median #import collections #aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0] from fractions import gcd from itertools import combinations,permutations,accumulate, product # (string,3) 3回 #from collections import deque from collections import deque,defaultdi...
s785611834
p03565
u006880673
1597454204
Python
PyPy3 (7.3.0)
py
Runtime Error
106
73768
1062
Sd = input() T = input() Sd = list(Sd) N = len(Sd) start_idxs = [] is_t_ing = 0 counter = 0 for i in range(N): if counter == len(T): is_t_ing = 0 counter = 0 if not is_t_ing: if Sd[i] == T[0]: is_t_ing = 1 start_idxs.append(i) counter = 1 else: ...
s157966727
p03565
u760961723
1597356592
Python
Python (3.8.2)
py
Runtime Error
29
9208
851
import copy S_dash = input() T = input() len_S = len(S_dash) len_T = len(T) candidate0 = list(S_dash) ans = "z"*51 if len_S >= len_T: for s in range(len_S): cha_S = S_dash[s] if cha_S != "?" and cha_S in list(T): for t in range(len_T): cha_T = T[t] if cha_S == cha_T: S_cut...
s142622053
p03565
u760961723
1597356554
Python
Python (3.8.2)
py
Runtime Error
26
9036
850
import copy S_dash = input() T = input() len_S = len(S_dash) len_T = len(T) candidate0 = list(S_dash) ans = "z"*51 if len_S >= len_T: for s in range(len_S): cha_S = S_dash[s] if cha_S != "?" and cha_S in list(T): for t in range(len_T): cha_T = T[t] if cha_S == cha_T: S_cut...
s963732613
p03565
u413659369
1597343897
Python
Python (3.8.2)
py
Runtime Error
24
9100
542
from copy import deepcopy S = list(input()) T = list(input()) s_num = len(S) t_num = len(T) S_copy = deepcopy(S) if s < t: print('UNRESTORABLE') else: for i in range(s_num-t_num, -1, -1): s_key = S[i:i+t_num] judge = 0 for s, t in zip(s_key, T): if s=='?': judge += 1 elif s == t: ...
s869397454
p03565
u682672120
1597268592
Python
Python (3.8.2)
py
Runtime Error
25
9152
520
s = input() t = input() sn = len(s) tn = len(t) for i in range(sn-tn, -1, -1): matched = True for j in range(tn): if s[i+j] != t[j] and s[i+j] != '?': matched = False break if matched: break if not matched: print("UNRESTORABLE") quit() ans = ['a'] * sn for j ...
s986722339
p03565
u367323774
1597255266
Python
Python (3.8.2)
py
Runtime Error
28
9100
702
c=input() t=input() lic=list(c) lit=list(t) ans=[] lia=[] n=len(c)-len(t) End=False for i in range(n+1): hantei=True s='?'*i+t+'?'*(n-i) lis=list(s) for j in range(len(c)): p=lic[j] q=lis[j] a=(p==q) if a==False and (p!='?' and q!='?'): hantei = False ...
s864587191
p03565
u068727970
1597067083
Python
Python (3.8.2)
py
Runtime Error
43
9076
544
S = list(input()) T = list(input()) pos = [] for i in range(len(S)): if S[i] == T[0]: flag = 1 for j in range(len(T)): if not T[j] == S[i+j] and not S[i+j] == '?': flag = 0 break if flag: pos.append(i) if not pos: print('UNRESTORAB...
s284636672
p03565
u202634017
1597014775
Python
Python (3.8.2)
py
Runtime Error
36
9076
613
s = list(input()) t = list(input()) ans = ["UNRESTORABLE"] for i in range(len(s)): if s[i] != "?": for j in reversed(range(len(t))): if t[j] == s[i]: f = True for k in range(len(t)): if not 0 <= i - j + k < len(t): f = F...
s860127983
p03565
u202634017
1597014725
Python
Python (3.8.2)
py
Runtime Error
31
9148
579
s = list(input()) t = list(input()) ans = ["UNRESTORABLE"] for i in range(len(s)): if s[i] != "?": for j in reversed(range(len(t))): if t[j] == s[i]: f = True for k in range(len(t)): if not 0 <= i - j + k < len(t): break...
s698316699
p03565
u202634017
1597014657
Python
Python (3.8.2)
py
Runtime Error
33
9148
497
s = list(input()) t = list(input()) ans = ["UNRESTORABLE"] for i in range(len(s)): if s[i] != "?": for j in reversed(range(len(t))): if t[j] == s[i]: f = True for k in range(len(t)): f &= (s[i - j + k] == "?" or s[i - j + k] == t[k]) ...
s956034132
p03565
u015593272
1596984001
Python
Python (3.8.2)
py
Runtime Error
27
9084
1361
def main(): S_part = list(input()) T_hint = list(input()) N = len(S_part) ans = [] for i in range(N): index_init = i if (index_init + len(T_hint) <= N): s = S_part[index_init:index_init + len(T_hint)] module = ''.join(S_part[index_in...
s504910543
p03565
u401686269
1596956029
Python
Python (3.8.2)
py
Runtime Error
27
9168
433
S=input() T=input() count=0 idx=0 ok=0 for i in range(len(S)): if S[i]==T[count] or S[i] == '?': count += 1 else: count = 0 if count == len(T): idx = i-count+1 ok=1 if not ok: print('UNRESTORABLE') exit() ans=[] for i in range(len(S)): if i in range(idx,idx+count): ans.append(T[i-...
s454150021
p03565
u102902647
1596687157
Python
Python (3.8.2)
py
Runtime Error
31
9024
842
S = input() T = input() def func(s_tmp, T): flag = True for si, ti in zip(s_tmp, T): if si == '?': pass elif si == ti: pass else: flag = False break return flag len_s = len(S) len_t = len(T) inv_S = S[::-1] inv_T = T[::-1] if len_s-le...
s858897363
p03565
u102902647
1596686728
Python
Python (3.8.2)
py
Runtime Error
26
9164
841
S = input() T = input() def func(s_tmp, T): flag = True for si, ti in zip(s_tmp, T): if si == '?': pass elif si == ti: pass else: flag = False break return flag len_s = len(S) len_t = len(T) inv_S = S[::-1] inv_T = T[::-1] if len_s-le...
s404241588
p03565
u501451051
1596553973
Python
Python (3.8.2)
py
Runtime Error
26
9168
571
s = list(input()) t = list(input()) if len(t) > len(s): print('UNRESTORABLE') exit() lis = [] flag = 0 for i in range(len(s)): if s[i] == t[0]: for j in range(i+1, i+len(t)-1): if s[j] == '?' or s[j] == t[j-i]: flag = 1 else: flag = 0 ...
s784225209
p03565
u501451051
1596553219
Python
Python (3.8.2)
py
Runtime Error
26
9152
503
s = list(input()) t = list(input()) if len(t) > len(s): print('UNRESTORABLE') exit() flag = 0 for i in range(len(s)): if s[i] == t[0]: for j in range(i+1, i+len(t)-1): if s[j] == '?': flag = 1 else: flag = 0 break if ...
s745540086
p03565
u501451051
1596553120
Python
Python (3.8.2)
py
Runtime Error
24
9008
445
s = list(input()) t = list(input()) flag = 0 for i in range(len(s)): if s[i] == t[0]: for j in range(i+1, i+len(t)-1): if s[j] == '?': flag = 1 else: flag = 0 break if flag: s[i:i+len(t)+1] = t break if flag =...
s123236740
p03565
u391819434
1596316264
Python
Python (3.8.2)
py
Runtime Error
29
9020
387
S=input() T=input() Rs=list(S)[::-1] Rt=list(T)[::-1] N=len(S) M=len(T) i=0 while i+M<N: j=0 while j<M: if Rs[i+j]=='?' or Rs[i+j]==Rt[j]: j+=1 else: i+=1 break if j==M: break if j!=M: ans='UNRESTORABLE' else: for t in Rt: Rs[i]=t...
s575768244
p03565
u373047809
1595951390
Python
Python (3.8.2)
py
Runtime Error
29
9064
179
s,t=input(),input();l,m=len(s),len(t) for i in range(l-m+1): if all(c in"?"+d for c,d in zip(S[-i-m:],t)):s=s.replace(*"?a");exit(print(s[:-i-m]+t+s[l-i:])) print("UNRESTORABLE")
s045915175
p03565
u464205401
1595905156
Python
Python (3.8.2)
py
Runtime Error
28
9044
378
ss = input()[::-1] #s' t = input()[::-1] s = '?' *len(ss) for k in range(len(ss)): if ss[k]!="?": break for i in range(k+len(t)): cnt=0 for j in range(len(t)): if ss[i+j]==t[j] or ss[i+j]=="?": cnt+=1 if cnt==len(t): break if cnt==len(t): s=ss[:i]+t+ss[i+len(t):] # print(s[::-1]) print...
s496848263
p03565
u464205401
1595904910
Python
Python (3.8.2)
py
Runtime Error
25
9108
389
ss = input()[::-1] #s' t = input()[::-1] s = '?' *len(ss) for k in range(len(ss)): if ss[k]!="?": break for i in range(k-len(t)+1,k+len(t)): cnt=0 for j in range(len(t)): if ss[i+j]==t[j] or ss[i+j]=="?": cnt+=1 if cnt==len(t): break if cnt==len(t): s=ss[:i]+t+ss[i+len(t):] # print(s[::-...
s322294657
p03565
u464205401
1595902404
Python
Python (3.8.2)
py
Runtime Error
31
9028
316
ss = input()[::-1] #s' t = input()[::-1] s = '?' *len(ss) for i in range(len(ss)-len(t)+1): cnt=0 for j in range(len(t)): if ss[i+j]==t[j] or ss[i+j]=="?": cnt+=1 if cnt==len(t): break if cnt==len(t): s=ss[0:i]+t+ss[i+len(t):] print(s.replace('?', 'a')[::-1]) else: print('UNRESTORABLE')
s604589509
p03565
u464205401
1595902244
Python
Python (3.8.2)
py
Runtime Error
27
9136
298
ss = input() #s' t = input() s = '?' *len(ss) for i in range(len(ss)-len(t)+1): cnt=0 for j in range(len(t)): if ss[i+j]==t[j] or ss[i+j]=="?": cnt+=1 if cnt==len(t): break if cnt==len(t): s=ss[0:i]+t+ss[i+len(t):] print(s.replace('?', 'a')) else: print('UNRESTORABLE')
s853898291
p03565
u733866054
1595703983
Python
Python (3.8.2)
py
Runtime Error
26
9008
311
S=input() T=input() n=len(S) m=len(T) for i in range(n-m+1,-1,-1) : x=S[i:i+m] for j in range(m+1): if j==m : print((S[:i]+T+S[i+m:]).replace("?","a")) exit() if x[j]=="?" : continue elif x[j]!=T[j] : break print("UNRESTORABLE")
s849565063
p03565
u733866054
1595703905
Python
Python (3.8.2)
py
Runtime Error
26
9056
325
S=input() T=input() n=len(S) m=len(T) for i in range(n-m+1,-1,-1) : x=S[i:i+m] print(x) for j in range(m+1): if j==m : print((S[:i]+T+S[i+m:]).replace("?","a")) exit() if x[j]=="?" : continue elif x[j]!=T[j] : break print("UNRESTORAB...
s940951207
p03565
u923662841
1595605372
Python
Python (3.8.2)
py
Runtime Error
26
8992
370
S = input() s = len(S) T = input() t = len(T) key = 0 for i in range(0,s-t+1): for j,k in enumerate(S[i:i+t]): if k == T[j] or k =="?": pass else: break else: key = i break key = 100 if key == 100: print("UNRESTORABLE") else: ans = S[0:i]+T+S[i...
s552472429
p03565
u370721525
1594753201
Python
Python (3.8.2)
py
Runtime Error
24
9092
466
S = str(input()) T = str(input()) s = len(S) t = len(T) for i in range(s-t+1): num = s-t-i tmp = S[num:num+t] flag = True for j in range(t): if (tmp[j]!='?') and (T[j]!=tmp[j]): flag = False break if flag: if 0 < num < s-t: ans = S[:num] + T + S[num+t:] elif num == 0: ans ...
s878876070
p03565
u370721525
1594753097
Python
Python (3.8.2)
py
Runtime Error
29
9072
363
S = str(input()) T = str(input()) s = len(S) t = len(T) for i in range(s-t+1): num = s-t-i tmp = S[num:num+t] flag = True for j in range(t): if (tmp[j]!='?') and (T[j]!=tmp[j]): flag = False break if flag: ans = S[:num] + T + S[num+t:] break if flag: ans = ans.replace('?', 'a')...
s909955869
p03565
u232873434
1594731947
Python
PyPy3 (7.3.0)
py
Runtime Error
80
74488
883
s = input() t = input() s_num = len(s) t_num = len(t) ans_list = [] if s_num<t_num: ans_list.append('UNRESTORABLE') else: ind_list = [] for i in range(s_num -t_num + 1): flg = True for j in range(t_num): if s[i+j] == '?': pass elif s[i+j]==t[j]: ...
s888238812
p03565
u232873434
1594731883
Python
PyPy3 (7.3.0)
py
Runtime Error
466
79040
883
s = input() t = input() s_num = len(s) t_num = len(t) ans_list = [] if s_num<t_num: ans_list.append('UNRESTORABLE') else: ind_list = [] for i in range(s_num -t_num + 1): flg = True for j in range(t_num): if s[i+j] == '?': pass elif s[i+j]==t[j]: ...
s081550226
p03565
u626881915
1594564171
Python
PyPy3 (7.3.0)
py
Runtime Error
85
74684
479
s = input() t = input() if len(s) < len(t): print("UNRESTORABLE") exit() start = -1 for i in range(len(s)-len(t)+1): for j in range(len(t)): if s[i+j] != "?" and s[i+j] != t[j]: break else: start = i if start == -1: print("UNRESTORABLE") else: ans_list = list(s) for i in range(len(ans_list...
s997037784
p03565
u061361273
1594222354
Python
Python (3.8.2)
py
Runtime Error
25
8804
620
#include <iostream> using namespace std; bool match(string s, string t, int j){ for (int i=0; i<t.length(); i++){ if (s[j+i]!='?' and s[j+i]!=t[i]) { return false; } } return true; } int main() { string s, t;//??p??d??, ab cin>> s>>t; bool matched = false; int point = -1; for (int i=0; i<=s.length()-...
s933901216
p03565
u603958124
1594088265
Python
Python (3.8.2)
py
Runtime Error
37
9960
1106
from math import ceil,floor,comb,factorial,gcd,pow,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf from itertools import accumulate,permutations,combinations,product,combinations_with_replacement from collections import deque,defaultdict,Counter from bisect import bisect_left,bisect_right from operator impo...
s029007504
p03565
u114720832
1593284409
Python
Python (3.8.2)
py
Runtime Error
32
9840
232
import re S,T = input().split() if not re.match(r"^.*("+"\?"*len(T)+")",S): print("UNRESTORABLE") else: startN=re.match(r"^.*("+"\?"*len(T)+")",S).span(1)[0] S=S[:startN-1]+T+S[startN+len(T):] S=S.replace("?","a") print(S)
s920453685
p03565
u114720832
1593283886
Python
Python (3.8.2)
py
Runtime Error
34
9776
150
import re S,T = input().split() startN=re.match(r"^.*("+"\?"*len(T)+")",S).span(1)[0] S=S[:startN-1]+T+S[startN+len(T):] S=S.replace("?","a") print(S)
s979143142
p03565
u867826040
1593214775
Python
Python (3.8.2)
py
Runtime Error
26
8904
346
s = input() t = input() w = [] for i in range(len(s) - len(t) + 1): f = True sx = s[i:i + len(t)] for si, ti in zip(sx, t): if si != ti and si != "?": f = False else: pass if f: w.append((s[:i] + t).replace("?", "a")) if w == []: print("UNRESTORABLE") ...
s734856205
p03565
u812576525
1593048587
Python
Python (3.8.2)
py
Runtime Error
28
8992
357
S = input() T = input() for i in range(len(S)- len(T)+1): X = S[i:i+len(T)] #print(X) flag = True for j in range(len(T)): if X[j] != '?' : if X[j] != T[j]: flag = False break if flag == True: s = S[:i] + T + S[i+len(T):] print(s.replace('?','...
s899382094
p03565
u485319545
1592872482
Python
Python (3.8.2)
py
Runtime Error
27
9064
1173
s=input() t=input() alp='abcdefghijklmnopqrstuvwxyz' d={} e={} for i in range(len(alp)): d[i]=alp[i] e[alp[i]]=i c=[] q='' for i in range(len(t)+1): q=(t[:i] + '?'*(len(t)-i)) m=s.rfind(q) if m==-1: continue c.append(m) h=[] for j in range(len(t),len(s)+1,1): q='?'*j m=s.rf...