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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s191767555 | p02571 | u319589470 | 1598729050 | Python | Python (3.8.2) | py | Runtime Error | 58 | 9848 | 1495 | #!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**7)
import bisect
import heapq
import itertools
import math
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from math import gcd
from operator import add, itemgetter, mul, xor
def cmb(n,r,mod):
bunshi=... |
s632407126 | p02571 | u902426510 | 1598729012 | Python | Python (3.8.2) | py | Runtime Error | 28 | 8900 | 653 | s = input()
t = input()
if t in s:
print(0)
else:
ans = 1000
for i in range(len(t)):
for j in range(len(s)):
if t[i] == s[j]:
if len(t) - i >= len(s) - j and i <= j:
k = i
l = j
cnt1 = 0
while k < len(t):
if t[k] != s[l]:
c... |
s817084666 | p02571 | u395356317 | 1598729012 | Python | Python (3.8.2) | py | Runtime Error | 73 | 9072 | 406 | s = list(input())
t = list(input())
max_length = 0
for i in range(len(t)):
for j in range(i, len(s)):
if t[i] == s[j]:
length = 0
for k in range(len(t)-i):
if t[i+k] == s[j+k]:
length += 1
else:
break
... |
s097882077 | p02571 | u760760982 | 1598729011 | Python | Python (3.8.2) | py | Runtime Error | 63 | 9132 | 326 | s = input()
t = input()
ans = []
for i in range(len(s)-len(t)):
S = s[i:i+len(t)]
cnt = 0
for j in range(len(t)):
if t[j] == S[j]:
cnt += 1
ans.append(cnt)
a = ans.index(max(ans))
b = s[a:a+len(t)]
count = 0
for k in range(len(t)):
if t[k] != b[k]:
count += 1
print(count... |
s251071835 | p02571 | u364693468 | 1598728977 | Python | PyPy3 (7.3.0) | py | Runtime Error | 250 | 69148 | 882 | import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): r... |
s534808316 | p02571 | u959757057 | 1598728944 | Python | Python (3.8.2) | py | Runtime Error | 66 | 9052 | 225 | s = input()
t = input()
ratio = []
cnt = 0
for k in range(len(s) - len(t)):
for i in range(len(t)):
if s[i + k] == t[i]:
cnt += 1
ratio.append(cnt)
cnt = 0
res = len(t) - max(ratio)
print(res) |
s683550751 | p02571 | u347502437 | 1598728899 | Python | Python (3.8.2) | py | Runtime Error | 52 | 9048 | 216 | S = input()
T = input()
D = []
for i in range(len(S) - len(T)):
SS = S[i:i+len(T)]
dif = 0
for j in range(len(T)):
if T[j] != SS[j]:
dif += 1
D += [dif]
print(min(D))
|
s045652635 | p02571 | u547608423 | 1598728898 | Python | Python (3.8.2) | py | Runtime Error | 1869 | 137912 | 337 | S = input()
T = input()
L = 0
judge = False
for i in range(len(T), 0, -1):
# print(i)
for j in range(len(T)-i+1):
print(S[j:])
if T[j:j+i] in S[j:]:
L = i
# print(T[j:j+i])
judge = True
# print(i, j)
break
if judge:
break
... |
s850442548 | p02571 | u962330718 | 1598728885 | Python | Python (3.8.2) | py | Runtime Error | 64 | 8924 | 176 | S=input()
T=input()
a=len(S)
b=len(T)
m=a-b
A=[]
for i in range(m):
cnt=b
for j in range(b):
if S[i+j]==T[j]:
cnt-=1
A.append(cnt)
print(min(A)) |
s024772340 | p02571 | u990641144 | 1598728883 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9104 | 210 | #inp = list(map(int, input().split()))
S = input()
T = input()
tmp = []*len(T)
i=0
while i < len(T):
for j in range(i, len(T)-i):
if T[i:i+j+1] in S:
tmp[i] = j
i = tmp[i]
print(max(tmp)) |
s959442194 | p02571 | u284120954 | 1598728878 | Python | Python (3.8.2) | py | Runtime Error | 59 | 9040 | 256 | S = input()
T = input()
Min = 100000
for i in range(len(S)):
if i + len(T) > len(S) - 1:
break
count = 0
for n in range(len(T)):
if S[i + n] != T[n]:
count += 1
if count < Min:
Min = count
print(count) |
s852926665 | p02571 | u745812846 | 1598728832 | Python | Python (3.8.2) | py | Runtime Error | 59 | 8924 | 240 | s = input()
t = input()
ans = 0
A = []
for i in range(len(s)-len(t)):
s_i = s[i:i+len(t)+1]
count = 0
for j in range(len(t)):
if s_i[j] == t[j]:
count += 1
A.append(count)
ans = len(t) - max(A)
print(ans) |
s678859483 | p02571 | u869955221 | 1598728823 | Python | Python (3.8.2) | py | Runtime Error | 31 | 9116 | 533 | import sys
s = input()
t = input()
j=0
maxa = 0
maxb = 0
if(len(t)==0):
print("0")
sys.exit(1)
for i in range(len(s)):
if(s[i]==t[j]):
j+=1
if(j==len(t)):
maxa = max(maxa,j)
break
else:
maxa = max(maxa,j)
j=0
j=len(t)-1
for i in range(len(s)-1,-1,-... |
s846271619 | p02571 | u137346245 | 1598728806 | Python | Python (3.8.2) | py | Runtime Error | 71 | 9000 | 255 | S = list(input())
T = list(input())
O = list()
a = 0
for i in range (len(S) - len(T)):
b = 0
m = 0
for i in range (len(T)):
if S[b + a] != T[b]:
m = m + 1
b = b + 1
O.append(m)
a = a + 1
O.sort()
print(O[0]) |
s693828378 | p02571 | u040298438 | 1598728796 | Python | Python (3.8.2) | py | Runtime Error | 42 | 9048 | 131 | S = input()
T = input()
d = len(S) - len(T)
print(len(T) - max(sum(t == s for t, s in zip(T, S[i : i + d + 1])) for i in range(d))) |
s841204431 | p02571 | u347502437 | 1598728795 | Python | Python (3.8.2) | py | Runtime Error | 47 | 9124 | 215 | S = input()
T = input()
D = []
for i in range(len(S) - len(T)):
SS = S[i:i+len(T)]
dif = 0
for j in range(len(T)):
if T[j] != SS[j]:
dif += 1
D += [dif]
print(min(D)) |
s842109956 | p02571 | u987846648 | 1598728792 | Python | PyPy3 (7.3.0) | py | Runtime Error | 86 | 68716 | 209 | s = input()
t = input()
ans = []
for i in range(len(s)-len(t)):
cnt = 0
for j in range(len(t)):
if t[j] != s[i+j]:
cnt += 1
ans.append(cnt)
cnt2 = min(ans)
print(cnt2)
|
s129230366 | p02571 | u961523950 | 1598728791 | Python | Python (3.8.2) | py | Runtime Error | 68 | 9060 | 338 | S = input()
T = input()
match = 0
match_list = list()
if T in S:
print(0)
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] == list_T[j]:
match = match + 1
match_list.append(match)
print(len(T)-max(ma... |
s552182542 | p02571 | u113107956 | 1598728789 | Python | Python (3.8.2) | py | Runtime Error | 223 | 16564 | 220 | s=input()
t=input()
cnt=0
a=[]
for i in range(len(s)):
for l in range(len(t)):
if t[l]==s[i]:
cnt+=1
else:
a.append(cnt)
cnt=0
#print(*a)
print(len(t)-max(a)) |
s228944389 | p02571 | u005569385 | 1598728771 | Python | Python (3.8.2) | py | Runtime Error | 97 | 9028 | 270 | S = input()
T = input()
s1 = list(S)
t1 = list(T)
a = len(s1); b = len(t1)
z = []
for i in range(a-b):
x = []
y = 0
for j in range(b):
x.append(s1[i+j])
for k in range(b):
if t1[k]==x[k]:
y += 1
z.append(y)
print(b-max(z)) |
s772472233 | p02571 | u427819770 | 1598728763 | Python | Python (3.8.2) | py | Runtime Error | 73 | 9112 | 222 | S = input()
T = input()
ans = [0 for i in range(len(S)-len(T))]
for i in range(len(S)-len(T)):
cnt = len(T)
for j in range(len(T)):
if S[i+j] == T[j]:
cnt -= 1
ans[i] = cnt
print(min(ans))
|
s372310934 | p02571 | u364693468 | 1598728757 | Python | PyPy3 (7.3.0) | py | Runtime Error | 221 | 74856 | 889 | import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): r... |
s777478526 | p02571 | u294000907 | 1598728740 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9012 | 119 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import Levenshtein
s=input()
t=input()
print(Levenshtein.distance(s,t))
|
s523229662 | p02571 | u356983865 | 1598728718 | Python | Python (3.8.2) | py | Runtime Error | 88 | 14624 | 507 | 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):
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 +=1... |
s785793531 | p02571 | u002663801 | 1598728693 | Python | PyPy3 (7.3.0) | py | Runtime Error | 100 | 69160 | 418 | s = input()
t = input()
ans = len(t)
long = ans
for i in range(len(t)):
tc = t[i]
for j in range(0+i,len(s)):
if tc == s[j]:
count = 1
for k in range(1,len(t)-i):
if t[i+k] == s[j+k]:
count += 1
else:
if an... |
s401474506 | p02571 | u213497190 | 1598728668 | Python | Python (3.8.2) | py | Runtime Error | 2096 | 137912 | 218 | s = input()
t = input()
max_len = 0
for i in range(len(t)):
for j in range(i, len(t)+1):
print(t[i:j])
if t[i:j] in s[i:len(s)-j+1]:
max_len = max(max_len, j-i)
print(len(t) - max_len) |
s379739589 | p02571 | u113107956 | 1598728661 | Python | Python (3.8.2) | py | Runtime Error | 230 | 16688 | 219 | s=input()
t=input()
cnt=0
a=[]
for i in range(len(t)):
for l in range(len(s)):
if t[i]==s[l]:
cnt+=1
else:
a.append(cnt)
cnt=0
#print(*a)
print(len(t)-max(a)) |
s526092297 | p02571 | u185405877 | 1598728642 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8888 | 214 | s=input()
l=input()
len_s=len(s)
len_l=len(l)
a=len_s-len_l
ans=1001
for i in range(len_s-len_l+!):
cnt=0
for j in range(len_l):
if l[j]!=s[i+j]:
cnt+=1
ans=min(ans,cnt)
print(ans)
|
s888163908 | p02571 | u389737182 | 1598728633 | Python | Python (3.8.2) | py | Runtime Error | 55 | 9108 | 202 | s = input()
t = input()
i = 0
ans = []
while i < len(s) - len(t):
cnt = 0
for j in range(len(t)):
if s[i+j] != t[j]:
cnt += 1
ans.append(cnt)
i += 1
print(min(ans)) |
s997509767 | p02571 | u364693468 | 1598728626 | Python | PyPy3 (7.3.0) | py | Runtime Error | 130 | 69608 | 729 | import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): r... |
s846952299 | p02571 | u658288444 | 1598728594 | Python | Python (3.8.2) | py | Runtime Error | 57 | 9064 | 283 | def resolve():
s = input()
t = input()
ls = len(s)
lt = len(t)
c = []
for i in range(ls - lt):
count = 0
for j in range(lt):
if s[i+j] == t[j]:
count += 1
c.append(count)
print(lt - max(c))
resolve() |
s019251537 | p02571 | u756311765 | 1598728522 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9044 | 370 | S = input()
T = input()
minimum = 0
for i in range(len(S)):
m = 0
for j in range(len(T)):
if i + j == len(S):
break
else:
if S[i+j] != T[j]:
m += 1
if m == 0:
print(m)
else:
if minimum == 0:
minimum = m
elif:
... |
s794389450 | p02571 | u609561564 | 1598728508 | Python | Python (3.8.2) | py | Runtime Error | 2016 | 137900 | 222 | S=input()
T=input()
num_char=0
for i in range(len(T)):
for j in range(i+1,len(T)):
if T[i:j] in S[i:]:
print(T[i:j])
if num_char<j-i:
num_char=j-i
print(len(T)-num_char) |
s056704599 | p02571 | u013864607 | 1598728505 | Python | Python (3.8.2) | py | Runtime Error | 191 | 27184 | 342 | import numpy as np
S=input()
T=input()
max_score = 0
for i in range(len(list(S))-len(list(T))):
tmp_T = np.array(list(T))
tmp_S = np.array(list(S))[i:i+len(tmp_T)]
score = np.zeros(len(tmp_T))
score[tmp_T==tmp_S]=1
score = np.sum(score)
if max_score < score:
max_score=score
print(int(l... |
s298871272 | p02571 | u360574092 | 1598728502 | Python | PyPy3 (7.3.0) | py | Runtime Error | 175 | 69516 | 179 | S = input()
T = input()
ans = 0
for i in range(len(S)):
tmp = 0
for j in range(len(T)):
if S[i + j] == T[j]:
tmp += 1
ans = max(ans, tmp)
print(len(T) - ans)
|
s877572010 | p02571 | u665873062 | 1598728494 | Python | Python (3.8.2) | py | Runtime Error | 73 | 9056 | 231 | S = input()
T = input()
maxs = 0
for x in range(len(S)-len(T)+1):
for y in range(len(T)):
if T[y] == S[x+y]:
count += 1
else:
count = 0
maxs = max(count,maxs)
print(len(T)-maxs) |
s134191084 | p02571 | u605880635 | 1598728479 | Python | Python (3.8.2) | py | Runtime Error | 65 | 9112 | 315 | S = input()
T = input()
if T in S:
print("0")
else:
slen = len(S)
tlen = len(T)
ansCnt = tlen
for i in range(slen-tlen):
cnt = 0
for j in range(tlen):
if T[j]!=S[i+j]:
cnt += 1
if ansCnt>cnt:
ansCnt = cnt
print(ansCnt)
|
s142899332 | p02571 | u034385994 | 1598728468 | Python | PyPy3 (7.3.0) | py | Runtime Error | 127 | 68676 | 173 | s = input()
t = input()
c = [0] * (len(s) - len(t))
for i in range(len(s) - len(t)):
for j in range(len(t)):
if s[i+j] == t[j]:
c[i] += 1
print(len(t)-max(c)) |
s216990051 | p02571 | u635621124 | 1598728458 | Python | Python (3.8.2) | py | Runtime Error | 56 | 9128 | 250 | import sys
list_a = []
S = input()
T = input()
if T in S:
print(0)
sys.exit()
for i in range(len(S) - len(T)):
cnt = 0
for j in range(len(T)):
if T[j] != S[i + j]:
cnt += 1
list_a.append(cnt)
print(min(list_a)) |
s403192226 | p02571 | u595905528 | 1598728446 | Python | PyPy3 (7.3.0) | py | Runtime Error | 567 | 73080 | 617 | import sys
import bisect
import itertools
import collections
import fractions
import heapq
import math
from operator import mul
from functools import reduce
from functools import lru_cache
def solve():
readline = sys.stdin.buffer.readline
mod = 10 ** 9 + 7
S = input()
T = input()
numdic = [0]*(le... |
s143018599 | p02571 | u257265865 | 1598728434 | Python | PyPy3 (7.3.0) | py | Runtime Error | 121 | 68728 | 177 | s=input()
t=input()
ans=[]
for i in range(len(s)-len(t)):
count=0
for j in range(len(t)):
if t[j]==s[i+j]:
count+=1
ans.append(count)
print(len(t)-max(ans))
|
s428896100 | p02571 | u360574092 | 1598728423 | Python | PyPy3 (7.3.0) | py | Runtime Error | 145 | 69664 | 180 | S = input()
T = input()
ans = 0
for i in range(len(S)):
tmp = 0
for j in range(len(T)):
if S[i + j] == T[j]:
tmp += 1
ans = max(ans, tmp)
print(len(T) - ans)
|
s795544345 | p02571 | u223555291 | 1598728410 | Python | Python (3.8.2) | py | Runtime Error | 59 | 9204 | 247 | s=input()
t=input()
a=0
b=[]
c=[]
for i in range(len(s)-len(t)):
b.append(s[i:len(t)+i])
for i in range(len(b)):
for j in range(len(b[i])):
if b[i][j]!=t[j]:
a+=1
c.append(a)
a=0
print(min(c))
|
s261872238 | p02571 | u955691979 | 1598728405 | Python | PyPy3 (7.3.0) | py | Runtime Error | 80 | 69120 | 361 | s = input()
t = input()
s = list(s)
s.append("0")
t = list(t)
roop = len(s)-len(t)
cc = []
for i in range(roop):
c = 0
tmp = []
tmp = s[i:len(t)+1+i]
for i in range(len(t)):
if tmp[i] == t[i]:
c += 1
cc.append(c)
ma = max(cc)
a = cc.index(ma)
tmp = s[a:1+len(t)]
ans = 0
for i in range(len(t)):
i... |
s205490196 | p02571 | u869955221 | 1598728398 | Python | Python (3.8.2) | py | Runtime Error | 30 | 9084 | 328 | s = input()
t = input()
j=0
maxa = 0
maxb = 0
for i in range(len(s)):
if(s[i]==t[j]):
j+=1
else:
maxa = max(maxa,j)
j=0
j=len(t)-1
for i in range(len(s)-1,-1,-1):
if(s[i]==t[j]):
j-=1
else:
maxb = max(maxb,len(t)-1-j)
j=len(t)-1
print(min(len(t)-maxa,len(t... |
s775288928 | p02571 | u161164709 | 1598728361 | Python | PyPy3 (7.3.0) | py | Runtime Error | 87 | 68708 | 226 | import numpy as np
s = input()
t = input()
len_s = len(s)
len_t = len(t)
ma = 0
for i in range(len_s - len_t + 1):
ma = max(ma, np.sum(np.array(list(s[i: i + len_t])) == np.array(list(t))))
ans = len_t - ma
print(ans) |
s586564805 | p02571 | u525796732 | 1598728319 | Python | Python (3.8.2) | py | Runtime Error | 66 | 10380 | 495 | import sys
import math
import fractions
from collections import defaultdict
stdin = sys.stdin
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))
S=list(ns())
T=list(ns())
INF=1... |
s539306414 | p02571 | u755056246 | 1598728315 | Python | PyPy3 (7.3.0) | py | Runtime Error | 129 | 68716 | 208 | s = input()
t = input()
lent = len(t)
ans = []
for i in range(len(s) - lent):
ss = s[i:i+lent]
ans1 = 0
for s1, t1 in zip(ss, t):
ans1 += (s1==t1)
ans.append(ans1)
print(lent-max(ans)) |
s196432477 | p02571 | u902426510 | 1598728291 | Python | Python (3.8.2) | py | Runtime Error | 138 | 9072 | 329 | s = input()
t = input()
if t in s:
print(0)
else:
ans = 1000
for i in range(len(t)):
for j in range(len(s)):
if t[i] == s[j]:
k = i
l = j
while k < len(t):
if t[k] != s[l]:
break
k += 1
l += 1
ans = min(ans, len(t) - k)
print(ans... |
s472186515 | p02571 | u201382544 | 1598728291 | Python | Python (3.8.2) | py | Runtime Error | 57 | 9116 | 220 | s = list(str(input()))
t = list(str(input()))
l = []
count = 0
for i in range(len(s)-len(t)):
for j in range(len(t)):
if s[i+j] != t[j]:
count += 1
l.append(count)
count = 0
print(min(l)) |
s645740840 | p02571 | u765590009 | 1598728262 | Python | Python (3.8.2) | py | Runtime Error | 61 | 9048 | 175 | s = input()
t = input()
a = []
for i in range(len(s)-len(t)):
count = 0
for j in range(len(t)):
if t[j] != s[j+i]:
count += 1
a.append(count)
print(min(a)) |
s427860801 | p02571 | u991542950 | 1598728260 | Python | PyPy3 (7.3.0) | py | Runtime Error | 129 | 68648 | 282 | import sys
input = sys.stdin.readline
S = input()
T = input()
score_list = []
diff = len(S) - len(T)
len_T = len(T)
for i in range(0, diff):
s = S[i:i+len_T]
score = sum([1 if s[i]==T[i] else 0 for i in range(len(s))])
score_list.append(score)
print(len_T - max(score_list))
|
s198731837 | p02571 | u426513846 | 1598728257 | Python | PyPy3 (7.3.0) | py | Runtime Error | 160 | 68640 | 190 | s = input()
t = input()
i = 0
j = len(t)
m = j
while j < len(s):
count = 0
for k in range(i, j):
if s[k] == t[k]
count += 1
m = min(m, len(t) - count)
j += 1
i += 1 |
s972744741 | p02571 | u589783652 | 1598728242 | Python | PyPy3 (7.3.0) | py | Runtime Error | 151 | 68756 | 234 | S = input()
T = input()
for i in range(len(S) - len(T)):
count = 0
maxcount = 0
for j in range(len(T)):
if S[i + j] == T[j]:
count += 1
maxcount = max(maxcount, count)
print(len(T) - maxcount)
|
s486079855 | p02571 | u864090097 | 1598728242 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9056 | 167 | S = input()
T = input()
l = len(T)
for i in range (l):
if T[:l-i] in S:
ans = i
break
if T[i:] in S:
ans = i
break
print(ans) |
s525987214 | p02571 | u251075661 | 1598728227 | Python | Python (3.8.2) | py | Runtime Error | 50 | 9108 | 239 | s = input()
t = input()
counters = []
for i in range(len(s) - len(t)):
part_of_s = s[i: i + len(t)]
counter = 0
for sss, ttt in zip(part_of_s, t):
if sss != ttt:
counter += 1
counters.append(counter)
print(min(counters)) |
s447675074 | p02571 | u635621124 | 1598728205 | Python | Python (3.8.2) | py | Runtime Error | 58 | 9040 | 198 | list_ = []
S = input()
T = input()
for i in range(len(S) - len(T)):
cnt = 0
for j in range(len(T)):
if T[j] != S[i + j]:
cnt += 1
list_.append(cnt)
print(min(list_))
|
s712653829 | p02571 | u771007149 | 1598728203 | Python | Python (3.8.2) | py | Runtime Error | 71 | 9044 | 211 | s = input()
t = input()
result = []
for i in range(len(s)-len(t)):
tmp = 0
for j in range(i,len(t)+i):
if s[j] == t[j-i]:
tmp += 1
result.append(tmp)
print(len(t)-max(result))
|
s952511567 | p02571 | u935139749 | 1598728190 | Python | Python (3.8.2) | py | Runtime Error | 345 | 9108 | 217 | s = input()
t = input()
cnt = 0
for ti in range(len(t)):
for si in range(len(s)):
if t[ti] == s[si]:
cnt += 1
ans = max(0,cnt)
else:
cnt = 0
print(len(t) - ans) |
s718702212 | p02571 | u185405877 | 1598728176 | Python | Python (3.8.2) | py | Runtime Error | 31 | 9068 | 213 | s=input()
l=input()
len_s=len(s)
len_l=len(l)
a=len_s-len_l
ans=1001
for i in range(len_s-a):
cnt=0
for j in range(len_s):
if l[j]==s[i+j]:
cnt+=1
ans=min(ans,len_l-cnt)
print(ans) |
s942645213 | p02571 | u760569096 | 1598728166 | Python | PyPy3 (7.3.0) | py | Runtime Error | 186 | 68676 | 162 | s = input()
t = input()
g = []
for i in range(len(s)-len(t)):
n = 0
for j in range(len(t)):
if s[i+j]==t[j]:
n+=1
g.append(len(t)-n)
print(min(g)) |
s384930188 | p02571 | u581403769 | 1598728160 | Python | Python (3.8.2) | py | Runtime Error | 22 | 9124 | 243 | s = list(input())
t = list(input())
ln = len(s)
lt = len(t)
n = ls - lt + 1
l = []
cnt = 0
for i in range(n):
for j in range(lt):
if t[j] != s[i + j]:
cnt += 1
l.append(cnt)
cnt = 0
print(min(l))
|
s121197825 | p02571 | u491100219 | 1598728147 | Python | Python (3.8.2) | py | Runtime Error | 29 | 8940 | 493 | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
using namespace std;
using ll = long long;
const ll mod = (ll)1e9 + 7;
int main() {
string s, t;
cin >> s >> t;
int ans = INT_MAX;
rep(i, t.size()) {
for (int j = i; j < s.size() && t.size() - i <= s.size() - j; j++) {
if (... |
s395042452 | p02571 | u190616335 | 1598728115 | Python | Python (3.8.2) | py | Runtime Error | 21 | 9008 | 303 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
s = input()
t = input()
min_count = 1000
for i in range(len(s) - len(t) + ):
count = 0
for j in range(len(t)):
if s[i+j] != t[j]:
count += 1
min_count = min(count, min_count)
if min_count == 0:
break
print(min_count) |
s081809056 | p02571 | u259975636 | 1598728112 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9032 | 178 | s = input()
t = input()
q = []
for i in range(1,len(t)):
if t[:i] in s: q.append(i)
if len(q) == 0:
for j in t:
if j in s: q.append(len(t)-1)
print(min(q))
|
s387776953 | p02571 | u616382321 | 1598728094 | Python | Python (3.8.2) | py | Runtime Error | 61 | 9040 | 196 | S = input()
T = input()
l = len(T)
ans = []
for i in range(len(S)-l):
cnt = 0
for n in range(l):
if S[i+n] != T[n]:
cnt += 1
ans.append(cnt)
print(min(ans))
|
s343900211 | p02571 | u146066372 | 1598728090 | Python | PyPy3 (7.3.0) | py | Runtime Error | 99 | 68640 | 232 | s =input()
t =input()
S = len(s)
T = len(t)
cnt=0
max=0
for i in range(T):
for j in range(S-T):
if s[i+j] == t[j]:
cnt += 1
else:
if max<cnt:
max=cnt
cnt=0
print(T-max)
|
s899126789 | p02571 | u998741086 | 1598728071 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8912 | 229 | #!/usr/bin/env python3
s = input()
t = input()
errors = []
for i in range(len(s)-len(t)+1):
error = 0
for j in range(len(t)):
if s[i+j] != t[j]:
error += 1
errors.append(error)
print(min(errors) |
s505532874 | p02571 | u842170774 | 1598728062 | Python | Python (3.8.2) | py | Runtime Error | 44 | 9120 | 214 | # B
S=input()
T=input()
def check(i,T):
ns=S[i:i+len(T)]
res=0
for i in range(len(T)):
if ns[i]!=T[i]:
res+=1
return res
print(min([check(i,T) for i in range(len(S)-len(T))])) |
s290715738 | p02571 | u755056246 | 1598728002 | Python | Python (3.8.2) | py | Runtime Error | 53 | 9108 | 208 | s = input()
t = input()
lent = len(t)
ans = []
for i in range(len(s) - lent):
ss = s[i:i+lent]
ans1 = 0
for s1, t1 in zip(ss, t):
ans1 += (s1==t1)
ans.append(ans1)
print(lent-max(ans)) |
s481813095 | p02571 | u321605735 | 1598727999 | Python | Python (3.8.2) | py | Runtime Error | 60 | 8992 | 196 | S=list(input())
T=list(input())
ans_li=[]
for i in range(len(S)-len(T)):
ans=0
for j in range(len(T)):
if S[i+j]!=T[j]:
ans+=1
ans_li.append(ans)
print(min(ans_li)) |
s070806666 | p02571 | u157379742 | 1598727988 | Python | PyPy3 (7.3.0) | py | Runtime Error | 93 | 74756 | 1944 | import bisect
import sys,io
import math
from collections import deque
from heapq import heappush, heappop
input = sys.stdin.buffer.readline
def sRaw():
return input().rstrip("\r")
def iRaw():
return int(input())
def ssRaw():
return input().split()
def isRaw():
return list(map(int, ssRaw()))
INF... |
s167294905 | p02571 | u991542950 | 1598727978 | Python | PyPy3 (7.3.0) | py | Runtime Error | 153 | 68664 | 255 | import sys
input = sys.stdin.readline
S = input()
T = input()
score_list = []
for i in range(0, len(S)-len(T)):
s = S[i:i+len(T)]
score = sum([1 if s[i]==T[i] else 0 for i in range(len(s))])
score_list.append(score)
print(len(T) - max(score_list)) |
s705423741 | p02571 | u371132735 | 1598727974 | Python | Python (3.8.2) | py | Runtime Error | 32 | 9032 | 156 | # abc177_b.py
S = input()
T = input()
for i in range(1,len(T)):
if T[0:i] in S:
continue
else:
ans = i
break
print(len(T)-i) |
s769790935 | p02571 | u722217673 | 1598727955 | Python | Python (3.8.2) | py | Runtime Error | 41 | 9100 | 175 | S = input()
T = input()
def diff(a, b):
return sum(aa != bb for aa, bb in zip(a, b))
answer = min( diff(S[i: i+len(T)], T) for i in range(len(S)-len(T)) )
print(answer)
|
s733815849 | p02571 | u671211357 | 1598727940 | Python | Python (3.8.2) | py | Runtime Error | 53 | 9052 | 205 | S=input()
T=input()
cnt=[]
for i in range(len(S)-len(T)):
count=0
kari=S[i:i+len(T)]
for j in range(len(T)):
if kari[j]!=T[j]:
count+=1
cnt.append(count)
print(min(cnt)) |
s924536005 | p02571 | u216928054 | 1598727936 | Python | PyPy3 (7.3.0) | py | Runtime Error | 122 | 68568 | 1239 | #!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**6)
INF = 10 ** 9 + 1 # sys.maxsize # float("inf")
MOD = 10 ** 9 + 7
def debug(*x):
print(*x, file=sys.stderr)
def solve(S, T):
buf = []
for i in range(len(S) - len(T)):
diff = 0
for j in range(len(T)):
if S[i + j] !... |
s364071269 | p02571 | u556589653 | 1598727919 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9156 | 86 | d,t,s = map(int,input().split())
if d <= s * t:
print("Yes")
else:
print("No") |
s293039623 | p02571 | u460229551 | 1598727876 | Python | Python (3.8.2) | py | Runtime Error | 73 | 9048 | 192 | s=input()
t=input()
anses=[]
for i in range(0,len(s)-len(t),1):
cnt=0
for j in range(len(t)):
if s[i+j]==t[j]:
cnt+=1
anses.append(cnt)
print(len(t)-max(anses)) |
s662194017 | p02571 | u530606147 | 1598727840 | Python | Python (3.8.2) | py | Runtime Error | 50 | 9040 | 187 | s = input()
t = input()
anses = []
for i in range(len(s) - len(t)):
cnt = 0
for c, d in zip(s[i:i + len(t)], t):
if c != d:
cnt += 1
anses.append(cnt)
print(min(anses))
|
s322078003 | p02571 | u667024514 | 1598727804 | Python | PyPy3 (7.3.0) | py | Runtime Error | 137 | 69236 | 184 | s = str(input())
t = str(input())
ans = 10000
for i in range(len(s)-len(t)+1):
num = 0
for j in range(len(t)):
if s[i+j] != t[i]:
num += 1
ans = min(ans,num)
print(ans) |
s986261587 | p02572 | u921156673 | 1600686835 | Python | PyPy3 (7.3.0) | py | Runtime Error | 123 | 105360 | 224 | N = int(input())
A = list(map(int, input().split()))
assert len(A) == N
total = 0
sumA = []
for i,ai in enumerate(A):
sumA.append(sum(A[i+1]))
for i,ai in enumerate(A):
total += ai * sumA[i]
print(total % (10 ** 9 + 7)) |
s821567593 | p02572 | u921156673 | 1600686214 | Python | PyPy3 (7.3.0) | py | Runtime Error | 108 | 93760 | 144 | N = int(input())
A = map(int, input().split())
total = 0
for i in range(1, N+1):
for j in range(i, N+1):
total += A[i] * A[j]
print(total) |
s875865568 | p02572 | u754511616 | 1600676913 | Python | Python (3.8.2) | py | Runtime Error | 76 | 31712 | 152 | MOD=10**9+7
N=int(input())
A=list(map(int,input().split()))
S=sum(A)%MOD
ans=0
for x in A:
s-=x
s%=MOD
ans+=s*x
ans%=MOD
ans%=MOD
print(ans) |
s298983589 | p02572 | u282376189 | 1600654964 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8972 | 159 | N = int(input())
A = list(map(int,input().split()))
mod = 1000000000 + 7
add = 0
for i in range(N):
tmp = sum(A[i+1:N])
add += tmp * A[i]
print(add%mod |
s332514472 | p02572 | u196182810 | 1600646954 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 31648 | 267 | def SumOfProduct(n, arrayA):
ans = 0
for i in range(0, len(arrayA)):
for j in range(i + 1, len(arrayA)):
ans += arrayA[i] * arrayA[j]
print(ans)
n = int(input())
arrayA = list(map(int, input().split()))
SumOfProduct(n, arrayA)
print(a+b+c+d+e+f)
|
s867048452 | p02572 | u696886537 | 1600621166 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9072 | 194 | f=open('in','r')
input=lambda:f.readline().strip()
n=int(input())
r=list(map(int,input().split()))
mod=1000000007
s=sum(r)%mod
x=0
for u in r:
x+=u**2
x%=mod
t=500000004
print((s**2-x)*t%mod) |
s548649484 | p02572 | u402492580 | 1600618090 | Python | Python (3.8.2) | py | Runtime Error | 71 | 31524 | 194 | N = int(input())
A = list(map(int, input().split()))
mod = 7 + 10**9
for i in A:
A[i] %= mod
for j in range(N-1):
for k in range(j+1, N):
t = A[j] * A[k]
ans += t
ans %= mod
print(ans) |
s053870738 | p02572 | u402492580 | 1600617539 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9104 | 252 | #N = int(input())
#A = list(map(int, input().split()))
n, a = input().split("\n")
N = int(n)
A = list(map(int, a.split()))
mod = 7 + 10**9
s = 0
for i in range(N-1):
for j in range(i+1, N):
t = A[i] * A[j] % mod
s += t
ans = s % mod
print(ans) |
s001257226 | p02572 | u402492580 | 1600615033 | Python | Python (3.8.2) | py | Runtime Error | 72 | 31664 | 155 | N = int(input())
A = list(map(int, input().split()))
for i in range(N-1):
for j in range(i+1, N):
t = A[i]*A[j] % (10**9+7)
sum = sum(t)
print(sum) |
s041538847 | p02572 | u402492580 | 1600614936 | Python | Python (3.8.2) | py | Runtime Error | 76 | 31736 | 150 | N = int(input())
A = list(map(int, input().split()))
for i in range(N-1) and j in range(i+1, N):
t = A[i]*A[j] % (10**9+7)
sum = sum(t)
print(sum) |
s400059268 | p02572 | u486209657 | 1600614457 | Python | Python (3.8.2) | py | Runtime Error | 664 | 924936 | 182 | import numpy as np
N=int(input())
A=np.array(list(map(int,input().split())))
L=len(str(max(A)))//4
A=A/10**L
x=np.sum(np.outer(A,A))-np.sum(A*A)
print(int(x/2*10**(2*L)%(10**9+7))) |
s199524566 | p02572 | u365838886 | 1600599563 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9076 | 699 | N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
count = 0
stack = set()
visited = []
visited_set = set()
endf = False
current = 0
while True:
i = A[current]-1
visited_set.add(current)
visited.append(current)
if not i in visited_set:
current = i
count += 1
... |
s755517211 | p02572 | u865383026 | 1600562444 | Python | Python (3.8.2) | py | Runtime Error | 1843 | 1933164 | 154 | import numpy as np
N = int(input())
A = list(map(int, input().split()))
print(np.sum(np.tril(np.outer(np.array(A), np.array(A)), k = -1)) % (10 ** 9 + 7)) |
s923534851 | p02572 | u365838886 | 1600555851 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 31604 | 147 | N = int(input())
A = list(map(int, input().split()))
s = 0
for i in range(N-1):
s += A[i]*sum(A[i+1:])
# answer = s % (10**9+7)
print(answer) |
s951355625 | p02572 | u963963908 | 1600526063 | Python | Python (3.8.2) | py | Runtime Error | 71 | 31420 | 131 | N = int(input())
A = list(map(int,input().split()))
for i in range(1,N-1):
for j in range(i,N):
K = sum(A[i]*A[j])
print(K) |
s379822705 | p02572 | u849559474 | 1600375609 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8916 | 170 | n = int(input())
mod = 10 ** 9 + 7
import numpy as np
a = list(map(int, input().split())
s=0
ss=0
for i in range(n):
ss += a[i]%mod
s += ss * a[i] % mod
print(s)
|
s291732569 | p02572 | u849559474 | 1600375566 | Python | Python (3.8.2) | py | Runtime Error | 21 | 8908 | 169 | n = int(input())
mod = 10 ** 9 + 7
import numpy as np
a = np.array(map(int, input().split())
s=0
ss=0
for i in range(n):
ss += a[i]%mod
s += ss * a[i] % mod
print(s) |
s298496334 | p02572 | u849559474 | 1600375537 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9000 | 173 | n = int(input())
mod = 10 ** 9 + 7
import numpy as np
a = np.array(map(int, input().split())
s=0
ss=0
for i in range(n):
ss += a[i]%mod
s += ss * a[i] % mod
print(s) |
s990227349 | p02572 | u848097937 | 1600336293 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8896 | 1469 | //g++ -std=gnu++14 a.cpp
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <iostream>
#include <istream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <tuple>
#include <iomanip>
#include <random>
#inclu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.