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
s000522175
p02571
u945342410
1598731129
Python
Python (3.8.2)
py
Runtime Error
26
9004
467
sList = list(input()) tList = list(inout()) numList = [] for ti,t in enumerate(tList): num = 0 for si,s in enumerate(sList): tnum = ti snum = si while tList[tnum] == sList[snum]: num += 1 tnum += 1 snum += 1 if tnum >= len(tList): break if snum >= len(sList): break numL...
s789325423
p02571
u231570044
1598731092
Python
Python (3.8.2)
py
Runtime Error
699
137936
263
S = input() T = input() for i in range(len(T), 0, -1): for j in range(len(T)-i+1): subst = T[j:i+j] print(subst) if S.find(subst, j, len(S)-(len(T)-i-j))>=0: print (len(T)-i) # print(subst) exit(0)
s776769022
p02571
u885315507
1598731065
Python
Python (3.8.2)
py
Runtime Error
69
8884
207
S = input() T = input() L = len(S) l = len(T) r = [] for i in range(L - l): x = 0 for k in range(i, i + l): if S[k] == T[k - i]: x += 1 r.append(x) y = max(r) print(l - y)
s903105829
p02571
u006738234
1598731060
Python
Python (3.8.2)
py
Runtime Error
110
9152
329
s = list(str(input())) t = list(str(input())) x = [0] a = 0 for i in range(len(s)): if((s[i] == t[0]) and ((len(s)-i) >= (len(t)-1))): a += 1 for k in range(1,len(t)): if(s[i+k] == t[k] and (s[i+k-1] == t[k-1])): a += 1 x.append(a+1) a = 0 y = max(x) print((len...
s782190225
p02571
u137191729
1598731029
Python
PyPy3 (7.3.0)
py
Runtime Error
94
68628
499
def inp(): return(int(input())) def inlt(): return(list(map(int,input().split()))) def insr(): s = input() return(list(s[:len(s) ])) def invr(): return(map(int,input().split())) I = input() first = s[0] second = s[1] vec = c() i=0 while len(vec)==0: j = len(second)- i for k in range(1,i+1) ...
s773186962
p02571
u942388574
1598731026
Python
Python (3.8.2)
py
Runtime Error
60
8936
315
# -*- coding: utf-8 -*- """ Created on Sat Aug 29 21:12:17 2020 @author: naoki """ S = input() T = input() count = [0 for i in range(len(S)-len(T))] for i in range(len(S)-len(T)): for j in range(len(T)): if S[i+j] != T[j]: count[i]+=1 count = sorted(count) print(count[0])
s898222349
p02571
u706659319
1598731023
Python
PyPy3 (7.3.0)
py
Runtime Error
120
68644
261
S = input() T = input() LS = len(S) LT = len(T) L = [] if T in S: print(0) else: for ls in range(LS - LT): d = 0 for lt in range(LT): if S[ls + lt:ls + LT] != T[lt]: d += 1 L.append(d) print(min(L))
s581610841
p02571
u211544300
1598731014
Python
Python (3.8.2)
py
Runtime Error
27
8988
375
#include <bits/stdc++.h> using namespace std; char s[1111], t[1111]; int main(void) { int i, j, ans = 1000; scanf("%s %s", s + 1, t + 1); int n = strlen(s + 1); int m = strlen(t + 1); for (i = 1; i <= n - m + 1; i++) { int p = 0; for (j = i; j <= i + m - 1; j++) if (s[j] != t[j - i + 1]) p++; ...
s369079946
p02571
u643679148
1598730990
Python
Python (3.8.2)
py
Runtime Error
31
9176
171
n = int(input()) a = list(map(int, input().split())) sums = 0 for i in range(n-1): for j in range(i+1, n): sums += (a[i] * a[j]) print(sums % (10 ** 9 + 7))
s211005319
p02571
u119015607
1598730947
Python
Python (3.8.2)
py
Runtime Error
92
14528
288
S= input() T= input() l=[] for i in range(len(S)-len(T)+1): A=S[i:i+(len(T))] #print(A) count=0 for j in range(len(A)): if A[j] == T[j]: count+=1 #print(count) l.append(count) #print(l) a=len(T)-max(l) print(a)
s542151636
p02571
u161857931
1598730928
Python
Python (3.8.2)
py
Runtime Error
45
9032
204
S = input() T = input() mS = [] d = len(S) - len(T) for j in range(d): m = 0 for i in range(len(T)): if S[i] != T[i] : m += 1 mS.append(m) S = S[1:] print(min(mS))
s717873226
p02571
u143051858
1598730910
Python
Python (3.8.2)
py
Runtime Error
34
9080
352
import math s = list(input()) t = list(input()) s.reverse() s=''.join(s) t.reverse() t=''.join(t) n = s.index(t[0]) res = len(t) num =0 while len(s)>=len(t): if len(s)<=len(t) and s[0] != t[0]:break n = s.index(t[0]) for i in range(len(t)): if t[i]!=s[i+n]: num+=1 res = min(res,num)...
s386848828
p02571
u071905007
1598730900
Python
Python (3.8.2)
py
Runtime Error
66
9064
223
S=list(map(str,input())) T=list(map(str,input())) X=[] Z=0 for I in range(len(S)-len(T)): Y=S[I:I+len(T)] Z=0 for J in range(len(T)): if Y[J]==T[J]: Z=Z+1 X.append(Z) print(len(T)-max(X))
s155781093
p02571
u885315507
1598730894
Python
Python (3.8.2)
py
Runtime Error
71
8964
207
S = input() T = input() L = len(S) l = len(T) r = [] for i in range(L - l): x = 0 for k in range(i, i + l): if S[k] == T[k - i]: x += 1 r.append(x) y = max(r) print(l - y)
s072517329
p02571
u209268771
1598730886
Python
Python (3.8.2)
py
Runtime Error
76
9120
632
s = str(input()) t = str(input()) slen = len(s) tlen = len(t) i = tlen n = 0 a = 0 tuu = [0] * tlen ans = [0] * tlen max_count = 0 while i <= slen: ps = s[ n : i + tlen -1 ] count = 0 for j in range(tlen): if ps[j] == t[j]: count += 1 tuu[j] = "True" # print("通っ...
s238811740
p02571
u885315507
1598730841
Python
Python (3.8.2)
py
Runtime Error
71
8992
206
s = input() t = input() L = len(s) l = len(t) r = [] for i in range(L - l): x = 0 for k in range(i, i + l): if s[k] == t[k - i]: x += 1 r.append(x) y = max(r) print(l - y)
s504592836
p02571
u654517927
1598730796
Python
Python (3.8.2)
py
Runtime Error
96
9084
426
date0=input() date1=input() list=[] if len(date1)>len(date0)-len(date1): N=len(date0)-len(date1) else: N=len(date1) for i in range(N): if date1[i] in date0[i:]: j=0 result=1 for j in range(len(date1)-i-1): if date1[i:j+i+2] in date0[i:]: result += 1 ...
s445577931
p02571
u879584308
1598730731
Python
PyPy3 (7.3.0)
py
Runtime Error
629
77460
367
def main(): s = str(input()) t = str(input()) if len(s) < len(t): print(0) else: l = [] for i in range(len(s)-len(t)): l.append(s[i:i+len(t)]) ans = [] for c in l: counter = 0 for i in range(len(c)): if list(c)[i] == t[i]: counter += 1 ans.append(counter) print(len(t)-max(a...
s989639863
p02571
u879584308
1598730703
Python
PyPy3 (7.3.0)
py
Runtime Error
94
68580
369
def main(): s = str(input()) t = str(input()) if len(s) > len(t): print(0) else: l = [] for i in range(len(s)-len(t)): l.append(s[i:i+len(t)]) ans = [] for c in l: counter = 0 for i in range(len(c)): if list(c)[i] == t[i]: counter += 1 ans.append(counter) print(len(t)-max...
s024363953
p02571
u885315507
1598730701
Python
Python (3.8.2)
py
Runtime Error
33
8952
283
s = input() t = input() L = len(s) l = len(t) print(L, l) r = [] print("L-l=", L-l) for i in range(L - l): x = 0 print("i + l=", i + l) for k in range(i, i + l - 2): if s[k] == t[k]: x += 1 print("x=", x) r.append(x) y = max(r) print(l - y)
s141476715
p02571
u720558413
1598730687
Python
Python (3.8.2)
py
Runtime Error
19
8916
252
S = input() T = input() min_count = 10000000 for i in range(len(S)-len(T)+1): if S[i] = T[0]: count = 0 for j in range(1,len(T)): if S[i+j] != T[j]: count += 1 if count < min_count: min_count = count print(min_count)
s798426311
p02571
u619785253
1598730675
Python
Python (3.8.2)
py
Runtime Error
27
9136
311
import itertools def main(): s = input() t = input() for i in range(len(t)): if t[0:i] in s: # print(t[0:i],s,i) ans1 = i if t[i:] in s: # print(t[i:],s,i) ans2 = len(t)-i print(len(t)-max(ans1,ans2)) #print(ans1,ans2) if __name__ == '__main__': main()
s926341840
p02571
u785618718
1598730659
Python
Python (3.8.2)
py
Runtime Error
27
9124
220
S = input() T = input() min = length(T) for index in range( length(S)-length(T)+1 ): temp = 0 for index2 in range(T): if T[index2] == S[index+index2]: temp += 1 if temp < min: min = temp print(min)
s723597461
p02571
u249335194
1598730657
Python
Python (3.8.2)
py
Runtime Error
61
9016
501
s=input() t=input() S=[] c=0 for i in range(len(s)): if s[i] in t: c+=1 p=len(t)-1 q=t.index(s[i]) if q>i or i-q+p+1>len(s): pass else: s1=s[i-q:i+p-q+1] count=0 for j in range(len(s1)): if s1[j]!=t[...
s663340934
p02571
u633535831
1598730637
Python
Python (3.8.2)
py
Runtime Error
71
9520
766
#from functools import lru_cache import sys from itertools import product,combinations from functools import reduce,lru_cache def vfunc(f): return lambda *lst, **kwargs: list(map(lambda *x:f(*x,**kwargs),*lst)) def list_t(l): return vfunc(lambda *args:args)(*l) def rvfunc(f): return lambda *lst, **kwargs: list(map(l...
s359290630
p02571
u790970861
1598730618
Python
Python (3.8.2)
py
Runtime Error
24
8956
403
S = input() T = input() counter_dict = {} for i in range(len(S)): counter = 0 for j in range(len(T)): if i + j < len(S): if S[i + j] == T[j]: counter += 1 else counter = 0 if str(i) in counter_dict.keys(): if counter_dict[str(i)] < counter: counter_dict[str(i)] = counter else: counter_dict[str...
s603249642
p02571
u879584308
1598730601
Python
PyPy3 (7.3.0)
py
Runtime Error
1143
77412
309
def main(): s = str(input()) t = str(input()) l = [] for i in range(len(s)-len(t)): l.append(s[i:i+len(t)]) ans = [] for c in l: counter = 0 for i in range(len(c)): if list(c)[i] == t[i]: counter += 1 ans.append(counter) print(len(t)-max(ans)) if __name__ == '__main__': main()
s660909958
p02571
u207582576
1598730588
Python
Python (3.8.2)
py
Runtime Error
22
9016
251
S, T = [input() for i in range(2)] s = list(S) t = list(T) n = len(s) - len(t) + 1 min = len(t) for a in range(n): count = 0 for b in range(len(t)): if s[a+b] != t[b]: count += 1 if count < min: min = count print(min)
s591787817
p02571
u928385607
1598730568
Python
Python (3.8.2)
py
Runtime Error
28
9132
207
s = input() t = input() for i in range(len(t)+1): if t[0:len(t)-i] in s or t[i:len(t)] in s: break for j in range(int(len(t)/2)): if t[j:len(t)-j] in s: break if i < j*2: print(i) else: print(j*2)
s210309209
p02571
u176165272
1598730555
Python
Python (3.8.2)
py
Runtime Error
64
8984
208
S = input() T = input() K = [] for i in range(len(S) - len(T)): V = S[i:i + len(T)] C = 0 for l in range(len(T)): if T[l] == V[l]: C += 1 K.append(C) print(len(T) - max(K))
s804220378
p02571
u623814058
1598730529
Python
Python (3.8.2)
py
Runtime Error
2206
16744
485
S=input() T=input() import re def x(): for i in range(len(T),0,-1): # 文字列の長さ for j in range(len(T)-i): # T検索の開始位置=その前にある文字数 t=T[j:i+j] for m in re.finditer(t, S): p=m.start() if p!=-1: # print(j,i,t,p,j<=p and len(T)-j-1 <=len(S)-p...
s446819529
p02571
u465276003
1598730489
Python
PyPy3 (7.3.0)
py
Runtime Error
2223
557136
338
S = input() T = input() lis = [] count = 0 saishou = 0 for i in range(len(T)): for j in range(i, len(S)-len(T)+i): c = 0 while i + c < len(T) and j + c < len(S) : if T[i+c] == S[j+c]: c = c + 1 lis.append(c) else: break saidai = max(lis) saishou = len(T) - said...
s511268574
p02571
u353548710
1598730431
Python
Python (3.8.2)
py
Runtime Error
62
8956
196
S = input() T = input() C = [] for i in range(len(S) - len(T)): s = S[i:len(T)+i] c = 0 for j in range(len(T)): if s[j] == T[j]: c += 1 C.append(c) print(len(T)-max(C))
s018889876
p02571
u006738234
1598730421
Python
Python (3.8.2)
py
Runtime Error
71
9156
290
s = list(str(input())) t = list(str(input())) x = [0] a = 0 for i in range(len(s)): if((s[i] == t[0]) and ((len(s)- i) >= (len(t)-1))): for k in range(1,len(t)): if(s[i+k] == t[k]): a += 1 x.append(a+1) a = 0 y = max(x) print((len(t) - y))
s317978054
p02571
u231570044
1598730414
Python
Python (3.8.2)
py
Runtime Error
2395
137884
263
S = input() T = input() for i in range(len(T), 0, -1): for j in range(len(T)-i+1): subst = T[j:i+j] # print(subst) if S.find(subst, j, len(S)-(len(T)-i-j))>=0: print (len(T)-i) print(subst) # exit(0)
s526523375
p02571
u670567845
1598730396
Python
Python (3.8.2)
py
Runtime Error
329
9048
233
S = input() T = input() l = len(T) ans = l print(ans) for i in range(l): for j in range(l): if (i<=j): if T[i:j+1] in S: if f >= i and f + (l-j) <= len(S): ans = min(ans, l - (j+1-i)) print(ans)
s024113656
p02571
u990641144
1598730396
Python
Python (3.8.2)
py
Runtime Error
1286
148204
353
import numpy as np S = input() T = input() tmp = np.zeros(len(T)) i=0 flg=True while flg: for j in range(i, len(T)): print(i,j) print(T[i:j+1]) print(T[i:j+1] in S) if T[i:j+1] in S: tmp[i] = j+1-i i = max(i + int(tmp[i]),i+1) if i >= len(T)-1: flg=Fals...
s747006788
p02571
u249335194
1598730390
Python
Python (3.8.2)
py
Runtime Error
58
9020
434
s=input() t=input() S=[] for i in range(len(s)): if s[i] in t: p=len(t)-1 q=t.index(s[i]) if q>i or i-q+p+1>len(s): pass else: s1=s[i-q:i+p-q+1] count=0 for j in range(len(s1)): if s1[j]!=t[j]: count+...
s073920314
p02571
u934953801
1598730353
Python
Python (3.8.2)
py
Runtime Error
83
14504
232
S=input() T=input() match=[] lens=len(S) lent=len(T) for i in range(0,lens-lent): temp=S[i:i+lent] cnt=0 for j in range(lent): if temp[j]==T[j]: cnt+=1 match.append(cnt) print(lent-max(match))
s210708534
p02571
u764393353
1598730335
Python
PyPy3 (7.3.0)
py
Runtime Error
88
68692
492
def main(): s = list(input()) t = list(input()) common = 0 max_common = 0 for t_ind in range(len(t)): for char in s: if not common and char == t[t_ind]: common += 1 elif char == t[common]: common += 1 else: ...
s665589471
p02571
u577745299
1598730305
Python
Python (3.8.2)
py
Runtime Error
122
27096
388
import numpy as np max_change = 1000 s = input() t = input() list_t = np.array([ _ for _ in t]) for i in range(1,len(s) - len(t) + 1): s_sample = s[i-1:len(t)+i-1] list_ss = np.array([ _ for _ in list_ss]) list_tf = list_t == list_ss n_change = len(list_t) - sum(list_tf) if n_change < max_change: ...
s979509484
p02571
u633535831
1598730273
Python
PyPy3 (7.3.0)
py
Runtime Error
87
68528
766
#from functools import lru_cache import sys from itertools import product,combinations from functools import reduce,lru_cache def vfunc(f): return lambda *lst, **kwargs: list(map(lambda *x:f(*x,**kwargs),*lst)) def list_t(l): return vfunc(lambda *args:args)(*l) def rvfunc(f): return lambda *lst, **kwargs: list(map(l...
s399214585
p02571
u183432736
1598730237
Python
Python (3.8.2)
py
Runtime Error
25
9024
363
S = str(input()) T = str(input()) tempcount = 0 mincount = 0 if S in T: print("0") exit for i in range(len(S) - len(T)+1): for j in range(len(T)+1): if S[i + j] != T[j]: tempcount += 1 if i == 0: mincount = tempcount elif tempcount < mincount: mincount = tempcou...
s261114768
p02571
u170913092
1598730211
Python
Python (3.8.2)
py
Runtime Error
23
8988
176
S,T = input().split() mm = 0 for i in range(len(S)-len(T)): a = S[i:i+len(T)] mm_now = sum([x == y for x,y in [*zip(a,T)]]) mm = max(mm_now, mm) print(len(T) - mm)
s135719416
p02571
u161857931
1598730187
Python
Python (3.8.2)
py
Runtime Error
65
8944
211
S = input() T = input() mS = [] d = len(S) - len(T) for j in range(d): m = 0 for i in range(len(T)): if S[i] == T[i] : m += 1 mS.append(m) S = S[1:] print(len(T) - max(mS))
s989828806
p02571
u143051858
1598730185
Python
Python (3.8.2)
py
Runtime Error
30
9156
367
import math s = list(input()) t = list(input()) s.reverse() s=''.join(s) t.reverse() t=''.join(t) #print(s) n = s.index(t[0]) #print(n) res = len(t) num =0 while len(s)!=0: if len(s)<=len(t) and s[0] != t[0]:break n = s.index(t[0]) for i in range(len(t)): if t[i]!=s[i+n]: num+=1 res...
s683261600
p02571
u382639013
1598730167
Python
Python (3.8.2)
py
Runtime Error
22
9120
166
s = input() t = input() ans = 0 for i in range(len(s)-len(t)+1): if ans < count_ans(s[i:i+len(t)],t): ans = count_ans(s[i:i+len(t)],t) print(len(t)-ans)
s359484485
p02571
u404842368
1598730132
Python
Python (3.8.2)
py
Runtime Error
69
9072
359
S = input() T = input() if len(S)==len(T): for i in range(len(T)): if T[i] != S[i+n+1]: count+=1 print(count) else: countbox=[] for n in range(len(S)-len(T)): count =0 for i in range(len(T)): if T[i] != S[i+n+1]: count+=1 countbox...
s704642299
p02571
u282403093
1598730102
Python
Python (3.8.2)
py
Runtime Error
25
8948
482
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; using P = pair<int, int>; int main() { string S, T; cin >> S >> T; int ans = 10000; int cnt = 0; for (int i = 0; i < S.size() - T.size() + 1; ++i) { for (int j = i; j < T.s...
s179494602
p02571
u264210020
1598730056
Python
Python (3.8.2)
py
Runtime Error
53
9024
318
S = str(input()) T = str(input()) init = len(T) tmp = init for i in range(0,len(S)-1): if i > len(S)-len(T)-1: break for n in range(0, len(T)-1): if S[i]==T[n]: ans -=1 if ans < tmp: tmp =ans else: ans = init ans = tmp print(ans)
s262350356
p02571
u633535831
1598730007
Python
PyPy3 (7.3.0)
py
Runtime Error
131
68632
714
#from functools import lru_cache import sys from itertools import product,combinations from functools import reduce,lru_cache import heapq def vfunc(f): return lambda *lst, **kwargs: list(map(lambda *x:f(*x,**kwargs),*lst)) def list_t(l): return vfunc(lambda *args:args)(*l) def rvfunc(f): return lambda *lst, **kwarg...
s088088346
p02571
u404842368
1598729994
Python
Python (3.8.2)
py
Runtime Error
67
9116
207
S = input() T = input() countbox=[] for n in range(len(S)-len(T)): count =0 for i in range(len(T)): if T[i] != S[i+n+1]: count+=1 countbox.append(count) print(min(countbox))
s239517924
p02571
u633535831
1598729957
Python
PyPy3 (7.3.0)
py
Runtime Error
214
68628
709
#from functools import lru_cache import sys from itertools import product,combinations from functools import reduce,lru_cache import heapq def vfunc(f): return lambda *lst, **kwargs: list(map(lambda *x:f(*x,**kwargs),*lst)) def list_t(l): return vfunc(lambda *args:args)(*l) def rvfunc(f): return lambda *lst, **kwarg...
s912480793
p02571
u902917675
1598729930
Python
Python (3.8.2)
py
Runtime Error
73
8972
229
S = input() T = input() ev = [0] * (len(S) - len(T)) for i in range(len(S) - len(T)): commit = 0 for j in range(len(T)): if S[i + j] == T[j]: commit += 1 ev[i] = commit ev.sort(reverse=True) print(len(T) - ev[0])
s436027896
p02571
u071905007
1598729911
Python
Python (3.8.2)
py
Runtime Error
65
9132
225
S=list(map(str,input())) T=list(map(str,input())) x=[] y=0 for i in range(len(S)-len(T)): Y=S[i:i+len(T)] y=0 for j in range(len(T)): if Y[j]==T[j]: y=y+1 x.append(y) print(len(T)-max(x))
s738789065
p02571
u216035099
1598729896
Python
Python (3.8.2)
py
Runtime Error
29
9196
473
def findProductSum(A, n): array_sum = 0 for i in range(0, n, 1): array_sum = array_sum + A[i] array_sum_square = array_sum * array_sum individual_square_sum = 0 for i in range(0, n, 1): individual_square_sum += A[i] * A[i] return (array_sum_square - ...
s165897533
p02571
u869955221
1598729842
Python
Python (3.8.2)
py
Runtime Error
526
9060
235
import sys s = input() t = input() ans = 0 if(t in s): print(0) sys.exit(1) for i in range(len(t)): for j in range(i,len(t)): me = t[i:j] if(me in s[i:]): ans = max(len(me),ans) print(len(t)-ans)
s521987642
p02571
u577745299
1598729825
Python
Python (3.8.2)
py
Runtime Error
28
9148
555
import pandas as pd def diffab(x): if x.a == x.b: return 1 else: return 0 max_change = 1000 s = input() t = input() list_t = pd.Series([ _ for _ in t],name="a") for i in range(1,len(s) - len(t) + 1): s_sample = s[i-1:len(t)+i-1] list_ss = pd.Series([ _ for _ in s_sample],name="b") ...
s660344565
p02571
u902917675
1598729821
Python
Python (3.8.2)
py
Runtime Error
71
9116
229
S = input() T = input() ev = [0] * (len(S) - len(T)) for i in range(len(S) - len(T)): commit = 0 for j in range(len(T)): if S[i + j] == T[j]: commit += 1 ev[i] = commit greatest = max(ev) print(len(T) - greatest)
s980487199
p02571
u264210020
1598729814
Python
Python (3.8.2)
py
Runtime Error
156
9056
276
S = str(input()) T = str(input()) init = len(T) tmp = init for i in range(0,len(S)-1): for n in range(0, len(T)-1): if S[i]==T[n]: ans -=1 if ans < tmp: tmp =ans else: ans = init ans = tmp print(ans)
s014741533
p02571
u861886710
1598729811
Python
PyPy3 (7.3.0)
py
Runtime Error
84
68696
190
S = input() T = input() c = 0 l = [] for i in range(len(S)-len(T)): for j in range(len(T)): if (T[j] != S[i+j]): c += 1 l.append(c) c = 0 print(min(l))
s009819971
p02571
u721403425
1598729799
Python
Python (3.8.2)
py
Runtime Error
91
14396
252
s = input() t = input() l = len(t) ans = 0 a = 0 list1 = [] for i in range(len(s) - l + 1): ss = list(s[i:i+l]) for j in range(l): if ss[j] ==t[j]: ans += 1 list1.append(ans) else: pass ans = 0 m = max(list1) print(l-m)
s211399432
p02571
u990641144
1598729798
Python
Python (3.8.2)
py
Runtime Error
29
9056
242
S = input() T = input() tmp = np.zeros(len(T)) i=0 flg=True while flg: for j in range(i, len(T)): if T[i:j+1] in S: tmp[i] = j i = i + int(tmp[i]) if i >= len(T)-1: flg=False print(int(np.max(tmp)))
s095399379
p02571
u249335194
1598729765
Python
Python (3.8.2)
py
Runtime Error
51
9124
436
s=input() t=input() S=[] for i in range(len(s)): if s[i] in t: p=len(t)-1 q=t.index(s[i]) if q>i or i-q+p+1>len(s)-1: pass else: s1=s[i-q:i+p-q+1] count=0 for j in range(len(s1)): if s1[j]!=t[j]: coun...
s688915085
p02571
u743878367
1598729752
Python
Python (3.8.2)
py
Runtime Error
77
10716
227
S = input() T = input() cnt_list = [] for j in range(len(S)-len(T)): sub_S = S[j:(j+len(S))] for k in range(len(T)-1): cnt = 0 if T[k] != sub_S[k]: cnt += 1 cnt_list.append(cnt) print(min(cnt_list))
s110724250
p02571
u403411012
1598729743
Python
Python (3.8.2)
py
Runtime Error
27
8980
295
S=input() T=input() count=0 if S.find(T)!=-1: print(0) else: a=0 for i in range(len(T)-1): if S.find(T[0:len(T)-i-1])!=-1: count=count+1 print(count) a=1 break else: count=count+1 if a==0: print(count)
s668528790
p02571
u071905007
1598729678
Python
Python (3.8.2)
py
Runtime Error
67
9064
226
S=list(map(str,input())) T=list(map(str,input())) x=[] y=0 for i in range(len(S)-len(T)): Y=S[i:i+len(T)] y=0 for j in range(len(T)): if Y[j]==T[j]: y=y+1 x.append(y) print(len(T)-max(x))
s534692630
p02571
u542541293
1598729674
Python
Python (3.8.2)
py
Runtime Error
655
21680
170
S = input() T = input() L = [] for i in range(len(T)): for j in range(i+1): if T[j:len(T)+j-i] in S[j:]: L.append(len(T[j:len(T)+j-i])) print(len(T)-max(L))
s089334299
p02571
u671889550
1598729616
Python
Python (3.8.2)
py
Runtime Error
70
9136
309
s = input() t = input() len_s = len(s) len_t = len(t) ans = 1000 for i in range(len_s - len_t + 1): cnt = 0 l = [] for j in range(len_t): if s[i + j] == t[j]: cnt += 1 else: l.append(cnt) cnt = 0 ans = min(ans, len_t - max(l)) print(ans)
s127249221
p02571
u869802270
1598729614
Python
Python (3.8.2)
py
Runtime Error
57
9048
168
S = input() T = input() l = [] for i in range(len(S) - len(T)): cnt = 0 for j in range(len(T)): if T[j] != S[i+j]: cnt += 1 l.append(cnt) print(min(l))
s373452992
p02571
u656120612
1598729605
Python
Python (3.8.2)
py
Runtime Error
60
9064
183
s=input() t=input() s=list(s) t=list(t) d=[] for i in range(len(s)-len(t)): c=0 for j in range(len(t)): if s[i+j]!=t[j]: c+=1 d.append(c) print(min(d))
s297846425
p02571
u827599348
1598729543
Python
Python (3.8.2)
py
Runtime Error
28
8788
760
#include <bits/stdc++.h> using namespace std; #define max(a, b) ((a > b) ? a : b) #define min(a, b) ((a < b) ? a : b) #define forn(n) for(int i = 0; i < n; i++) #define fork(k, n) for(int i = k; i < n; i++) #define pb(n) push_back(n); typedef long long ll; typedef double dbl; const int MX = 1e6; const int MOD = 1e...
s749062239
p02571
u389530753
1598729542
Python
Python (3.8.2)
py
Runtime Error
24
8888
129
N=int(input()) S=list(input().split()) A=[int(n) for n in S] ans=int(0) for i in A: for j in A: ans += i*j print(ans)
s236206195
p02571
u389530753
1598729477
Python
Python (3.8.2)
py
Runtime Error
30
9164
129
N=int(input()) S=list(input().split()) A=[int(n) for n in S] ans=int(0) for i in A: for j in A: ans += i*j print(ans)
s767818036
p02571
u267466261
1598729470
Python
PyPy3 (7.3.0)
py
Runtime Error
87
69648
264
s = input() t = input() max = 0 a = 0 for i in range(len(s)): m = i for j in range(len(t)): if i < j: break if s[m] == t[j]: a += 1 m += 1 if max < a: max = a else: a = 0 m = i print(len(t) - max)
s538816529
p02571
u721403425
1598729430
Python
Python (3.8.2)
py
Runtime Error
85
14388
257
s = input() t = input() l = len(t) ans = 0 a = 0 list1 = [] for i in range(len(s) - l + 1): ss = list(s[i:i+l]) for j in range(l): if ss[j] ==t[j]: ans += 1 list1.append(ans) else: ans = 0 ans = 0 m = max(list1) print(l-m)
s606559173
p02571
u945342410
1598729422
Python
Python (3.8.2)
py
Runtime Error
29
9068
271
sList = list(input()) tList = list(input()) numList = [] for t in enumerate(tList): num = 0 for s in enumerate(sList): i = t j = s while tList[i] == sList[j]: num += 1 i += 1 j += 1 numList.Append(num) print(len(tList) - max(numList))
s406421201
p02571
u468972478
1598729421
Python
Python (3.8.2)
py
Runtime Error
19
9048
193
n = int(input()) a = list(map(int, input().split())) b = [] for i in range(n): for j in range(i+1, n): b.append(a[i] % (10 ** 9 + 7) * (a[j] % (10 ** 9 + 7)) print(sum(b) % (10 ** 9 + 7))
s421976386
p02571
u578930448
1598729415
Python
Python (3.8.2)
py
Runtime Error
73
9080
295
s = input().strip() t = input().strip() if t in s: print(0) else: ans = 1000 for i in range(len(s) - len(t) - 1): count = len(t) - 1 for j in range(len(t) - 1): if s[i + j] == t[i]: count -= 1 ans = min(count, ans) print(ans)
s427966723
p02571
u096146539
1598729404
Python
Python (3.8.2)
py
Runtime Error
33
9040
323
s=input() t=input() index=0 count=0 for i in range (len(s)): if s[i]==t[0]: index=i+1 break if index == 0: for j in range(len(t)): if t[j]!=s[j]: count+=1 else: for j in range (1,len(t)): if t[j]!= s[index]: count+=1 index+=1 print(coun...
s780121992
p02571
u435593586
1598729390
Python
Python (3.8.2)
py
Runtime Error
23
9080
399
s = input() t = input() count = 0 res = '' ans = '' for x in t: if x not in s: continue elif t.index(x) > s.index(x): continue else: i = s.index(x) ans = x res = s[i-t.index(ans):i-t.index(ans)+len(t)] if res: if len(res) < len(t): print(len(t)) else: for i in range(len(res)): ...
s239054545
p02571
u699715278
1598729390
Python
Python (3.8.2)
py
Runtime Error
27
9048
193
S = input() T = input() def a(): l = len(T) for i in range(l, 0, -1): for j in range(0, l-i+1): if T[j:j+i] in S[j:l-i+J]: return l-i print(a())
s729986711
p02571
u404842368
1598729381
Python
Python (3.8.2)
py
Runtime Error
70
8976
211
S = input() T = input() countbox=[] for n in range(len(S)-2-len(T)+1): count =0 for i in range(len(T)): if T[i] != S[i+n+1]: count+=1 countbox.append(count) print(min(countbox))
s355615368
p02571
u455354923
1598729362
Python
PyPy3 (7.3.0)
py
Runtime Error
142
74656
199
S=str(input()) T=str(input()) ls = [] cnt = 0 for i in range(len(S)-len(T)): cnt = 0 for j in range(len(T)): if T[j] != S[j+i]: cnt += 1 ls.append(cnt) print(min(ls))
s135803477
p02571
u467463073
1598729349
Python
Python (3.8.2)
py
Runtime Error
24
9052
170
N = int(input()) A = list(map(int,input().split())) ans = 0 m0 = 10**9+7 for i in range(0,N-1): for j in range(i+1,N): ans = (ans + A[i]*A[j]) % m0 print(ans)
s659905447
p02571
u440478998
1598729309
Python
Python (3.8.2)
py
Runtime Error
697
221756
224
s = input() t = input() l = [] for i in range(len(t)): for j in range(i+1,len(t)+1): if t[i:j] in s[i:]: l.append(t[i:j]) l2 = [] for j in l: l2.append(len(j)) print(len(t) - max(l2))
s189223748
p02571
u766236264
1598729272
Python
Python (3.8.2)
py
Runtime Error
26
9112
256
minCount = 10000 i = 0 while i < len(s): countSame = 0 j = 0 while j < len(t) and i+j < len(s): if t[j] == s[i+j]: countSame += 1 j += 1 minCount = min(len(t) - countSame, minCount) i += 1 print(minCount)
s213529112
p02571
u961523950
1598729260
Python
Python (3.8.2)
py
Runtime Error
39
9152
484
S = input() T = input() match = 0 match_list = list() if T in S: print(0) exit() elif set(list(S)).intersection(set(list(T))) == set(): print(len(T)) exit() else: for i in range(len(T), len(S)): match = 0 list_S = list(S[i-len(T):i]) list_T = list(T) for j in range(len(T)): if list_S[j] ...
s145007398
p02571
u455354923
1598729250
Python
PyPy3 (7.3.0)
py
Runtime Error
86
68660
305
S=str(input()) T=str(input()) ls = [] cnt = 0 if T in S: print(0) else: for i in range(len(S)-len(T)): for j in range(len(T)): if T[j] != S[j+i]: #print (T[j],S[j+i]) cnt += 1 ls.append(cnt) cnt = 0 #print(ls) print(min(ls))
s191530346
p02571
u404842368
1598729247
Python
Python (3.8.2)
py
Runtime Error
27
9124
274
S = input() T = input() if S>=(T+2): countbox=[] for n in range(len(S)-2-len(T)+1): count =0 for i in range(len(T)): if T[i] != S[i+n+1]: count+=1 countbox.append(count) print(min(countbox)) else: print(0)
s897276647
p02571
u240292623
1598729226
Python
Python (3.8.2)
py
Runtime Error
34
9928
166
def check(s,t,n): if s.find(t) != -1: print(n) else: n += 1 t = t[:-1] check(s,t,n) s = input() t = input() n = 0 check(s,t,n)
s559924738
p02571
u671889550
1598729193
Python
Python (3.8.2)
py
Runtime Error
69
8956
305
s = input() t = input() len_s = len(s) len_t = len(t) ans = 1000 for i in range(len_s - len_t): cnt = 0 l = [] for j in range(len_t): if s[i + j] == t[j]: cnt += 1 else: l.append(cnt) cnt = 0 ans = min(ans, len_t - max(l)) print(ans)
s469607692
p02571
u455354923
1598729173
Python
PyPy3 (7.3.0)
py
Runtime Error
152
68608
301
S=str(input()) T=str(input()) ls = [] cnt = 0 if T in S: print(0) else: for i in range(len(S)-len(T)): for j in range(len(T)): if T[j] != S[j+i]: #print (T[j],S[j+i]) cnt += 1 ls.append(cnt) cnt = 0 #print(ls) print(min(ls))
s573141532
p02571
u763291354
1598729168
Python
Python (3.8.2)
py
Runtime Error
69
9216
420
s = input() t = input() s_list = list(s) t_list = list(t) compare = [] score = [] if s == t: print(0) else: for i in range(len(s) - len(t) + 1): compare.append(s[i : i + len(t)]) for v in compare: count = 0 for v1, v2 in zip(list(v), t_list): #print(v1, v2) ...
s842098345
p02571
u111471511
1598729162
Python
Python (3.8.2)
py
Runtime Error
31
8904
227
ans = [] for i in range(M-N+1): num = 0 substring = input_list[0][i:i+N] for j in range(len(substring)): if substring[j] != input_list[1][j]: num += 1 ans.append(num) print(min(ans))
s129839287
p02571
u356983865
1598729126
Python
Python (3.8.2)
py
Runtime Error
93
14792
509
S = input() T = input() N = len(T) count = 0 count_list = [] index_list = [] if len(S)-len(T) != 0: for i in range(len(S)-N+1): index_list.append(S[0+i:N+i]) for i in range(len(index_list)): count = 0 for j in range(N): if index_list[i][j] == T[j]: count +...
s922741084
p02571
u404842368
1598729118
Python
Python (3.8.2)
py
Runtime Error
67
8880
211
S = input() T = input() countbox=[] for n in range(len(S)-2-len(T)+1): count =0 for i in range(len(T)): if T[i] != S[i+n+1]: count+=1 countbox.append(count) print(min(countbox))
s204261753
p02571
u284120954
1598729111
Python
Python (3.8.2)
py
Runtime Error
32
8860
224
S = input() T = input() Min = 100000 for i in range(len(S) - len(T) + 1): count = 0 for n in range(len(T)): if S[i + n] != T[n]: count += 1 if count < Min: Min = count print(count)
s565194017
p02571
u707451177
1598729088
Python
Python (3.8.2)
py
Runtime Error
27
9036
150
s = input() t = input() for i in np.flip(np.arange(len(t))): if t[:i] in s: print(len(t)-i) break else: print(len(t))
s809006403
p02571
u806988802
1598729062
Python
Python (3.8.2)
py
Runtime Error
22
9056
258
s, t = input().split("\n") s_l = len(s) t_l = len(t) max_count = 0 for i in range(0, s_l - t_l): count = 0 for j in range(0, t_l): if s[i+j] == t[j]: count += 1 if count > max_count: max_count = count diff = t_l - max_count print(diff)