problem_id
stringlengths
6
6
user_id
stringlengths
10
10
time_limit
float64
1k
8k
memory_limit
float64
262k
1.05M
problem_description
stringlengths
48
1.55k
codes
stringlengths
35
98.9k
status
stringlengths
28
1.7k
submission_ids
stringlengths
28
1.41k
memories
stringlengths
13
808
cpu_times
stringlengths
11
610
code_sizes
stringlengths
7
505
p02571
u467463073
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['N = int(input())\nA = list(map(int,input().split()))\nans = 0\nm0 = 10**9+7\nfor i in range(0,N-1):\n for j in range(i+1,N):\n ans = (ans + A[i]*A[j]) % m0\nprint(ans)', 'S = input().rstrip()\nT = input().rstrip()\ncount = 0\nlens = len(S)\nlent = len(T)\nfor i in range(lens-lent+1):\n tempcount=0\n for j in range(lent):\n if S[i+j]==T[j]:\n tempcount += 1\n print(tempcount)\n count = max(count,tempcount)\n\nprint(lent-count)', 'S = input().rstrip()\nT = input().rstrip()\ncount = 0\nlens = len(S)\nlent = len(T)\nfor i in range(lens-lent+1):\n tempcount=0\n for j in range(lent):\n if S[i+j]==T[j]:\n tempcount += 1\n #print(tempcount)\n count = max(count,tempcount)\n\nprint(lent-count)']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s135803477', 's403177518', 's134871947']
[9052.0, 9156.0, 8940.0]
[24.0, 74.0, 71.0]
[170, 275, 276]
p02571
u468972478
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['n = int(input())\na = list(map(int, input().split()))\nb = []\nfor i in range(n):\n for j in range(i+1, n):\n b.append(a[i] % (10 ** 9 + 7) * (a[j] % (10 ** 9 + 7))\nprint(sum(b) % (10 ** 9 + 7))', 's, t = [input() for i in range(2)]\nc = []\nfor i in range(len(s) - len(t) + 1):\n d = len(t)\n for a, b in zip(s[i:], t):\n if a == b:\n d -= 1\n c.append(d)\nprint(min(c))']
['Runtime Error', 'Accepted']
['s406421201', 's436434700']
[9048.0, 9116.0]
[19.0, 61.0]
[193, 176]
p02571
u473781743
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s = input()\nt = input()\n\ncnt = 0\n\nfor i in range(1, len(t) + 1):\n for j in range(len(t) - i + 1):\n if t[j:j+i] in s:\n cnt = max(cnt, i)\n\nprint(len(s) - cnt)', 's = input()\nt = input()\n \nans = 0\n \nfor i in range(len(s) - len(t) + 1):\n cnt = 0\n for j in range(len(t)):\n if s[i+j] == t[j]:\n cnt += 1\n ans = max(cnt, ans)\n \nprint(len(t)-ans)']
['Wrong Answer', 'Accepted']
['s872443163', 's588390399']
[9056.0, 9028.0]
[465.0, 70.0]
[177, 189]
p02571
u482157295
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s = input()\nt = input()\ns_len = len(s)\nt_len = len(t)\nans = 1000\nfor i in range(s_len-t_len+1):\n cnt = 0\n for j in range(t_len):\n print(s[i+j])\n if s[i+j] != t[j]:\n cnt += 1\n ans = min(ans,cnt)\nprint(ans)', 's = input()\nt = input()\ns_len = len(s)\nt_len = len(t)\nans = 1000\nfor i in range(s_len-t_len+1):\n cnt = 0\n for j in range(t_len):\n if s[i+j] != t[j]:\n cnt += 1\n ans = min(ans,cnt)\nprint(ans)']
['Wrong Answer', 'Accepted']
['s970443451', 's384895923']
[9068.0, 9112.0]
[127.0, 74.0]
[238, 216]
p02571
u485819963
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s = input()\nt = input()\n\ns_len =len(s)\nt_len =len(t)\ncount = 0\n\n\n\nfor i in range(s_len - t_len):\n for j in range(t_len):\n if s[i:t_len][j] != t[j]\n count += 1\n print(count)', 's = input()\nt = input()\n\ns_len =len(s)\nt_len =len(t)\ncount = 0\nans = []\n\n\n\nfor i in range(s_len - t_len + 1):\n for j in range(t_len):\n if s[i:t_len + i][j] != t[j]:\n count += 1\n ans.append(count)\n count = 0\n\nmin_ans = min(ans)\nprint(min_ans)\n\n']
['Runtime Error', 'Accepted']
['s985045660', 's417397422']
[9032.0, 9004.0]
[22.0, 80.0]
[196, 270]
p02571
u489247698
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['from collections import deque\nimport sys, copy, itertools,heapq\ninput = sys.stdin.readline\n\nS = input().rstrip()\nT = input()\ns=len(S)\nt= len(T)\nANS=[0]*(len(S))\n\nfor i in range(len(S)-len(T)+1):\n for j in range(len(T)):\n if S[i+j] == T[j]:\n ANS[i] += 1\n\n#print(ANS)\nprint(t-max(ANS))', "\ninput = sys.stdin.readline\n\nS = input()\nT = input()\n\nresult = float('inf')\nfor i in range(len(S) - len(T) + 1):\n t = 0\n for j in range(len(T)):\n if S[i + j] != T[j]:\n t += 1\n result = min(result, t)\nprint(result)\n", 'from collections import deque\nimport sys, copy, itertools,heapq\n#input = sys.stdin.readline\n \nS = input()\nT = input()\ns = len(S)\nt = len(T)\nA=[0]*(len(S))\n \nans = t\nfor i in range(len(S)-len(T)+1):\n for j in range(len(T)):\n if S[i+j] != T[j]:\n A[i] += 1\n ans = min(ans, A[i])\n \n#print(s)\n#print(t)\n#print(ANS)\nprint(ans)']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s136086787', 's628179032', 's504051745']
[9536.0, 9004.0, 9380.0]
[80.0, 27.0, 63.0]
[292, 241, 330]
p02571
u492929439
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S = input()\nT = input()\n\nNmax = len(T)\nfor i in range(len(S)-len(T)+1):\n diff = 0\n for i in range(len(T)):\n if(S[i] != T[i]):\n diff += 1\n if (diff < Nmax):\n Nmax = diff\n\nprint(Nmax)\n', 'S = input()\nT = input()\n\nNmax = len(T)\nfor i in range(len(S)-len(T)+1):\n diff = 0\n for j in range(len(T)):\n if(S[i+j] != T[j]):\n diff += 1\n\n Nmax = min(diff, Nmax)\n\nprint(Nmax)\n']
['Wrong Answer', 'Accepted']
['s835899727', 's733102082']
[8872.0, 9068.0]
[50.0, 59.0]
[216, 204]
p02571
u496449946
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S, T = [input() for x in range(2)]\nlenT = len(T)\nmax_match_len = 0\n\nfor i in range(len(S)-lenT+1):\n compareS = S[i:i+lenT]\n print(compareS)\n match_len = 0\n for j in range(lenT):\n if compareS[j] == T[j]:\n match_len += 1\n else:\n if max_match_len < match_len:\n max_match_len = match_len\nprint(lenT - max_match_len)', 'S, T = [input() for x in range(2)]\nlenT = len(T)\nmax_match_len = 0\n\nfor i in range(len(S)-lenT):\n compareS = S[i:i+lenT]\n match_len = 0\n print(compareS)\n for j in range(lenT):\n if compareS[j] == T[j]:\n match_len += 1\n else:\n if max_match_len < match_len:\n max_match_len = match_len\nprint(len(T) - max_match_len)', 'for i in range(len(S)-lenT+1):\n compareS = S[i:i+lenT]\n match_len = 0\n for j in range(lenT):\n if compareS[j] == T[j]:\n match_len += 1\n else:\n if max_match_len < match_len:\n max_match_len = match_len\nprint(lenT - max_match_len)\n', '\nS, T = [input() for x in range(2)]\nlenT = len(T)\nmax_match_len = 0\n\nfor i in range(len(S)-lenT+1):\n compareS = S[i:i+lenT]\n match_len = 0\n for j in range(lenT):\n if compareS[j] == T[j]:\n match_len += 1\n else:\n if max_match_len < match_len:\n max_match_len = match_len\nprint(lenT - max_match_len)\n']
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s438766462', 's735750658', 's863491121', 's766176667']
[9004.0, 8840.0, 9088.0, 9048.0]
[63.0, 62.0, 24.0, 60.0]
[332, 332, 247, 316]
p02571
u498575211
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S=input()\nT=input()\nk = len(T)\nans=k\nlim=0\nfor i in range(len(S)-len(T)+1):\n for j in range(k):\n print( S[i+j],T[j])\n if S[i+j]==T[j]:\n lim+=1\n if lim<=ans:\n ans=len(T)-lim\n lim=0\nprint(ans)', 'S=input()\nT=input()\nk = len(T)\nans=k\nlim=0\nfor i in range(len(S)-len(T)+1):\n for j in range(k):\n #print(i, j, S[i+j],T[j])\n if S[i+j]!=T[j]:\n lim+=1\n if lim<=ans:\n ans=lim\n lim=0\nprint(ans)']
['Wrong Answer', 'Accepted']
['s104365034', 's929732928']
[9080.0, 9088.0]
[199.0, 55.0]
[207, 206]
p02571
u503294750
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S=list(input())\nT=list(input())\n\nnum=1000\nfor i in range(len(S)-len(T)+1):\n s = S[i:i+len(T)]\n print(s)\n cnt = 0\n for j in range(len(T)):\n if s[j]!=T[j]:\n cnt+=1\n ans=min(num, cnt)\nprint(ans)\n', 'S=list(input())\nT=list(input())\n \nnum=1000\nfor i in range(len(S)-len(T)+1):\n s = S[i:i+len(T)]\n cnt = 0\n for j in range(len(T)):\n if s[j]!=T[j]:\n cnt+=1\n num=min(num, cnt)\nprint(num)']
['Wrong Answer', 'Accepted']
['s353349710', 's199104855']
[9060.0, 9028.0]
[67.0, 52.0]
[225, 212]
p02571
u504272868
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S = list(input())\nT = list(input())\n\nmin_ = 99999\nfor i in range(len(S)-len(T)+1):\n count = 0\n for j in range(len(T)):\n if S[i+j] != T[j]:\n count += 1\n if count < min_:\n min_ = count\ncount', 'S = list(input())\nT = list(input())\n\nmin_ = 99999\nfor i in range(len(S)-len(T)+1):\n count = 0\n for j in range(len(T)):\n if S[i+j] != T[j]:\n count += 1\n if count < min_:\n min_ = count\nprint(min_)']
['Wrong Answer', 'Accepted']
['s007463681', 's017434851']
[9104.0, 8996.0]
[63.0, 60.0]
[222, 228]
p02571
u508061226
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['import itertools\ns = input()\nt = input()\n\nA = itertools.combinations(list(range(len(t)+1)),2)\nfor i in A:\n part = t[i[0]:i[1]]\n print(part)\n if part in s:\n ans = len(part)\n \nprint(len(t) - ans)\n', 'import itertools\ns = input()\nt = input()\n\nA = itertools.combinations(list(range(len(t)+1)),2)\nfor i in A:\n part = t[i[0]:i[1]]\n if part in s:\n ans = len(part)\n \nprint(len(t) - ans)\n', 'import itertools\ns = input()\nt = input()\n\nA = itertools.combinations(list(range(len(t)+1)),2)\nfor i in A:\n part = t[i[0]:i[1]]\n if part in s:\n ans = len(part)\n \nprint(len(t) - ans)', 's = input()\nt = input()\n\nA = itertools.combinations(list(range(len(t)+1)),2)\nfor i in A:\n part = t[i[0]:i[1]]\n print(part)\n if part in s:\n ans = len(part)\n \nprint(len(t) - ans)', 's= input()\nt = input()\n\ncount = len(t)\n\nfor i in range(len(s) - len(t) + 1):\n str_ = s[i:i + len(t)]\n temp = 0\n for i in range(len(str_)):\n #print(str_[i])\n if str_[i] != t[i]:\n temp += 1\n count = min(count, temp) \n \nprint(count)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s052926346', 's261682807', 's287299255', 's991342538', 's671946354']
[137916.0, 8968.0, 9040.0, 8816.0, 9084.0]
[2171.0, 422.0, 419.0, 32.0, 56.0]
[217, 201, 200, 199, 276]
p02571
u508960292
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['strS = input()\nstrT = input()\n\nmaxRange = 0\nl = 0\nwhile l <= (len(strS)-len(strT)):\n m = 0\n count = 0\n while m < (len(strT)):\n if strS[l+m] != strT[m]:\n count += 1\n m += 1\n if maxRange > count:\n maxRange = count\n l += 1\n\nprint(maxRange)\n\n\n\n', 'strS = input()\nstrT = input()\n\nmaxRange = 0\nl = 0\nwhile l <= (len(strS)-len(strT)):\n m = 0\n count = 0\n while m <= (len(strT)):\n if strS[l+m] == strT[m]:\n count += 1\n m += 1\n if maxRange < count:\n maxRange = count\n l += 1\nprint(len(strT)-maxRange)\n\n\n\n', 'strS = input()\nstrT = input()\n\nstrS = list(strS)\nstrT = list(strT)\n\nmaxRange = 0\nl = 0\nwhile l <= (len(strS)-len(strT)):\n m = 0\n count = 0\n while m < (len(strT)):\n if strS[l+m] != strT[m]:\n count += 1\n m += 1\n if maxRange > count:\n maxRange = count\n l += 1\n\nprint(maxRange)\n', 'strings = input().splitlines()\n\n\n\n\nstrS = list(strings[0])\nstrT = list(strings[1])\n\nmaxRange = 0\nl = 0\nwhile l < (len(strS)-len(strT)):\n m = 0\n count = 0\n while m < (len(strT)):\n if strS[l+m] == strT[m]:\n count += 1\n m += 1\n if maxRange < count:\n maxRange = count\n l += 1\nprint(len(strT)-maxRange)\n\n\n\n', 'strS = input()\nstrT = input()\n\nmaxRange = 0\nl = 0\nwhile l <= (len(strS)-len(strT)):\n m = 0\n count = 0\n while m <= (len(strT)):\n if strS[l+m] != strT[m]:\n count += 1\n m += 1\n if maxRange > count:\n maxRange = count\n l += 1\nprint(maxRange)\n\n\n\n', 'strS = input()\nstrT = input()\n\nstrS = list(strS)\nstrT = list(strT)\n\nmaxRange = 0\nl = 0\nwhile l <= (len(strS)-len(strT)):\n m = 0\n count = 0\n while m < (len(strT)):\n if strS[l+m] == strT[m]:\n count += 1\n m += 1\n if maxRange < count:\n maxRange = count\n l += 1\n\nprint(len(strT)-maxRange)\n']
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s088862787', 's387502159', 's418513906', 's421927908', 's765073058', 's626860631']
[9028.0, 8992.0, 9060.0, 9032.0, 9028.0, 9124.0]
[85.0, 23.0, 92.0, 25.0, 25.0, 97.0]
[287, 297, 321, 512, 287, 331]
p02571
u511899838
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['import copy\n\ns = input()\nt = input()\n\nsn = len(s)\ntn = len(t)\nanswer = int(copy.deepcopy(tn))\n\nfor i in range(sn-tn+1):\n sk = s[i:i+tn]\n count = 0\n for j in range(tn):\n if sk[j] != t[j]:\n count += 1\n print(sk,count)\n if count < answer:\n answer = count\n\nprint(answer)', 'import copy\n\ns = input()\nt = input()\n\nsn = len(s)\ntn = len(t)\nanswer = int(copy.deepcopy(tn))\n\nfor i in range(sn-tn+1):\n sk = s[i:i+tn]\n count = 0\n for j in range(tn):\n if sk[j] != t[j]:\n count += 1\n if count < answer:\n answer = count\n\nprint(answer)']
['Wrong Answer', 'Accepted']
['s470789330', 's998667407']
[9212.0, 9220.0]
[88.0, 111.0]
[306, 286]
p02571
u523087093
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S = input()\nT = input()\n\nmax_count = 0\nfor start in range(len(T)):\n for end in range(start, len(T)):\n if T[start] == S[start]:\n if T[start:end+1] in S[start:-(len(T)-end)]:\n\n max_count = max(max_count, len(T[start:end+1]))\n\nanswer = len(T) - max_count\nprint(answer)\n\n\n\n\n\n\n\n\n\n', 'S = input()\nT = input()\n\nmax_count = 0\nfor start in range(len(T)):\n for end in range(start, len(T)):\n if T[start] == S[start]:\n if T[start:end+1] in S[start:-(len(T)-end)]:\n\n max_count = max(max_count, len(T[start:end+1]))\n\nanswer = len(T) - max_count\nprint(answer)\n\n\n\n\n\n\n\n\n\n', "S = input()\nT = input()\n\nanswer = float('inf')\nfor s in range(len(S)):\n if len(S) - s < len(T):\n break\n count = 0\n for t in range(len(T)):\n\n if S[s+t] != T[t]:\n count += 1\n \n answer = min(answer, count)\n\nprint(answer)"]
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s525495409', 's764727717', 's186400387']
[9016.0, 9072.0, 9036.0]
[251.0, 238.0, 63.0]
[311, 311, 265]
p02571
u525796732
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['import sys\nimport math\nimport fractions\nfrom collections import defaultdict\nstdin = sys.stdin\n \nns = lambda: stdin.readline().rstrip()\nni = lambda: int(stdin.readline().rstrip())\nnm = lambda: map(int, stdin.readline().split())\nnl = lambda: list(map(int, stdin.readline().split()))\n\n\nS=list(ns())\nT=list(ns())\n\nINF=10**9\nans=INF\nfor i in range(len(S)-len(T)):\n tmp=0\n for j in range(len(T)):\n if(S[i+j]!=T[j]):\n tmp+=1\n ans=min(ans,tmp)\n\nprint(tmp)\n \n\n\n', 'import sys\nimport math\nimport fractions\nfrom collections import defaultdict\nstdin = sys.stdin\n \nns = lambda: stdin.readline().rstrip()\nni = lambda: int(stdin.readline().rstrip())\nnm = lambda: map(int, stdin.readline().split())\nnl = lambda: list(map(int, stdin.readline().split()))\n\n\nS=list(ns())\nT=list(ns())\n\nINF=10**9\nans=INF\nfor i in range(len(S)-len(T)+1):\n tmp=0\n for j in range(len(T)):\n if(S[i+j]!=T[j]):\n tmp+=1\n ans=min(ans,tmp)\n\nprint(ans)\n \n\n\n']
['Runtime Error', 'Accepted']
['s586564805', 's771616079']
[10380.0, 10320.0]
[66.0, 75.0]
[495, 497]
p02571
u526966088
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['long_str = input()\nshort_str = input()\nshort_list = list(short_str)\n\nlong_len = len(long_str)\nshort_len = len(short_str)\niter_num = long_len - short_len + 1\n\nprint(short_str)\n\nmax_count = 0\nfor i in range(iter_num):\n tmp = 0\n obj_list = list(long_str[i:(short_len+i)])\n for s, o in zip(short_list, obj_list):\n tmp += int(s == o)\n max_count = max(max_count, tmp)\n\nprint(short_len - max_count)\n', 'long_str = input()\nshort_str = input()\nshort_list = list(short_str)\n\nlong_len = len(long_str)\nshort_len = len(short_str)\niter_num = long_len - short_len + 1\n\nmax_count = 0\nfor i in range(iter_num):\n tmp = 0\n obj_list = list(long_str[i:(short_len+i)])\n for s, o in zip(short_list, obj_list):\n tmp += int(s == o)\n max_count = max(max_count, tmp)\n\nprint(short_len - max_count)\n']
['Wrong Answer', 'Accepted']
['s584995793', 's639205012']
[8968.0, 8824.0]
[74.0, 75.0]
[399, 381]
p02571
u547608423
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S = input()\nT = input()\n\nL = 0\njudge = False\n\nfor i in range(len(T), 0, -1):\n # print(i)\n for j in range(len(T)-i+1):\n print(S[j:])\n if T[j:j+i] in S[j:]:\n L = i\n \n judge = True\n # print(i, j)\n break\n if judge:\n break\n\nprint(len(T)-L)\n', 'S = input()\nT = input()\n\nls = len(S)\nlt = len(T)\n\nans = ls\n\nfor i in range(ls-lt+1):\n cnt = 0\n for j in range(lt):\n if S[i+j] != T[j]:\n cnt += 1\n ans = min(ans, cnt)\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s045652635', 's516512225']
[137912.0, 8936.0]
[1869.0, 62.0]
[337, 204]
p02571
u553459461
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s = input()\nt = input()\n\nres = 10000000000\n\nfor i in range(0, len(s)-len(t)+1):\n m = 0\n # print(s[i:], t)\n \n # print(j,k)\n # if j==k:\n # m += 1\n for j in range(0, len(t)):\n # print(s[j], t[j])\n if(s[j]==t[j]):\n m+=1\n \n res = min(res, len(t)-m)\n # print(len(t)-m)\n\nprint(res)', 's = input()\nt = input()\n\nres = 10000000000\n\nfor i in range(0, len(s)-len(t)+1):\n m = 0\n # print(s[i:], t)\n for j, k in zip(s[i:],t):\n # print(j,k)\n if j==k:\n m += 1\n \n res = min(res, len(t)-m)\n\nif(res==10000000000):\n print(len(t))\nelse: \n print(res)']
['Wrong Answer', 'Accepted']
['s088793786', 's272376861']
[8920.0, 9000.0]
[67.0, 61.0]
[380, 303]
p02571
u556589653
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['d,t,s = map(int,input().split())\nif d <= s * t:\n print("Yes")\nelse:\n print("No")', 's = input()\nt = input()\nls = []\nfor i in range(len(s) - len(t) + 1):\n ls.append(s[i:i+len(t)])\nnow = 0\nminimum = len(t)\nfor i in range(len(ls)):\n now = 0\n for j in range(len(t)):\n if t[j] == ls[i][j]:\n now += 1\n if len(t) - now < minimum:\n minimum = len(t) - now\nprint(minimum)']
['Runtime Error', 'Accepted']
['s364071269', 's266570492']
[9156.0, 9136.0]
[29.0, 68.0]
[86, 314]
p02571
u572042625
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s = input()\nt = input()\n\nsl = len(s)\ntl = len(t)\ncount = 0\nfor i in range(0,sl-tl+1):\n sb = s[i:i+tl]\n for j in range(tl):\n co = 0\n if sb[j] == t[j]:\n co += 1\n if co > count:\n count = co\n\nprint(tl - count)\n', 's = input()\nt = input()\n\nsl = len(s)\ntl = len(t)\ncount = 0\nfor i in range(0,sl-tl+1):\n sb = s[i:i+tl]\n\n co = 0\n for j in range(tl):\n\n \n if sb[j] == t[j]:\n co += 1\n if co > count:\n count = co\n\n\nprint(tl - count)\n']
['Wrong Answer', 'Accepted']
['s067131277', 's920268769']
[9112.0, 8984.0]
[62.0, 70.0]
[247, 255]
p02571
u577745299
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['import numpy as np\nmax_change = 1000\ns = input()\nt = input()\nlist_t = np.array([ _ for _ in t])\nfor i in range(1,len(s) - len(t) + 1):\n s_sample = s[i-1:len(t)+i-1]\n list_ss = np.array([ _ for _ in list_ss])\n list_tf = list_t == list_ss\n n_change = len(list_t) - sum(list_tf)\n if n_change < max_change:\n max_change = n_change\n else:\n pass\nprint(max_change)', 'import numpy as np\nmax_change = 1000\ns = input()\nt = input()\nlist_t = np.array([ _ for _ in t])\nif len(s) == len(t):\n list_s = np.array([ _ for _ in s])\n list_tf = list_t == list_s\n n_change = len(list_t) - sum(list_tf)\n if n_change < max_change:\n max_change = n_change\n else:\n pass\nelse:\n for i in range(1,len(s) - len(t) + 1):\n s_sample = s[i-1:len(t)+i-1]\n list_ss = np.array([ _ for _ in s_sample])\n list_tf = list_t == list_ss\n n_change = len(list_t) - sum(list_tf)\n if n_change < max_change:\n max_change = n_change\n else:\n pass\nprint(max_change)']
['Runtime Error', 'Accepted']
['s665589471', 's125431851']
[27096.0, 27144.0]
[122.0, 547.0]
[388, 647]
p02571
u579746769
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S=input()\nT=input()\n\nans=10000\n\nfor i inrange(len(S)-len(T)+1):\n score=0\n U=S[i:i+len(T)]\n for j in range(len(T)):\n if U[j] != T[J]:\n score += 1\n ans = min(ans, score)\n\nprint(ans)', 'S=input()\nT=input()\n\nans=10000\n\nfor i inrange(len(S)-len(T)+1):\n score=0\n U=S[i:i+len(T)]\n for j in range(len(T)):\n if U[j] != T[J]:\n score += 1\n ans = min(ans, score)\n\nprint(ans) ', 'S=input()\nT=input()\n\nans=10000\n\nfor i in range(len(S)-len(T)+1):\n score=0\n U=S[i:i+len(T)]\n for j in range(len(T)):\n if U[j] != T[j]:\n score += 1\n ans = min(ans, score)\n\nprint(ans)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s323619562', 's495828471', 's367511417']
[8940.0, 8932.0, 9128.0]
[27.0, 27.0, 56.0]
[282, 284, 283]
p02571
u581403769
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s = list(input())\nt = list(input())\n\nln = len(s)\nlt = len(t)\nn = ls - lt + 1\nl = []\n\ncnt = 0\nfor i in range(n):\n for j in range(lt):\n if t[j] != s[i + j]:\n cnt += 1\n l.append(cnt)\n cnt = 0\n \nprint(min(l))\n ', 's = list(input())\nt = list(input())\n\nls = len(s)\nlt = len(t)\nn = ls - lt + 1\nl = []\n\ncnt = 0\nfor i in range(n):\n for j in range(lt):\n if t[j] != s[i + j]:\n cnt += 1\n l.append(cnt)\n cnt = 0\n \nprint(min(l))']
['Runtime Error', 'Accepted']
['s384930188', 's753296332']
[9124.0, 9060.0]
[22.0, 60.0]
[243, 234]
p02571
u588592871
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s=list(input())\nt=list(input())\nS=[0 for i in range(len(s)-len(t)+1)]\nfor i in range(len(s)-len(t)+1):\n for j in range(len(t)):\n if t[j]==s[j+i]:\n S[i]+=1\n\nS_max=max(S)\nprint(t-S_max)', 's=list(input())\nt=list(input())\nS=[0 for i in range(len(s)-len(t)+1)]\nfor i in range(len(s)-len(t)+1):\n for j in range(len(t)):\n if t[j]==s[j+i]:\n S[i]+=1\n \nS_0=max(S)\nprint(len(t)-S_0)']
['Runtime Error', 'Accepted']
['s107878296', 's756675951']
[9140.0, 9012.0]
[71.0, 79.0]
[192, 199]
p02571
u593019570
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s = input()\nt = input()\n\nans = 10 ** 8\nfor i in range(len(s)-len(t)+1):\n check = 0\n for j in range(len(t)):\n print(s[i+j], t[j])\n if s[i+j] != t[j]:\n check = check + 1\n if ans > check:\n ans = check\nprint(ans)', 's = input()\nt = input()\n\nans = 10 ** 8\nfor i in range(len(s)-len(t)+1):\n check = 0\n for j in range(len(t)):\n if s[i+j] != t[j]:\n check = check + 1\n if ans > check:\n ans = check\nprint(ans)']
['Wrong Answer', 'Accepted']
['s920752776', 's316498356']
[8964.0, 9116.0]
[181.0, 56.0]
[225, 201]
p02571
u609561564
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S=input()\nT=input()\n\nnum_char=0\nfor i in range(len(T)):\n for j in range(i+1,len(T)):\n if T[i:j] in S[i:]:\n print(T[i:j])\n if num_char<j-i:\n num_char=j-i\nprint(len(T)-num_char)', 'S=input()\nT=input()\n\nbest_num_char=0\nfor i in range(len(S)-len(T)+1):\n # print(T[i:])\n num_char=0\n for j in range(len(T)):\n num_char+=1 if S[i+j]==T[j] else 0\n # print(num_char,S[i + j])\n if best_num_char<num_char:\n best_num_char=num_char\n\n# print(len(T))\nprint(len(T)-best_num_char)']
['Runtime Error', 'Accepted']
['s794389450', 's328390638']
[137900.0, 9044.0]
[2016.0, 64.0]
[222, 316]
p02571
u617298485
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S = input()\nT = input()\n\niteration = len(S) - len(T) + 1\n\nif T in S:\n ans = 0\nelse:\n minimum = len(T)\n for i in range(iteration):\n s = S[i:len(T)+i]\n for j in range(len(T)):\n count = 0\n if s[j] != T[j]:\n count += 1\n minimum = min(minimum, count)\n ans = minimum\n \nprint(ans)', "S = input()\nT = input()\n\niteration = len(S) - len(T) + 1\n\nif T in S:\n ans = 0\nelse:\n minimum = len(T)\n for i in range(iteration):\n# print('---------------')\n s = S[i:len(T)+i]\n# print(s)\n# print(T)\n count = 0\n for j in range(len(T)):\n if s[j] != T[j]:\n count += 1\n# print(count)\n minimum = min(minimum, count)\n ans = minimum\n \nprint(ans)"]
['Wrong Answer', 'Accepted']
['s773677360', 's505651296']
[9080.0, 8960.0]
[60.0, 58.0]
[346, 442]
p02571
u620259318
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['import re\n\ns = input()\nt = input()\ncnt = -1\nfor i in range(len(t) + 1):\n cnt += 1\n f = "\\S{" + str(i) +"}" + t[(i):len(t)]\n b = t[0:len(t) - i] + "\\S{" + str(i) + "}"\n if re.search(f, s):\n print("in")\n break\n elif re.search(b, s):\n print("in")\n break\n\nprint(cnt)\n', 's = input()\nt = input()\n\nans = len(t)\n\nfor i in range(len(s) - (len(t) - 1)):\n cnt = len(t)\n for j in range(len(t)):\n if s[i + j] == t[j]:\n cnt -= 1\n if cnt < ans:\n ans = cnt\n\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s564629068', 's901001203']
[16028.0, 9136.0]
[1346.0, 74.0]
[306, 221]
p02571
u623814058
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S=input()\nT=input()\nimport re\n\ndef x():\n for i in range(len(T),0,-1): \n for j in range(len(T)-i): \n t=T[j:i+j]\n for m in re.finditer(t, S):\n p=m.start()\n if p!=-1:\n if j<=p and len(T)-j-1 <=len(S)-p-1:\n return i\n return 0\nprint(len(T)-t)', "S=input()\nT=input()\nls=len(S)\nlt=len(T)\n\nans=float('inf')\nfor i in range(0,ls-lt+1):\n ans=min(ans, sum([l!=m for l,m in zip(S[i:i+lt], T)]))\nprint(ans)"]
['Runtime Error', 'Accepted']
['s383797183', 's316978615']
[9660.0, 9028.0]
[34.0, 44.0]
[416, 154]
p02571
u625920333
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['import sys\n\ns = input()\nt = input()\n\nfinalans = 0\nfor i in range(len(s) - len(t) + 1):\n ans = 0\n for j in range(len(t)):\n if (s[i+j] == t[j]):\n pass\n else:\n ans += 1\n finalans = min(finalans, ans)\n\nprint(finalans)\n', 'import sys\n\ns = input()\nt = input()\n\nfinalans = 1000000\nfor i in range(len(s) - len(t) + 1):\n ans = 0\n for j in range(len(t)):\n if (s[i+j] == t[j]):\n pass\n else:\n ans += 1\n finalans = min(finalans, ans)\n\nprint(finalans)\n']
['Wrong Answer', 'Accepted']
['s965905827', 's619379587']
[9100.0, 9040.0]
[62.0, 61.0]
[259, 265]
p02571
u633140979
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['def check(S,T,i):\n\tcount=0\n\tfor j in range(i,len(T)+i):\n\t\tif S[j] == T[j-i]:\n\t\t\tcount+=1\n\treturn count\n\nS=input()\nT=input()\nb=[]\nfor i in range(0,len(S)-len(T)+1):\n\tb.append(check(S,T,i))\nb.sort()\nprint(b[0])\n\n', 'def check(S,T,i):\n\tcount=0\n\tfor j in range(i,len(T)+i):\n\t\tif S[j] != T[j-i]:\n\t\t\tcount+=1\n\treturn count\n\nS=input()\nT=input()\nb=[]\nfor i in range(0,len(S)-len(T)+1):\n\tb.append(check(S,T,i))\nb.sort()\nprint(b[0])\n\n\n']
['Wrong Answer', 'Accepted']
['s308854509', 's360507570']
[9104.0, 9016.0]
[52.0, 48.0]
[210, 211]
p02571
u642823003
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s = list(input())\nt = list(input())\nans = len(t)\n\nfor i in range(0, len(s) - len(t) + 1):\n tmp = len(t)\n tmp1 = s[i:i + len(t)]\n print(tmp1)\n for j in range(len(t)):\n if tmp1[j] == t[j]:\n tmp -= 1\n\n ans = min(ans, tmp)\n\nprint(ans)\n', 's = list(input())\nt = list(input())\nans = len(t)\n\nfor i in range(0, len(s) - len(t) + 1):\n tmp = len(t)\n tmp1 = s[i:i + len(t)]\n for j in range(len(t)):\n if tmp1[j] == t[j]:\n tmp -= 1\n\n ans = min(ans, tmp)\n\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s674441080', 's351801183']
[9092.0, 8948.0]
[80.0, 70.0]
[264, 248]
p02571
u643679148
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s = input()\nt = input()\n\n\nans = 0\nfor i in range(len(t)+1, 0, -1):\n for j in range(0, len(t)-i+1):\n if t[j:j+i] in s:\n \n ans = i\n break\n\n\nprint(len(t)-ans)\n', 's = input()\nt = input()\n\n\nans = len(t)\nflag = False\n\n\nfor i in range(len(s)-len(t)):\n dif = 0\n for j in range(len(t)):\n if t[j] != s[j]:\n dif += 1\n\n ans = min(ans, dif)\n\nprint(ans)\n', 's = input()\nt = input()\n\n\nans = len(t)\nflag = False\n\n\nfor i in range(len(s)-len(t)):\n dif = 0\n for j in range(len(t)):\n if t[j] != s[j]:\n dif += 1\n\n ans = min(ans, dif)\n\nprint(ans)\n\n\n# for j in range(0, len(t)-i+1):\n\n# if sb in s[j:]:\n\n# ans = len(t)-len(sb)\n\n# break\n#\n# if flag:\n# break\n\n\nprint(ans)\n', 's = input()\nt = input()\n\n\nans = 0\nflag = False\nfor i in range(len(t)+1, 0, -1):\n for j in range(0, len(t)-i+1):\n if t[j:j+i] in s[j:]:\n ans = i\n break\n\n\nprint(len(t)-ans)\n', 'n = int(input())\na = list(map(int, input().split()))\n\nsums = 0\nfor i in range(n-1):\n for j in range(i+1, n):\n sums += (a[i] * a[j])\n\nprint(sums % (10 ** 9 + 7))\n', 's = input()\nt = input()\n\n\nans = len(t)\nflag = False\nfor i in range(len(t)+1, 0, -1):\n for j in range(0, len(t)-i+1):\n sb = t[j:j+i]\n if sb in s[j:]:\n ans = len(t)-len(sb)\n\n\nprint(ans)\n', 's = input()\nt = input()\n\n\nans = 0\nflag = False\nfor i in range(len(t)+1, 0, -1):\n for j in range(0, len(t)-i+1):\n if t[j:j+i] in s:\n for i in range(0, len(t)-len(t[j:j+i])):\n try:\n ind = s.index(t[j:j+i])\n if ind >= j and len(s[ind:]) - len(t[j:]) >= 0:\n print(t[j:j+i])\n ans = i\n flag = True\n break\n except:\n pass\n\n if flag:\n break\n\n\nprint(len(t)-ans)\n', 's = input()\nt = input()\n\n\nans = 0\nflag = False\nfor i in range(len(t)+1, 0, -1):\n for j in range(0, len(t)-i+1):\n if t[j:j+i] in s[j:-len(s[j+i:len(t)])]:\n ans = i\n break\n\n\nprint(len(t)-ans)\n', "s = input()\nt = input()\n\n\nans = 0\nflag = False\nfor i in range(len(t)+1, 0, -1):\n for j in range(0, len(t)-i+1):\n if t[j:j+i] in s:\n \n ind = s.index(t[j:j+1])\n if ind >= j and len(s) - ind - len(t[j:j+1]) > 0:\n ans = i\n flag = True\n break\n\n if flag:\n print('test')\n break\n\n\nprint(len(t)-ans)\n", '# -*- coding: utf-8 -*-\ns = input()\nt = input()\n\nans = len(t)\n\nfor i in range(len(s)-len(t)+1):\n dif = 0\n for j in range(len(t)):\n if s[j+i] != t[j]:\n dif += 1\n\n ans = min(ans, dif)\n\nprint(ans)\n']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s019819383', 's020291207', 's320750465', 's363348137', 's369079946', 's575539731', 's606413679', 's779999944', 's783209314', 's488538230']
[8996.0, 9004.0, 9040.0, 9044.0, 9176.0, 9136.0, 9044.0, 8980.0, 9032.0, 9092.0]
[316.0, 57.0, 62.0, 326.0, 31.0, 496.0, 326.0, 466.0, 320.0, 60.0]
[232, 208, 480, 203, 171, 212, 562, 222, 433, 221]
p02571
u645183909
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S = input()\nT = input()\n\n', 'match_cnt = 0\n\nS = input()\nT = input()\n\nS_len = len(S)\nT_len = len(T)\n\nfor S_idx in range(S_len - T_len + 1):\n cnt = 0\n\n for T_idx in range(T_len):\n if(S[S_idx + T_idx] == T[T_idx]):\n cnt += 1\n \n if( cnt > match_cnt ):\n match_cnt = cnt\n\nprint(T_len - match_cnt)']
['Wrong Answer', 'Accepted']
['s703212980', 's926957924']
[8976.0, 9068.0]
[25.0, 65.0]
[25, 276]
p02571
u645937929
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s = input()\nt = input()\nc = 0\n\nfor i in range(len(s) - len(t) + 1):\n c_1 = 0\n for j in range(len(t)):\n if s[i + j] == t[j]:\n c_1 += 0\n if c < c_1:\n c = c_1\n\nprint(len(t) - c) ', 's = input()\nt = input()\nc = 0\n\nfor i in range(len(s) - len(t) + 1):\n c_1 = 0\n for j in range(len(t)):\n if s[i + j] == t[j]:\n c_1 += 1\n if c < c_1:\n c = c_1\n\nprint(len(t) - c)']
['Wrong Answer', 'Accepted']
['s156293561', 's138411847']
[9036.0, 9060.0]
[70.0, 71.0]
[210, 208]
p02571
u648374449
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s=input()\nt=input()\n\nprint(s)\na = len(s)\nb = len(t)\nc = a-b;\nmin1 = 0;\nmin2 = 0;\nfor i in range(c):\n for j in range(b):\n if s[j]==t[i+j]:\n min2 += 1\n if min1>min2:\n min1 = min2\nprint(min1)', 's=input()\nt=input()\n\na = len(s)\nb = len(t)\nc = a-b;\nmin1 = 0;\nmin2 = 0;\nfor i in range(c+1):\n for j in range(b):\n \n if s[j+i]==t[j]:\n \n min2 += 1\n if min1<min2:\n min1 = min2\n min2 =0\nprint(b-min1)']
['Runtime Error', 'Accepted']
['s281416159', 's135880239']
[8908.0, 8848.0]
[29.0, 70.0]
[201, 218]
p02571
u648452607
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S=input()\nT=input()\n\nif T in S:\n print(0)\n exit()\n\ndef f(s1,s2):\n print(s1, s2)\n r=0\n for i,j in zip(s1,s2):\n if i != j: r += 1\n return r\n\na=len(S)\nfor i in range(len(S)-len(T)+1):\n r = f(S[i:i+len(T)],T)\n if a > r: a = r\n\nprint(a)', 'S=input()\nT=input()\n\nif T in S:\n print(0)\n exit()\n\ndef f(s1,s2):\n r=0\n for i,j in zip(s1,s2):\n if i != j: r += 1\n return r\n\na=len(S)\nfor i in range(len(S)-len(T)+1):\n r = f(S[i:i+len(T)],T)\n if a > r: a = r\n\nprint(a)']
['Wrong Answer', 'Accepted']
['s202049648', 's584517387']
[9076.0, 9128.0]
[35.0, 40.0]
[242, 226]
p02571
u656803083
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s, t = input(), input()\n\nans = 0\n\nfor i in range(len(s) - len(t) + 1):\n count = 0\n for j in range(len(t)):\n if s[i][j] == t[j]:\n count += 1\n\nif ans <= count:\n ans = count\nprint(len(t) - count)', 's = input()\nt = input()\n \nans = 0\n \nfor i in range(len(s) - len(t) + 1):\n count = 0\n for j in range(len(t)):\n if s[i + j] == t[j]:\n count += 1\n \n if ans <= count:\n ans = count\nprint(len(t) - ans)']
['Runtime Error', 'Accepted']
['s217758763', 's397891391']
[9012.0, 9040.0]
[29.0, 66.0]
[203, 209]
p02571
u658181634
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S = input()\nT = input()\n\ncand = []\nfor start in range(len(S) - len(T) + 1):\n print(S[start:start+len(T)])\n cnt = sum([not T[i] == S[start:start+len(T)][i] for i in range(len(T))])\n cand.append(cnt)\n\nprint(min(cand))\n', 'S = input()\nT = input()\n\ncand = []\nfor start in range(len(S) - len(T) + 1):\n cnt = sum([not T[i] == S[start:start+len(T)][i] for i in range(len(T))])\n cand.append(cnt)\n\nprint(min(cand))\n']
['Wrong Answer', 'Accepted']
['s547787999', 's515299948']
[9004.0, 8972.0]
[98.0, 103.0]
[225, 192]
p02571
u667084803
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s = input()\nt = input()\nans = len(t)\nfor i in range(len(s)-len(t)+1):\n \n curr = 0\n for j in range(len(t)):\n if s[i+j] != t[j]:\n curr+=1\n ans = max(curr, ans)\n \nprint(ans)', 's = input()\nt = input()\nans = len(t)\nfor i in range(len(s)-len(t)+1):\n \n curr = 0\n for j in range(len(t)):\n if s[i+j] != t[j]:\n curr+=1\n ans = min(curr, ans)\n \nprint(ans)']
['Wrong Answer', 'Accepted']
['s065161170', 's814895524']
[9056.0, 9116.0]
[58.0, 57.0]
[202, 202]
p02571
u668552255
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S = input()\nT = input()\n', 'S = list(input())\nT = list(input())\n\nmindiff = len(S)\nfor i in range(len(S) - len(T) +1):\n diff = 0\n for j in range(len(T)):\n if(S[i+j] != T[j]):\n diff += 1\n pass\n if(diff < mindiff):\n mindiff = diff\n\nprint(mindiff)\n\n\n\n']
['Wrong Answer', 'Accepted']
['s910238068', 's327831712']
[8940.0, 9080.0]
[27.0, 58.0]
[24, 260]
p02571
u668552863
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S=input()\nT=input()\ni=0\nj=0\nmatch = 0\nfor i in range(Len(S)-Len(T)):\n count = 0\n for j in range(Len(T)):\n if S[i+j]==T[j]:\n count=count+1\n \n if match<count:\n match=count\n\nprint(Len(T)-match)\n ', 'S=input()\nT=input()\ni=0\nj=0\nmatch = 0\nfor i in Range(Len(S)-Len(T)):\n count = 0\n for j in Range(Len(T)):\n if S[i+j]==T[j]:\n count=count+1\n \n if match<count:\n match=count\n\nprint(Len(T)-match)\n \n ', 'S=input()\nT=input()\nmatch=0\nfor i in range(len(S)-len(T)+1):\n count=0\n for j in range(len(T)):\n if S[i+j]==T[j]:\n count=count+1\n if match<count:\n match=count\nprint(len(T)-match)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s357969820', 's403321418', 's472208196']
[8932.0, 9116.0, 9020.0]
[28.0, 26.0, 71.0]
[212, 217, 211]
p02571
u670567845
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S = input()\nT = input()\nl = len(T)\nans = l\nprint(ans)\nfor i in range(l):\n for j in range(l):\n if (i<=j):\n if T[i:j+1] in S:\n if f >= i and f + (l-j) <= len(S):\n ans = min(ans, l - (j+1-i))\nprint(ans)\n ', 'S = input()\nT = input()\nls = len(S)\nlt = len(T)\nans = lt\nfor i in range(0,ls-lt+1):\n m = 0\n for j in range(lt):\n if S[i:i+lt][j]!=T[j]:\n m += 1\n ans = min(ans,m)\nprint(ans)']
['Runtime Error', 'Accepted']
['s526523375', 's101611449']
[9048.0, 9096.0]
[329.0, 90.0]
[233, 183]
p02571
u680851063
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s=input()\nt=input()\n\nfor i in range(len(s)-len(t)):\n ans=10**9+7\n miss=0\n tmp=s[i:i+len(t)]\n for j in range(len(t)):\n if tmp[j]!=t[j]:\n miss+=1\n ans=min(ans, miss)\n\nprint(ans)\n', 's=input()\nt=input()\n\nans=10**9+7\nfor i in range(len(s)-len(t)+1):\n miss=0\n tmp=s[i:i+len(t)]\n for j in range(len(t)):\n if tmp[j]!=t[j]:\n miss+=1\n ans=min(ans, miss)\n\nprint(ans)\n\n']
['Runtime Error', 'Accepted']
['s389502433', 's301907154']
[8992.0, 9036.0]
[50.0, 53.0]
[209, 208]
p02571
u689890477
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s = input()\nt = input()\nss = len(s)\ntt = len(t)\nmin = tt\n\nfor i in range(ss - tt + 1):\n count = 0\n for j in range(tt):\n if s[j] != t[j]:\n count += 1\n if min > count:\n min = count\n\nprint(min) \n', 's = input()\nt = input()\nss = len(s)\ntt = len(t)\nmin = tt\n\n\nfor i in range(ss - tt + 1):\n count = 0\n for j in range(tt):\n if s[i+j] != t[j]:\n count += 1\n if min > count:\n min = count\n\nprint(min) \n']
['Wrong Answer', 'Accepted']
['s989169948', 's374231094']
[9048.0, 9108.0]
[52.0, 55.0]
[206, 209]
p02571
u690536347
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S = input()\nT = input()\n\nsize = len(T)\nn = len(S)\nans = size\n\nfor i in range(n-size+1):\n t = S[i:i+size]\n print(t)\n v = sum([k!=j for k, j in zip(T, t)])\n ans = min(v, ans)\n\nprint(ans)\n', 'S = input()\nT = input()\n\nsize = len(T)\nn = len(S)\nans = size\n\nfor i in range(n-size+1):\n t = S[i:i+size]\n v = sum([k!=j for k, j in zip(T, t)])\n ans = min(v, ans)\n\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s444987773', 's521319003']
[9052.0, 9120.0]
[52.0, 49.0]
[197, 184]
p02571
u693007703
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
["S = input()\nT = input()\n\nlen_T = len(T)\nlen_S = len(S)\noutput = len_T\n\nfor i in range(len_S-len_T):\n diff = 0\n for j in range(len_T):\n if T[j] != S[i+j]:\n diff += 1\n output = min(output, diff)\n\nprint('output',output)\n ", 'S = input()\nT = input()\n\nlen_T = len(T)\nlen_S = len(S)\noutput = len_T\n\nfor i in range(len_S-len_T+1):\n diff = 0\n for j in range(len_T):\n if T[j] != S[i+j]:\n diff += 1\n output = min(output, diff)\n\nprint(output)']
['Wrong Answer', 'Accepted']
['s705656982', 's061696511']
[9080.0, 9056.0]
[64.0, 65.0]
[260, 236]
p02571
u693716675
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s = input()\nt = input()\nls = len(s)\nlt = len(t)\n\nans = 0\nfor i in range(ls-lt+1):\n same = 0\n for j in range(lt):\n ind = i+lt\n if s[ind]==t[j]:\n same += 1\n ans = min(ans,min)\nprint(ans)', 's = input()\nt = input()\nls = len(s)\nlt = len(t)\n\nans = 0\nfor i in range(ls-lt+1):\n same = 0\n for j in range(lt):\n ind = i+j\n if s[ind]==t[j]:\n same += 1\n ans = max(ans,same)\nprint(lt-ans)\n']
['Runtime Error', 'Accepted']
['s917375514', 's666342587']
[8980.0, 8976.0]
[26.0, 81.0]
[198, 202]
p02571
u695197008
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S = input().strip()\t # novel\nT = input().strip() # substring\n\nx = len(T)\nans = len(S)\nfor i in range(len(S) - x):\n U = S[i:i+x]\n cost = sum(1 if U[k] != T[k] for k in range(x))\n ans = min(ans, cost)\nprint(ans)', 'S = input().strip()\t # novel\nT = input().strip() # substring\n\nx = len(T)\nans = len(S)\nfor i in range(len(S) - x + 1):\n U = S[i:i+x]\n cost = sum(1 if U[k] != T[k] else 0 for k in range(x))\n ans = min(ans, cost)\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s217302183', 's196379455']
[9036.0, 9112.0]
[23.0, 52.0]
[213, 225]
p02571
u699882868
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s=input()\nt=input()\n\ncount = []\n\nfor i in range(len(s)-len(t)):\n c=0\n for j in range(i,i+len(t)):\n if s[j] == t[j]:\n c+=1\n \n count.append(c)\n\nprint(len(t)-max(count))\n', 's=input()\nt=input()\n\ncount = []\n\nfor i in range(len(s)-len(t)+1):\n c=0\n for j in range(i,i+len(t)):\n if s[j] == t[j-i]:\n c+=1\n count.append(c)\n\n# print(count)\nprint(len(t)-max(count))\n']
['Runtime Error', 'Accepted']
['s230326537', 's617006327']
[9008.0, 9064.0]
[24.0, 67.0]
[197, 211]
p02571
u707451177
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['import numpy as np\ns = input()\nt = input()\nstrs = []\nt_size = len(t)\nfor i in np.arange(len(s)-len(t)+1):\n strs.append(s[i:i+t_size])\nn = 0\nmax_n = 0\nfor ss in strs:\n for i in np.arange(len(t)):\n print(t[i], ss[i])\n if t[i]==ss[i]:\n n += 1\n if max_n < n:\n max_n = n\n n = 0\nprint(len(t)-max_n)', 's = input()\nt = input()\n\nfor i in np.flip(np.arange(len(t))):\n if t[:i] in s:\n print(len(t)-i)\n break\n else:\n print(len(t))', 's = input()\nt = input()\nstrs = []\nt_size = len(t)\nfor i in np.arange(len(s)-len(t)+1):\n strs.append(s[i:i+t_size])\nn = 0\nmax_n = 0\nfor ss in strs:\n for i in np.arange(len(t)):\n if t[i]==ss[i]:\n n += 1\n else:\n n = 0\n if max_n < n:\n max_n = n\nprint(len(t)-max_n)', 's = input()\nt = input()\nn = 0\nmax_n = 0\nfor ss in strs:\n for i in np.arange(len(t)):\n if t[i]==ss[i]:\n n += 1\n else:\n n = 0\n if max_n < n:\n max_n = n\nprint(len(t)-max_n)', 'import numpy as np\ns = input()\nt = input()\nstrs = []\nt_size = len(t)\nfor i in np.arange(len(s)-len(t)+1):\n strs.append(s[i:i+t_size])\nn = 0\nmax_n = 0\nfor ss in strs:\n for i in np.arange(len(t)):\n if t[i]==ss[i]:\n n += 1\n if max_n < n:\n max_n = n\n n = 0\nprint(len(t)-max_n)']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s561689444', 's565194017', 's676521849', 's947050402', 's776677775']
[26700.0, 9036.0, 8996.0, 9012.0, 26612.0]
[315.0, 27.0, 31.0, 29.0, 189.0]
[344, 150, 320, 226, 317]
p02571
u714852797
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S, T = [input() for _ in range(2)]\nanswer = 1001\n\nfor i in range(len(S) - len(T) + 1):\n\tk = 0\n\tU = S[i:i + len(T)]\n\tfor j in range(len(T)):\n\t\tif T(j) != U(j):\n\t\t\tk += 1\n\tanswer = min(answer, k)\nprint(answer)', 'S, T = [input() for _ in range(2)]\n\nanswer = float("inf")\n\nfor i in range(len(S) - len(T) + 1):\n\tk = 0\n\tS_subset = S[i:i + len(T)]\n\tfor t, s in zip(T, S_subset):\n\t\tif t != s:\n\t\t\tk += 1\n\tanswer = min(answer, k)\nprint(answer)']
['Runtime Error', 'Accepted']
['s045734781', 's622464467']
[9004.0, 8992.0]
[26.0, 56.0]
[207, 223]
p02571
u723345499
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s = input()\nt = input()\n\nres = float("inf")\nfor i in range(len(t)):\n if t[i:] in s:\n res = i\n print("i:", i)\n break\nfor j in range(1, len(t) - 1):\n if t[:(-j)] in s:\n res = min(j, res)\n print("j:", j)\n break\nprint(res)\n', 's = input()\nt = input()\n\nls = len(s)\nlt = len(t)\nres = float("inf")\ncnt = 0\nfor i in range(ls - lt+1):\n cnt= 0\n for j in range(lt):\n if s[i + j] != t[j]:\n cnt += 1\n res = min(res, cnt)\nprint(res) ']
['Wrong Answer', 'Accepted']
['s257368083', 's932497633']
[9040.0, 9128.0]
[29.0, 62.0]
[267, 226]
p02571
u731436822
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s = input()\nt = input()\n\n# ans = []\n\n# # print(t[i:])\n# # print(s[i:])\n# if t[i:] in s[i:]:\n# break\n# for j in range(1,len(t[i:])):\n# # print(t[i:][:-j])\n# # print(s[i:][:-j])\n# if t[i:][:-j] in s[i:][:-j]:\n# ans.append(i+j)\n# break\n# if t in s:\n# print(0)\n# elif len(ans) == 0:\n# print(len(t))\n# else:\n# print(min(ans))\nans = len(t)\nfor i in range(len(s)-len(t)):\n dif = 0\n for j in range(len(t)):\n if t[j] != s[i:i+len(t)][j]:\n diff += 1\n ans = min(dif,ans)\n\nprint(ans) ', 's = input()\nt = input()\n\n# ans = []\n\n# # print(t[i:])\n# # print(s[i:])\n# if t[i:] in s[i:]:\n# break\n# for j in range(1,len(t[i:])):\n# # print(t[i:][:-j])\n# # print(s[i:][:-j])\n# if t[i:][:-j] in s[i:][:-j]:\n# ans.append(i+j)\n# break\n# if t in s:\n# print(0)\n# elif len(ans) == 0:\n# print(len(t))\n# else:\n# print(min(ans))\nans = len(t)\nfor i in range(len(s)-len(t)+1):\n dif = 0\n for j in range(len(t)):\n if t[j] != s[i:i+len(t)][j]:\n dif += 1\n ans = min(dif,ans)\n\nprint(ans) ']
['Runtime Error', 'Accepted']
['s549698505', 's859615016']
[9016.0, 9048.0]
[28.0, 98.0]
[612, 613]
p02571
u734195782
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s = input()\nt = input()\nans = 0\nfor i in range(len(s)-len(t)+1):\n m = 0\n for j, k in zip(s[i:],t):\n if j==k:\n m += 1\n if m > ans:\n ans = m\nprint(ans)', '#include <stdio.h>\n#include <string.h>\n\nint main(void){\n char s[1000];\n char t[1000];\n scanf("%s",s);\n scanf("%s",t);\n int m[strlen(s)];\n for(int i = 0; i < strlen(s); i++){\n m[i] = 0;\n }\n for(int i = 0; i < strlen(s); i++){\n for(int j = 0; j < strlen(t); j++){\n if(s[i] == t[j] && i>=j && strlen(s)-i>=strlen(t)-j){\n for(int k = j; k < strlen(s); k++){\n if(s[i+k-j] == t[k]){\n m[i]++;\n }\n else{\n break;\n }\n }\n }\n }\n }\n int max = 0;\n for(int i = 0; i < strlen(t); i++){\n if(max < m[i]){\n max = m[i];\n }\n }\n printf("%d",strlen(t)-max);\n return 0;\n}', 's = input()\nt = input()\nans = 0\nfor i in range(len(s)-len(t)+1):\n m = 0\n for j, k in zip(s[i:],t):\n if j==k:\n m += 1\n if m > ans:\n ans = m\nprint(len(t) - ans)']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s523553574', 's892888825', 's892236905']
[8908.0, 8940.0, 8984.0]
[54.0, 26.0, 59.0]
[183, 809, 192]
p02571
u734252743
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s = input() #efabdd\nt = input() #abcd\nsl = len(s) #6\ntl = input(t) #4\nans = tl #4\nfor i in range(sl-tl+1): #6-4+1 => 0, 1, 2\n c = 0\n for j in range(min(tl, sl): #min(4, 6) => 4\n if (s[i+j] != t[j]: #s[0] != t[0]..t[3]\n c += 1\n ans = min(c, ans) #min(0..4, 4)\nprint(ans)\n', 's = input() #efabdd\nt = input() #abcd\nsl = len(s) #6\ntl = len(t) #4\nans = tl #4\nfor i in range(sl-tl+1): #6-4+1 => 0, 1, 2\n c = 0\n for j in range(min(tl, sl)): #min(4, 6) => 4\n if (s[i+j] != t[j]): #s[0] != t[0]..t[3]\n c += 1\n ans = min(c, ans) #min(0..4, 4)\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s222149522', 's369225647']
[8964.0, 9072.0]
[23.0, 59.0]
[297, 297]
p02571
u737670214
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['\ndef match1(str1, str2):\n match_count = 0\n for i in range(len(str1)):\n if str1[i] == str2[i]:\n match_count += 1\n\n return match_count\n\nS = input()\nT = input()\n\nmax_match = 0\nfor i in range(0, len(S) +1 -len(T)):\n subS = S[i:i+len(T)]\n max_match = max(max_match, match1(T, subS))\n print("{} {}".format(subS, T))\n if max_match == 0:\n for j in range(len(T)):\n if T[j] == subS[j]:\n max_match = 1\n\nprint(len(T)-max_match)', '\ndef match1(str1, str2):\n match_count = 0\n for i in range(len(str1)):\n if str1[i] == str2[i]:\n match_count += 1\n\n return match_count\n\nS = input()\nT = input()\n\nmax_match = 0\nfor i in range(0, len(S) +1 -len(T)):\n subS = S[i:i+len(T)]\n max_match = max(max_match, match1(T, subS))\n if max_match == 0:\n for j in range(len(T)):\n if T[j] == subS[j]:\n max_match = 1\n\nprint(len(T)-max_match)']
['Wrong Answer', 'Accepted']
['s430614822', 's790830816']
[9092.0, 9084.0]
[49.0, 44.0]
[487, 452]
p02571
u740157634
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S = input()\nT = input()\n\ncnt = 0\n\nfor i in range(len(s)-len(t)+1):\n same = 0\n for j in range(len(t)):\n if S[i + j] == T[j]:\n same += 1\n cnt = max(same, cnt)\nprint(len(t)-cnt)\n', 'S = input()\nT = input()\n\ncnt = 0\n\nfor i in range(len(S)-len(T)+1):\n same = 0\n for j in range(len(T)):\n if S[i + j] == T[j]:\n same += 1\n cnt = max(same, cnt)\nprint(len(T)-cnt)\n']
['Runtime Error', 'Accepted']
['s764912991', 's545359538']
[8936.0, 9060.0]
[26.0, 111.0]
[206, 206]
p02571
u742082223
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['# coding: utf-8\n# Your code here!\nS = input()\nT = input()\n\nprint(len(S))\n\na = 0\nans = len(T)\n\nfor i in range(len(S)-len(T)):\n a = 0\n for j in range(len(T)):\n if(T[j] != S[i+j]):\n a += 1\n ans = min(ans,a)\nprint(ans)\n', '# coding: utf-8\n# Your code here!\nS = input()\nT = input()\n\na = 0\nans = len(T)\n\nfor i in range(len(S)-len(T)+1):\n a = 0\n for j in range(len(T)):\n if(T[j] != S[i+j]):\n a += 1\n ans = min(ans,a)\n\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s574553342', 's729682313']
[9092.0, 9004.0]
[54.0, 63.0]
[242, 230]
p02571
u743878367
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S = input()\nT = input()\n\nfor i in range(len(S)-len(T)+1):\n\tsub_S = S[i:i+len(T)]\n\tcnt = 0\n\tfor j in range(len(T)):\n\t\tif sub_S[j] != T[j]:\n\t\t\tcnt += 1\n\tcnt_list.append(cnt)\nprint(min(cnt_list))', 'for i in range(len(S)-len(T)+1):\n sub_S = S[i:i+len(T)]\n cnt = 0\n for j in range(len(T)):\n if sub_S[j] != T[j]:\n cnt += 1\n cnt_list.append(cnt)\nprint(min(cnt_list))', 'S = input()\nT = input()\ncnt_list = []\n\nfor j in range(len(S)-len(T)):\n sub_S = S[j:(j+len(S))]\n for k in range(len(T)-1):\n cnt = 0\n if T[k] != sub_S[k]:\n cnt += 1\n cnt_list.append(cnt)\n\nprint(min(cnt_list))\n ', 'S = input()\nT = input()\n\nfor i in range(len(S)-len(T)+1):\n sub_S = S[i:i+len(T)]\n cnt = 0\n for j in range(len(T)):\n if sub_S[j] != T[j]:\n cnt += 1\n cnt_list.append(cnt)\nprint(min(cnt_list))', 'S = input()\nT = input()\ncnt_list = []\n\nfor i in range(len(S)-len(T)+1):\n sub_S = S[i:i+len(T)]\n cnt = 0\n for j in range(len(T)):\n if sub_S[j] != T[j]:\n cnt += 1\n cnt_list.append(cnt)\nprint(min(cnt_list))']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s173243730', 's182117342', 's688915085', 's830353447', 's139552712']
[9072.0, 9072.0, 10716.0, 8988.0, 9004.0]
[28.0, 26.0, 77.0, 21.0, 65.0]
[192, 176, 227, 201, 215]
p02571
u751549333
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s, t = [input() for i in range(2)]\nans = float("inf")\nfor i in range(len(s) - len(t)+1):\n cnt = 0\n for j in range(len(t)):\n if s[i + j] != t[j]:\n cnt += 1\n print(s[i:i+len(t)], cnt)\n if ans > cnt:\n ans = cnt\nprint(ans) ', 's, t = [input() for i in range(2)]\nans = float("inf")\nfor i in range(len(s) - len(t)+1):\n cnt = 0\n for j in range(len(t)):\n if s[i + j] != t[j]:\n cnt += 1\n if ans > cnt:\n ans = cnt\nprint(ans) ']
['Wrong Answer', 'Accepted']
['s540512174', 's601688294']
[9000.0, 8844.0]
[60.0, 66.0]
[307, 273]
p02571
u758815106
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S = input()\nT = input()\n\ns = len(S)\nt = len(T)\n\nans = 10**9\n\nfor i in range(s - t + 1):\n tmp = 0\n for j in range(t):\n if S[i + j] != T[j]:\n tmp += 1\n\n print(S[i + j], T[j])\n\n ans = min(ans, tmp)\n\nprint(ans)', 'S = input()\nT = input()\n\ns = len(S)\nt = len(T)\n\nans = 10**9\n\nfor i in range(s - t + 1):\n tmp = 0\n for j in range(t):\n if S[i + j] != T[j]:\n tmp += 1\n\n ans = min(ans, tmp)\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s322050607', 's182481894']
[9172.0, 8988.0]
[197.0, 61.0]
[240, 209]
p02571
u766236264
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['minCount = 10000\ni = 0\nwhile i < len(s):\n countSame = 0\n j = 0\n while j < len(t) and i+j < len(s):\n if t[j] == s[i+j]:\n countSame += 1\n j += 1\n minCount = min(len(t) - countSame, minCount)\n i += 1\nprint(minCount)', 's = input()\nt = input()\nminCount = len(t)\ni = 0\nwhile i < len(s):\n countDiff = 0\n j = 0\n while j < len(t) and i+j < len(s):\n if t[j] != s[i+j]:\n countDiff += 1\n j += 1\n minCount = min(countDiff, minCount)\n i += 1\nprint(minCount)\n', 's = input()\nt = input()\nminCount = 100000000\ni = 0\nwhile i < len(s) and i + j < len(s):\n countSame = 0\n j = 0\n while j < len(t):\n if t[j] == s[i+j]:\n countSame += 1\n j += 1\n minCount = min(len(t) - countSame, minCount)\n i += 1\nprint(minCount)\n', 's = input()\nt = input()\nminCount = len(t)\ni = 0\nwhile i < len(s) and i + len(t) <= len(s):\n countSame = 0\n j = 0\n while j < len(t):\n if t[j] == s[i+j]:\n countSame += 1\n j += 1\n minCount = min(len(t) - countSame, minCount)\n i += 1\nprint(minCount)\n']
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s189223748', 's357023304', 's835936688', 's013079625']
[9112.0, 8968.0, 8980.0, 9068.0]
[26.0, 321.0, 30.0, 167.0]
[256, 273, 287, 290]
p02571
u766486294
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S = input()\nT = input()\n\nans = 1000\nfor i in range(len(S) - len(T) + 1):\n tmp = 0\n for j in range(len(T)):\n if S[i+j] != T[j]:\n tmp += 1\n ans = min(ans, tmp)\n print(i, ans)\n\nprint(ans)\n', 'S = input()\nT = input()\n\nans = 1000\nfor i in range(len(S) - len(T) + 1):\n tmp = 0\n for j in range(len(T)):\n if S[i+j] != T[j]:\n tmp += 1\n ans = min(ans, tmp)\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s779103137', 's313239042']
[9160.0, 9112.0]
[58.0, 59.0]
[215, 196]
p02571
u770293614
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S=input()\nT=input()\nlength=len(T)\nfor i in range(0,len(S)-len(T)+1):\n\tdiff=0\n\tfor i in range(0,len(T)):\n\t\tif T[i]!=S[s+i]:\n\t\t\tdiff+=1\n\tresult=min(ans,diff)\n\nprint(result)\n', 'S=input()\nT=input()\nlength=len(T)\nfor i in range(0,len(S)-len(T)+1):\n\tif S[i,i+length]==T:\n\t\tprint(0)', 'S=input()\nT=input()\nlength=len(T)\nfor s in range(0,len(S)-len(T)+1):\n\tdiff=0\n\tfor i in range(0,len(T)):\n\t\tif T[i]!=S[s+i]:\n\t\t\tdiff+=1\n\tresult=min(ans,diff)\n\nprint(result)\n', 'S=input()\nT=input()\nresult=len(T)\nfor s in range(0,len(S)-len(T)+1):\n\tdiff=0\n\tfor i in range(0,len(T)):\n\t\tif T[i]!=S[s+i]:\n\t\t\tdiff+=1\n\tresult=min(ans,diff)\n\nprint(result)\n', 'S=input()\nT=input()\nresult=len(T)\nfor s in range(0,len(S)-len(T)+1):\n\tdiff=0\n\tfor i in range(0,len(T)):\n\t\tif T[i]!=S[s+i]:\n\t\t\tdiff+=1\n\tresult=min(result,diff)\n\nprint(result)\n']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s378130018', 's641614332', 's653692795', 's762568712', 's870245126']
[9116.0, 8976.0, 8992.0, 9100.0, 9116.0]
[22.0, 26.0, 28.0, 24.0, 63.0]
[171, 101, 171, 171, 174]
p02571
u775097519
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S = str(input())\nT = str(input())\nlens = len(S)\nlent = len(T)\nans = []\n\nfor i in range(s-t + 1):\n count = 0\n U = S[i: i+t]\n for i in range(t):\n if U[j] != T[j]:\n count += 1\n ans.append(count)\nprint(min(ans))', 'S = str(input())\nT = str(input())\nlens = len(S)\nlent = len(T)\nans = []\n\nfor i in range(lens-lent + 1):\n count = 0\n U = S[i: i+lent]\n for j in range(lent):\n if U[j] != T[j]:\n count += 1\n ans.append(count)\nprint(min(ans))']
['Runtime Error', 'Accepted']
['s703016620', 's363722520']
[9040.0, 9020.0]
[28.0, 53.0]
[253, 265]
p02571
u779728630
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S = input()\nT = input()\nn = len(T)\n\ndef c(s, t):\n print(s)\n r = 0\n for i in range(n):\n if s[i] == t[i]:\n r += 1\n return n - r\n\nans = n\nfor i in range( len(S) - n + 1):\n temp = c(S[i:i+n],T)\n ans = min( ans, temp)\n\nprint(ans)', 'S = input()\nT = input()\nn = len(T)\n\ndef c(s, t):\n #print(s)\n r = 0\n for i in range(n):\n if s[i] == t[i]:\n r += 1\n return n - r\n\nans = n\nfor i in range( len(S) - n + 1):\n temp = c(S[i:i+n],T)\n ans = min( ans, temp)\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s637227976', 's198235614']
[9120.0, 9060.0]
[46.0, 54.0]
[238, 239]
p02571
u785618718
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S = input()\nT = input()\n\nmin = length(T)\n\nfor index in range( length(S)-length(T)+1 ):\n temp = 0\n for index2 in range(T):\n if T[index2] == S[index+index2]:\n temp += 1\n if temp < min:\n min = temp\n\nprint(min)', 'S = input()\nT = input()\n\nmin = len(T)\n\nfor index in range( len(S)-len(T)+1 ):\n temp = 0\n for index2 in range(len(T)):\n if T[index2] != S[index+index2]:\n temp += 1\n if temp < min:\n min = temp\n\nprint(min)']
['Runtime Error', 'Accepted']
['s926341840', 's585144721']
[9124.0, 8940.0]
[27.0, 56.0]
[220, 216]
p02571
u792720861
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s = input()\nt = input()\nans = 10**8\nfor i in range(len(s)):\n cnt = 0\n for j in range(len(t)):\n if s[i+j] != t[j]: cnt += 1\n ans = min(ans, cnt)\n\nprint(ans)\n', 's = input()\nt = input()\nans = 10**8\nfor i in range(len(s)-len(t)+1):\n cnt = 0\n for j in range(len(t)):\n if s[i+j] != t[j]: cnt += 1\n ans = min(ans, cnt)\n\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s849079464', 's053205533']
[8832.0, 9084.0]
[56.0, 60.0]
[172, 181]
p02571
u793225228
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
["def Qb():\n s = input()\n t = input()\n\n ans = len(t)\n for v in range(len(s) - len(t) + 1):\n a = [t[i] == x for i, x in enumerate(s[v:v + len(t) - v])]\n if a.count(False) < ans:\n ans = a.count(False)\n print(ans)\n\nif __name__ == '__main__':\n Qb()\n", "def Qb():\n s = input()\n t = input()\n\n ans = len(t)\n for v in range(len(s) - len(t) + 1):\n print(f'{v=}')\n a = [t[i] != x for i, x in enumerate(s[v:len(t)+v])]\n print(s[v:v + len(t) - v])\n print(a)\n print(s[v:len(t)+v])\n if sum(a) < ans:\n ans = sum(a)\n print(ans)\n\n\nif __name__ == '__main__':\n Qb()\n", "def Qb():\n s = input()\n t = input()\n\n ans = len(t)\n for v in range(len(s) - len(t) + 1):\n a = [t[i] != x for i, x in enumerate(s[v:len(t)+v])]\n if sum(a) < ans:\n ans = sum(a)\n print(ans)\n\n\nif __name__ == '__main__':\n Qb()\n"]
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s091163995', 's627246693', 's335843068']
[9128.0, 9072.0, 9036.0]
[36.0, 57.0, 46.0]
[286, 369, 265]
p02571
u798743259
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S = input()\nT = input()\ns = len(S)\nt = len(T)\n\ncount = 0\nmax = 0\n\nfor i in range(s-t):\n for j in range(t):\n if S[j] == T[j]:\n count += 1\n if count > max:\n max = count\n count = 0\n else:\n count = 0\n\nprint(t-max)', 'S = input()\nT = input()\ns = len(S)\nt = len(T)\n\ncount = 0\nmax = 0\n\nfor i in range(s-t+1):\n for j in range(t):\n if S[i+j] == T[j]:\n count += 1\n if count > max:\n max = count\n count = 0\n else:\n count = 0\n\nprint(t-max)']
['Wrong Answer', 'Accepted']
['s581063958', 's926621715']
[8988.0, 8924.0]
[76.0, 73.0]
[239, 233]
p02571
u802234211
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['vs = input()\nt = input()\n\nstri = []\nmincount = -1\nfor i in range(len(s)-len(t)+1):\n count = 0\n for j in range(len(t)):\n if(s[i+j] == t[j]):\n count+= 1\n mincount = max(mincount,count) \nprint(len(t) - mincount)', 's = input()\nt = input()\n\nstri = []\nmincount = -1\nfor i in range(len(s)-len(t)+1):\n count = 0\n for j in range(len(t)):\n if(s[i+j] == t[j]):\n count+= 1\n mincount = max(mincount,count) \nprint(len(t) - mincount)\n']
['Runtime Error', 'Accepted']
['s352539232', 's465530918']
[9104.0, 9076.0]
[27.0, 65.0]
[235, 235]
p02571
u806988802
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s = input()\nt = input()\n\ns_l = len(s)\nt_l = len(t)\n\nmax_count = 0\nfor i in range(0, s_l - t_l + 1):\n count = 0\n for j in range(0, t_l):\n print(i, j)\n if s[i+j] == t[j]:\n count += 1\n if count > max_count:\n max_count = count\n\ndiff = t_l - max_count\nprint(diff)\n', 's, t = input().split("\\n")\n\ns_l = len(s)\nt_l = len(t)\n\nmax_count = 0\nfor i in range(0, s_l - t_l):\n count = 0\n for j in range(0, t_l):\n if s[i+j] == t[j]:\n count += 1\n if count > max_count:\n max_count = count\n\ndiff = t_l - max_count\nprint(diff)', 's = input()\nt = input()\n\ns_l = len(s)\nt_l = len(t)\n\nmax_count = 0\nfor i in range(0, s_l - t_l + 1):\n count = 0\n for j in range(0, t_l):\n if s[i+j] == t[j]:\n count += 1\n if count > max_count:\n max_count = count\n\ndiff = t_l - max_count\nprint(diff)\n']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s656006917', 's809006403', 's895013074']
[9172.0, 9056.0, 9048.0]
[193.0, 22.0, 76.0]
[276, 258, 260]
p02571
u818213347
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['import numpy as np\ns = np.array(list(input()))\nt = np.array(list(input()))\ns_sub = np.array(list((s[i:i+len(t)] for i in range(len(s)-len(t)+1))))\nprint(s_sub)\nans = [0]*len(s_sub)\nfor i in range(len(s_sub)):\n ans[i] = np.count_nonzero(s_sub[i] == t)\nprint(len(t)-max(ans))', 'import numpy as np\ns = np.array(list(input()))\nt = np.array(list(input()))\ns_sub = np.array(list((s[i:i+len(t)] for i in range(len(s)-len(t)+1))))\nans = [0]*len(s_sub)\nfor i in range(len(s_sub)):\n ans[i] = np.count_nonzero(s_sub[i] == t)\nprint(len(t)-max(ans))\n']
['Wrong Answer', 'Accepted']
['s039294469', 's212537926']
[27288.0, 27392.0]
[126.0, 123.0]
[276, 264]
p02571
u822044226
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S = input()\nT = input()\n\nz = len(S)-len(T)\n\nres = []\ncnt = 0\nif z == 0:\n for a,b in zip(S,T):\n if a != b:\n cnt += 1\nprint(cnt);exit()\n \nfor i in range(z):\n s = S[i:i+len(T)]\n cnt = 0\n for j,k in zip(s,T):\n if j != k:\n cnt += 1\n res.append(cnt)\n\nprint(min(res))', 'S = input()\nT = input()\n\nz = len(S)-len(T)\n\nres = []\ncnt = 0\nif z == 0:\n for a,b in zip(S,T):\n if a != b:\n cnt += 1\n print(cnt)\n exit();\nelse:\n for i in range(z):\n s = S[i:i+len(T)]\n cnt = 0\n for j,k in zip(s,T):\n if j != k:\n cnt += 1\n res.append(cnt)\n print(min(res))\n']
['Wrong Answer', 'Accepted']
['s822746421', 's888018271']
[9068.0, 9064.0]
[29.0, 47.0]
[284, 306]
p02571
u825161822
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['a=str(input())\nb=str(input())\nans=0\nc=[]\nl=0\nfor x in range(len(a)-len(b)+1):\n ans=0\n for i in range(len(b)):\n if a[i+l]!=b[i]:\n ans+=1\n l+=1\n c.append(ans)\nprint(c)\nprint(min(c))', 'a=str(input())\nb=str(input())\nans=0\nc=[]\nl=0\nfor x in range(len(a)-len(b)+1):\n ans=0\n for i in range(len(b)):\n if a[i+l]!=b[i]:\n ans+=1\n l+=1\n c.append(ans)\nprint(min(c))']
['Wrong Answer', 'Accepted']
['s940357583', 's624772124']
[9064.0, 9004.0]
[61.0, 60.0]
[207, 198]
p02571
u829203929
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['# coding: utf-8\n\ndef main():\n s = input()\n t = input()\n\n ans = len(t)\n \n for i in range(len(s) - len(t) + 1):\n a = s[i:i+len(t)]\n print(a, t)\n ans_list = [1 for x, y in zip(a, t) if x!=y]\n tmp_ans = sum(ans_list)\n ans = min(ans, tmp_ans)\n \n if ans == 0:\n break\n \n print(ans)\n \n \n\nmain()', '# coding: utf-8\n\ndef main():\n s = input()\n t = input()\n\n ans = len(t)\n \n for i in range(len(s) - len(t)):\n a = s[i:i+len(t)]\n print(a, t)\n ans_list = [1 for x, y in zip(a, t) if x!=y]\n tmp_ans = sum(ans_list)\n ans = min(ans, tmp_ans)\n \n if ans == 0:\n break\n \n print(ans)\n \n \n\nmain()', '# coding: utf-8\n\ndef main():\n s = input()\n t = input()\n\n ans = len(t)\n \n for i in range(len(s) - len(t) + 1):\n a = s[i:i+len(t)]\n # print(a, t)\n ans_list = [1 for x, y in zip(a, t) if x!=y]\n tmp_ans = sum(ans_list)\n ans = min(ans, tmp_ans)\n \n if ans == 0:\n break\n \n print(ans)\n \n \n\nmain()']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s374642344', 's385611576', 's155708315']
[9100.0, 9092.0, 8960.0]
[43.0, 42.0, 36.0]
[381, 377, 383]
p02571
u836695640
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s = input()\nt = input()\nN = len(t)\ncount = 0\nfor i in range(N):\n if t[i] in s[i]:\n count += 1\n\nprint(count)', 's = input()\nt = input()\nN = len(t)\ncount = 0\nfor i in range(N):\n if t[i] != s[i]:\n count += 1\n\nprint(count)', 's = input()\nt = input()\nres = 0\nfor i in range(len(s)-len(t)+1):\n cnt = 0\n for j in range(len(t)):\n if s[i+j] == t[j]:\n cnt += 1\n res = max(cnt, res)\n \nprint(len(t)-res)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s046351797', 's106981979', 's585107629']
[8892.0, 9000.0, 9016.0]
[30.0, 31.0, 74.0]
[111, 111, 181]
p02571
u842901156
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s = input().split()\nS = s[0]\nT = s[1]\n\nscore = []\nfor i in range(len(S)-len(T)):\n U = s[i: i+len(T)]\n cnt = 0\n for j in range(T):\n if U[j] != T[j]:\n cnt = cnt + 1\n score.append(cnt)\nprint(min(score))\n\n', 'S = input()\nT = input()\n\nscore = []\nfor i in range(len(S)-len(T)+1):\n U = S[i: i+len(T)]\n cnt = 0\n for j in range(len(T)):\n if U[j] != T[j]:\n cnt = cnt + 1\n score.append(cnt)\nprint(min(score))\n\n', 'S = input()\nT = input()\n\nscore = []\nfor i in range(len(S)-len(T)+1):\n U = S[i: i+len(T)]\n cnt = 0\n for j in range(len(T)):\n if U[j] != T[j]:\n cnt = cnt + 1\n score.append(cnt)\nprint(min(score))']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s159032955', 's889594199', 's752993700']
[9116.0, 12004.0, 9044.0]
[29.0, 73.0, 56.0]
[235, 228, 222]
p02571
u844789719
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
["S = input()\nT = input()\nans=float('inf')\nfor start in range(len(S) - len(T)):\n ans = min(ans, sum(s != t for s, t in zip(S, T)))\nprint(ans)\n", "S = input()\nT = input()\nans = float('inf')\nfor start in range(len(S) - len(T) + 1):\n ans = min(ans, sum(s != t for s, t in zip(S[start:], T)))\nprint(ans)\n"]
['Wrong Answer', 'Accepted']
['s804845328', 's529570805']
[8992.0, 8964.0]
[44.0, 41.0]
[143, 157]
p02571
u849559474
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s = input()\nt = input()\nls = len(s)\nlt = len(t)\nmax_count = 0\nfor i in range(ls-lt+1):\n count = 0\n for j in range(lt):\n if s[i:i+lt][j] == t[j]:\n count += 1\n if max_count < count:\n max_count = count\nprint(max_count)', 's = input()\nt = input()\nls = len(s)\nlt = len(t)\nmax_count = 0\nfor i in range(ls-lt+1):\n count = 0\n for j in range(lt):\n if s[i:i+lt][j] != t[j]:\n count += 1\n if max_count < count:\n max_count = count\nprint(max_count)', 's = input()\nt = input()\nls = len(s)\nlt = len(t)\nmin_count = 1000\nfor i in range(ls-lt+1):\n count = 0\n for j in range(lt):\n if s[i:i+lt][j] != t[j]:\n count += 1\n if min_count > count:\n min_count = count\nprint(min_count)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s781185294', 's918585674', 's268270230']
[9024.0, 8816.0, 8900.0]
[97.0, 87.0, 86.0]
[229, 229, 233]
p02571
u853728588
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s = input()\nt = input()\n\nans = 10000\nfor i in range(len(s) - len(t) + 1):\n tmp = 0\n for i in range(len(t)):\n if s[i + j] != s[j]:\n tmp+=1\n ans = min(ans, tmp)\nprint(ans)', 's = input()\nt = input()\n \nans = 10000\nfor i in range(len(s) - len(t) + 1):\n tmp = 0\n for j in range(len(t)):\n if s[i + j] != t[j]:\n tmp+=1\n ans = min(ans, tmp)\nprint(ans)']
['Runtime Error', 'Accepted']
['s464377359', 's092022067']
[9064.0, 9112.0]
[26.0, 62.0]
[182, 181]
p02571
u856636328
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s1 = input()\ns2 = input()\na = len(s2)\nm = 10**18\nfor x in range(len(s1)-a+1):\n s3 = s1[x:x+a]\n print(s3)\n s = 0\n for y in range(a):\n if s3[y]!=s2[y]:\n s+=1\n m = min(m,s)\nprint(m)\n', 's1 = input()\ns2 = input()\na = len(s2)\nm = 10**18\nfor x in range(len(s1)-a+1):\n s3 = s1[x:x+a]\n s = 0\n for y in range(a):\n if s3[y]!=s2[y]:\n s+=1\n m = min(m,s)\nprint(m)\n']
['Wrong Answer', 'Accepted']
['s130268150', 's194544052']
[8968.0, 9112.0]
[55.0, 59.0]
[192, 180]
p02571
u857673087
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S = input()\nT = input()\n\nfor i in range(len(T)):\n if i == 0:\n if T[:len(T)-i] in S:\n print(0)\n else:\n if T[:len(T)-i] in S and S[len(T)-i+1] != T[:len(T)-i]:\n print(i)', 'S = input()\nT = input()\n\nans = len(T)\n\nfor i in range(len(S)-len(T)+1):\n tmp = len(T)\n for j in range(len(T)):\n if T[j] == S[i+j]:\n tmp -= 1\n ans = min(ans,tmp)\nprint(ans)']
['Runtime Error', 'Accepted']
['s668588434', 's337100552']
[9028.0, 9104.0]
[29.0, 113.0]
[185, 186]
p02571
u864069774
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s = list(input())\nt = list(input())\nm = len(t)\nfor i in range(len(s)-len(t)+1):\n c = 0\n target = s[i:i+len(t)]\n print(target)\n for j in range(len(t)):\n print(target[j],t[j])\n if not target[j] == t[j]:\n c += 1\n print(m,c)\n if c < m :\n m = c\nprint(m)', 's = list(input())\nt = list(input())\nm = len(t)\nfor i in range(len(s)-len(t)+1):\n c = 0\n target = s[i:i+len(t)]\n # print(target)\n for j in range(len(t)):\n # print(target[j],t[j])\n if not target[j] == t[j]:\n c += 1\n # print(m,c)\n if c < m :\n m = c\nprint(m)']
['Wrong Answer', 'Accepted']
['s910944966', 's257795101']
[9228.0, 9092.0]
[186.0, 62.0]
[298, 304]
p02571
u864090097
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S = input()\nT = input()\n\nans = 0\nl = len(T)\nfor m in range (len(S)-l):\n diff = 0\n for i in range (l):\n if S[m+i] != T[i]:\n diff+=1\n ans = min(ans, diff)\n\nprint(ans)', 'S = input()\nT = input()\n\nans = 0\nl = len(T)\nfor m in range (len(S)-l):\n diff = 0\n for i in range (l):\n if S[m+i] != T[i]:\n diff+=1\n ans = max(ans, diff)\n\nprint(ans)', 'S = input()\nT = input()\n\nans = len(T)\nl = len(T)\nfor m in range (len(S)-l+1):\n diff = 0\n for i in range (l):\n if S[m+i] != T[i]:\n diff+=1\n ans = min(ans, diff)\n\nprint(ans)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s611559105', 's780874841', 's197508980']
[8984.0, 8980.0, 9048.0]
[62.0, 57.0, 62.0]
[191, 191, 198]
p02571
u865128578
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s = input()\nt = input()\nans = len(t)\n\nfor i in range(len(s)):\n if (i + len(t) - 1 >= len(s)): break\n dif = 0\n for j in range(len(t)):\n print(s[i + j])\n if (s[i + j] != t[j]):\n dif += 1\n ans = min(ans, dif)\nprint(ans)', 's = input()\nt = input()\nans = len(t)\n \nfor i in range(len(s)):\n if (i + len(t) > len(s)): break\n dif = 0\n for j in range(len(t)):\n if (s[i + j] != t[j]):\n dif += 1\n ans = min(ans, dif)\nprint(ans)']
['Wrong Answer', 'Accepted']
['s016131383', 's316519821']
[9120.0, 9040.0]
[130.0, 63.0]
[231, 207]
p02571
u865343871
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s = input()\nt = input()\nlist = []\n\nfor i in range(len(s)-len(t)+1):\n n=0\n for j in range(len(t)):\n if s[i] == t[j]:\n n+=1\n list.append(n)\nprint(len(t)-max(list))\n', 's = input()\nt = input()\nlist = []\n\nfor i in range(len(s)-len(t)+1):\n n=0\n for j in range(len(t)):\n if s[i] != t[j]:\n n+=1\n list.append(n)\nprint(min(list))\n', 's = input()\nt = input()\nlist = []\n\nfor i in range(len(s)-len(t)):\n n=0\n for j in range(len(t)):\n if s[i] == t[j]:\n n+=1\n list.append(n)\nprint(len(t)-max(list))\n', 's = input()\nt = input()\nlist = []\n\nfor i in range(len(s)-len(t)+1):\n n=0\n for j in range(len(t)):\n if s[j] == t[j]:\n n+=1\n list.append(n)\nprint(len(t)-max(list))\n\n', 's = input()\nt = input()\nlist = []\n\nfor i in range(len(s)-len(t)+1):\n n=0\n for j in range(len(t)):\n if s[i] == t[j]:\n n+=1\n list.append(n)\nprint(len(t)-max(list))\n', 's = input()\nt = input()\nlist = []\n\nfor i in range(len(s)-len(t)+1):\n n=0\n for j in range(len(t)-1):\n if s[i] == t[j]:\n n+=1\n list.append(n)\nprint(len(t)-max(list))\n', 's = input()\nt = input()\nlist = []\n\nfor i in range(len(s)-len(t)+1):\n n=0\n U = s[i:i + len(t)]\n for j in range(len(t)):\n if U[j] != t[j]:\n n+=1\n list.append(n)\nprint(min(list))\n']
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s150746452', 's576974329', 's731393949', 's780524367', 's792963927', 's999852090', 's059355025']
[8748.0, 8972.0, 9096.0, 9000.0, 9028.0, 9060.0, 9004.0]
[66.0, 55.0, 60.0, 64.0, 65.0, 67.0, 55.0]
[189, 182, 187, 190, 189, 191, 206]
p02571
u868907609
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
["import numpy as np\nimport sys\n\nS = input()\nT = input()\n\ncounter = 0\nmax_counter = 0\n\nfor i in range(len(S) - len(T) + 1):\n for j in range(len(T)):\n if S[j+i] == T[j]:\n counter = counter + 1\n if counter > max_counter:\n max_counter = counter\n print(counter)\n print('max = ' + str(max_counter))\n counter = 0\n\nprint(int(len(T)) - int(max_counter))", 'import numpy as np\nimport sys\n\nS = input()\nT = input()\n\ncounter = 0\nmax_counter = 0\n\nfor i in range(len(S) - len(T) + 1):\n for j in range(len(T)):\n if S[j+i] == T[j]:\n counter = counter + 1\n if counter > max_counter:\n max_counter = counter\n counter = 0\n\nprint(int(len(T)) - int(max_counter))', "import numpy as np\nimport sys\n\nS = input()\nT = input()\n\ncounter = 0\nmax_counter = 0\n\nfor i in range(len(S) - len(T) + 1):\n for j in range(len(T)):\n if S[j+i] == T[j]:\n counter = counter + 1\n if counter > max_counter:\n max_counter = counter\n # print(counter)\n # print('max = ' + str(max_counter))\n counter = 0\n\nprint(int(len(T)) - int(max_counter))"]
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s061062319', 's132471034', 's783056638']
[27076.0, 26932.0, 26956.0]
[160.0, 176.0, 153.0]
[383, 329, 387]
p02571
u869594594
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S=input()\nT=input()\ns=len(S)\nt=len(T)\nmax_count=0\ncount=0\nfor i in range(s-t+1):\n for j in range(t):\n if T[i]==S[j+i]:\n count += 1\n max_count=max(max_count,count)\n count=0 \nprint(t-max_count)', 'S=input()\nT=input()\ns=len(S)\nt=len(T)\nmax_count=0\n\nfor i in range(s-t+1):\n count=0\n for j in range(t):\n if T[i]==S[j+i]:\n count += 1\n max_count=max(max_count,count)\n \nprint(t-max_count)', 'S=input()\nT=input()\ns=len(S)\nt=len(T)\nmax_count=0\ncount=0\nfor i in range(s-t+1):\n for j in range(t):\n if T[j]==S[i+j]:\n count += 1\n max_count=max(max_count,count)\n count=0 \nprint(t-max_count)']
['Runtime Error', 'Runtime Error', 'Accepted']
['s003307655', 's706187648', 's752252748']
[8860.0, 9096.0, 9040.0]
[66.0, 75.0, 71.0]
[203, 199, 203]
p02571
u879309973
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['def solve(s, t):\n n = len(s)\n m = len(t)\n best = m\n for i in range(m-n+1):\n num = 0\n for j in range(n):\n if s[j] == t[i+j]:\n num += 1\n best = min(best, num)\n return best\n \ns = input()\nt = input()\nprint(solve(s, t))', 'def solve(s, t):\n n = len(s)\n m = len(t)\n best = m\n for i in range(n-m+1):\n num = 0\n for j in range(m):\n if s[i+j] != t[j]:\n num += 1\n best = min(best, num)\n return best\n\ns = input()\nt = input()\nprint(solve(s, t))\n']
['Wrong Answer', 'Accepted']
['s321310325', 's582509102']
[8900.0, 9040.0]
[26.0, 46.0]
[279, 276]
p02571
u882514852
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S = input()\nT = input()\nt = len(T)\nfor i in range(len(T)):\n a = 0\n b = 0\n for s in range(len(T)):\n if T[s:s+i+1] in S[s:len(S)-s]:\n b += 1\n print(s,b,T[s:s+i+1],S[s:len(S)-s])\n if b == 0:\n break\nprint(t-i)', 'S = input()\nT = input()\nans = 0\nfor i in range(len(S) - len(T) + 1):\n a = 0\n for s in range(len(T)):\n if T[s] == S[i+s]:\n a += 1\n if a > ans:\n ans = a\nprint(ans)', 'S = input()\nT = input()\nans = 1001\nfor i in range(len(S) - len(T) + 1):\n a = 0\n for s in range(len(T)):\n if T[s] != S[i+s]:\n a += 1\n if a < ans:\n ans = a\nprint(ans)']
['Runtime Error', 'Wrong Answer', 'Accepted']
['s686274396', 's734062007', 's115665560']
[137896.0, 9072.0, 9120.0]
[960.0, 73.0, 63.0]
[223, 175, 178]
p02571
u892797057
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
["S = input()\nT = input()\n\nmin_count = len(T)\nfor s in range(len(S) - len(T) + 1): # T cannot exceed the length of S\n matched = 0\n for i in range(len(T)):\n print(f'S[{s + i}] == T[{i}]')\n if S[s + i] == T[i]:\n matched += 1\n count = len(T) - matched\n if count < min_count:\n min_count = count\nprint(min_count)", "S = input()\nT = input()\n\nmin_count = len(T)\nfor s in range(len(S) - len(T) + 1): # T cannot exceed the length of S\n matched = 0\n for i in range(len(T)):\n # print(f'S[{s + i}] == T[{i}]')\n if S[s + i] == T[i]:\n matched += 1\n count = len(T) - matched\n if count < min_count:\n min_count = count\nprint(min_count)"]
['Wrong Answer', 'Accepted']
['s194221358', 's133660902']
[9056.0, 9088.0]
[193.0, 68.0]
[350, 352]
p02571
u894521144
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
["\ndef main():\n S = input()\n T = input()\n \n\n st = {}\n for i in range(len(S)-len(T)+1):\n cnt = 0\n for s, t in zip(S[i:i+len(T)], T):\n cnt += s == t\n st.add(cnt)\n print(len(T) - max(st))\n\n\nif __name__ == '__main__':\n main()", "def main():\n S = input()\n T = input()\n \n\n st = set()\n for i in range(len(S)-len(T)+1):\n cnt = 0\n for s, t in zip(S[i:i+len(T)], T):\n cnt += s == t\n st.add(cnt)\n print(len(T) - max(st))\n\n\nif __name__ == '__main__':\n main()"]
['Runtime Error', 'Accepted']
['s236788010', 's969057419']
[9068.0, 9064.0]
[23.0, 44.0]
[358, 360]
p02571
u902426510
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s = input()\nt = input()\nif t in s:\n print(0)\nelse:\n ans = len(t)\n for i in range(len(s)):\n cnt = 0\n for j in range(len(t)):\n if s[i] != t[j]:\n cnt += 1\n ans = min(ans, cnt)\n print(ans) \n', 's = input()\nt = input()\nif t in s:\n print(0)\nelse:\n ans = 1000\n for i in range(len(t)):\n for j in range(len(s)):\n if t[i] == s[j]:\n k = i\n l = j\n while k < len(t):\n if t[k] != s[l]:\n break\n k += 1\n l += 1\n ans = min(ans, len(t) - k)\n\nprint(ans) ', 's = input()\nt = input()\nif t in s:\n print(0)\nelse:\n ans = len(t)\n for i in range(len(t)):\n for j in range(len(s)):\n if t[i] == s[j]:\n if ((len(t) - i) <= (len(s) - j)) and i <= j:\n k = i + 1\n l = j + 1\n cnt1 = 0\n while k < len(t):\n if t[k] != s[l]:\n cnt1 += 1\n k += 1\n l += 1\n k = i - 1\n l = j - 1\n cnt2 = 0\n while k >= 0:\n if t[k] != s[l]:\n cnt2 += 1\n k -= 1\n l -= 1\n ans = min(ans, cnt1 + cnt2) \n else:\n if (len(t) - i) > (len(s) - j)):\n break\n \n print(ans)\n', 's = input()\nt = input()\nif t in s:\n print(0)\nelse:\n ans = 1000\n for i in range(len(t)):\n for j in range(len(s)):\n if t[i] == s[j]:\n if len(t) - i >= len(s) - j and i <= j:\n \tk = i\n \tl = j\n cnt1 = 0\n while k < len(t):\n \tif t[k] != s[l]:\n cnt1 += 1\n k += 1\n l += 1\n k = i\n \tl = j\n cnt2 = 0\n while k >= 0:\n \tif t[k] != s[l]:\n cnt2 += 1\n k -= 1\n l -= 1\n ans = min(ans, cnt1 + cnt2) \n else:\n break\nprint(ans) ', 's = input()\nt = input()\nif t in s:\n print(0)\nelse:\n ans = len(t)\n for i in range(len(s) - len(t) + 1):\n cnt = 0\n k = i\n l = 0\n while l < len(t) and k < len(s):\n if s[k] != t[l]:\n cnt += 1 \n k += 1\n l += 1 \n ans = min(ans, cnt)\n print(ans) \n']
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s182127653', 's196432477', 's261103479', 's632407126', 's817226838']
[8984.0, 9072.0, 8984.0, 8900.0, 8928.0]
[188.0, 138.0, 25.0, 28.0, 125.0]
[230, 329, 934, 653, 339]
p02571
u904811150
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
["import re\n\nS = input()\nT = input()\n\nstart = time.time()\n\nans_list = []\n\na = '.'*len(T)\n\nfor i in range(len(T)):\n if i == 0:\n b = T[i] + a[i+1:]\n elif i == len(T)-1:\n b = a[:i] + T[i]\n else:\n b = a[:i] + T[i] + a[i+1:]\n s = re.findall(b, S)\n \n if len(s) >= 1:\n for j in range(len(s)):\n c = list(s[j])\n d = list(T)\n ans = 0\n for k in range(len(c)):\n if c[k] == d[k]:\n ans += 1\n ans_list.append(ans)\n else:\n pass\n\nprint(len(T) - max(ans_list))", 'S = input()\nT = input()\n\nans = len(T)\n\nfor i in range(len(S) - len(T)):\n diff = 0\n for j in range(len(T)):\n if S[i+j] != T[j]:\n diff += 1\nprint(min(ans, diff))', 'S = input()\nT = input()\n\nans = len(T)\n\nl_diff = []\n\nfor i in range(len(S) - len(T) + 1):\n print(S[i])\n diff = 0\n for j in range(len(T)):\n if S[i+j] != T[j]:\n diff += 1\n l_diff.append(diff)\n ans = min(ans, diff)\n \nprint(ans)', 'S = input()\nT = input()\n\nans = len(T)\n\nfor i in range(len(S) - len(T) + 1):\n diff = 0\n for j in range(len(T)):\n if S[i+j] != T[j]:\n diff += 1\n l_diff.append(diff)\n ans = min(ans, diff)\n \nprint(ans)', 'S = input()\nT = input()\n\nans = len(T)\n\nfor i in range(len(S) - len(T) + 1):\n diff = 0\n for j in range(len(T)):\n if S[i+j] != T[j]:\n diff += 1\n ans = min(ans, diff)\n \nprint(ans)']
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s079724737', 's513553826', 's613414222', 's858523788', 's914275341']
[9688.0, 8968.0, 12000.0, 9000.0, 9016.0]
[36.0, 57.0, 72.0, 22.0, 54.0]
[585, 183, 263, 234, 206]
p02571
u906501980
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['from numba import njit\n\ndef dis(a, b):\n d = 0\n for ai, bi in zip(a, b):\n if ai == bi:\n continue\n d += 1\n return d\n\n@njit\ndef main():\n s = list(input())\n t = list(input())\n lt = len(t)\n ls = len(s)\n ans = 1000\n\n for i in prange(ls-lt+1):\n ans = min(ans, dis(s[i:i+lt], t))\n \n print(ans)\n \n \n\nif __name__ == "__main__":\n main()\n', 'from numba import njit\n\ndef dis(a, b):\n d = 0\n for ai, bi in zip(a, b):\n if ai == bi:\n continue\n d += 1\n return d\n\n@njit\ndef main():\n s = list(input())\n t = list(input())\n lt = len(t)\n ls = len(s)\n ans = 1000\n\n for i in prange(ls-lt+1):\n ans = 1\n \n print(ans)\n \n \n\nif __name__ == "__main__":\n main()\n', 'from numba import njit\n\n@njit(cache = True)\ndef dis(a, b):\n d = 0\n for ai, bi in zip(a, b):\n if ai == bi:\n continue\n d += 1\n return d\n\n@njit\ndef main():\n s = list(input())\n t = list(input())\n lt = len(t)\n ls = len(s)\n ans = 1000\n\n for i in prange(ls-lt+1):\n ans = min(ans, dis(s[i:i+lt], t))\n \n print(ans)\n \n \n\nif __name__ == "__main__":\n main()\n', 'from numba import njit\n\n\n@njit\ndef main():\n ans = 1000\n\n for i in [1, 2, 3]:\n ans += 1\n \n print(ans)\n \ns = input()\nt = input() \nmain()\n', 'from numba import njit\n\n\n@njit\ndef main():\n s = input()\n t = input()\n ans = 1000\n\n for i in [1, 2, 3]:\n ans += 1\n \n print(ans)\n \n \nmain()\n', 'def main():\n s = list(input())\n t = list(input())\n lt = len(t)\n ls = len(s)\n ans = 1000\n \n \n def dis(a, b):\n d = 0\n for ai, bi in zip(a, b):\n if ai == bi:\n continue\n d += 1\n return d\n \n for i in range(ls-lt+1):\n ans = min(ans, dis(s[i:i+lt], t))\n \n print(ans)\n \n \n\nif __name__ == "__main__":\n main()']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s022549111', 's397217269', 's482806268', 's607039341', 's941551769', 's631954569']
[106148.0, 106356.0, 106356.0, 108456.0, 106212.0, 9088.0]
[462.0, 484.0, 486.0, 516.0, 453.0, 42.0]
[390, 364, 410, 164, 173, 413]
p02571
u910632349
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['s=input()\nt=input()\ncount=0\nif len(s)==len(t):\n for i in range(len(t)):\n if t[i]!=s[i]:\n count+=1\n print(count)\n exit()\nans=10000\nfor i in range(len(s)-len(t)+1):\n for j in range(len(t)):\n print(t[j],s[i+j])\n if t[j]!=s[i+j]:\n count+=1\n ans=min(ans,count)\n count=0\nprint(ans)', 's=input()\nt=input()\ncount=0\nif len(s)==len(t):\n for i in range(len(t)):\n if t[i]!=s[i]:\n count+=1\n print(count)\n exit()\nans=10000\nfor i in range(len(s)-len(t)+1):\n for j in range(len(t)):\n if t[j]!=s[i+j]:\n count+=1\n ans=min(ans,count)\n count=0\nprint(ans)']
['Wrong Answer', 'Accepted']
['s595791642', 's663197112']
[9104.0, 9076.0]
[189.0, 65.0]
[336, 309]
p02571
u917558625
2,000
1,048,576
Given are two strings S and T. Let us change some of the characters in S so that T will be a substring of S. At least how many characters do we need to change? Here, a substring is a consecutive subsequence. For example, `xxx` is a substring of `yxxxy`, but not a substring of `xxyxx`.
['S=input()\nT=input()\nans=10**5\nfor i in range(len(S)-len(T)):\n a=0\n for j in range(len(T)):\n if S[i+j]==T[j]:\n a+=1\n ans=min(ans,a)\nprint(ans)', 'S=input()\nT=input()\nans=10**5\nfor i in range(len(S)-len(T)+1):\n a=0\n for j in range(len(T)):\n if S[i+j]==T[j]:\n a+=1\n ans=min(ans,len(T)-a)\nprint(ans)']
['Wrong Answer', 'Accepted']
['s283633213', 's371414273']
[8952.0, 9036.0]
[70.0, 72.0]
[152, 161]