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
|
---|---|---|---|---|---|---|---|---|---|---|
p02570 | u964904181 | 2,000 | 1,048,576 | Takahashi is meeting up with Aoki. They have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now. Takahashi will leave his house now and go straight to the place at a speed of S meters per minute. Will he arrive in time? | ['D, T, S = map(int, input().split())\n\nprint("YES" if S * T >= D else "NO")\n\n\n\n', 'D, T, S = map(int, input().split())\n\nprint("Yes" if S * T >= D else "No")\n\n\n\n'] | ['Wrong Answer', 'Accepted'] | ['s817943851', 's278096021'] | [8972.0, 9028.0] | [30.0, 29.0] | [77, 77] |
p02570 | u965397031 | 2,000 | 1,048,576 | Takahashi is meeting up with Aoki. They have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now. Takahashi will leave his house now and go straight to the place at a speed of S meters per minute. Will he arrive in time? | ['d, t, s = map(int, input().split())\nif s * d => t\n print(Yes)\nelse:\n print(No) \n', 'd, t, s = map(int, input().split())\nif s * t => d\n print(Yes)\nelse:\n print(No) \n', 'd, t, s = map(int, input().split( ))\nif d/s <= t:\n print(Yes)\nelse:\n print(No) \n', 'd, t, s = map(int, input().split())\nif d/s <= t:\n print(Yes)\nelse:\n print(No) \n', "d, t, s = map(int, input().split( ))\nif d/s <= t:\n print('Yes')\nelse:\n print('No') \n"] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s122732402', 's383542508', 's899793668', 's916616771', 's024427070'] | [8908.0, 8944.0, 9096.0, 9072.0, 9092.0] | [25.0, 24.0, 26.0, 29.0, 26.0] | [86, 86, 86, 85, 90] |
p02570 | u966322470 | 2,000 | 1,048,576 | Takahashi is meeting up with Aoki. They have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now. Takahashi will leave his house now and go straight to the place at a speed of S meters per minute. Will he arrive in time? | ['d,t,s=input().split()\nif d/s<t :\n print("Yes")\nelse:\n print("No")', 'd,t,s=map(int,input().split())\nif d/s<=t :\n print("Yes")\nelse:\n print("No")'] | ['Runtime Error', 'Accepted'] | ['s571050962', 's731206430'] | [9092.0, 9104.0] | [25.0, 32.0] | [71, 81] |
p02570 | u968762428 | 2,000 | 1,048,576 | Takahashi is meeting up with Aoki. They have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now. Takahashi will leave his house now and go straight to the place at a speed of S meters per minute. Will he arrive in time? | ['D,T,S = map(int , input().split().split())\n\nif D > S * T:\n print("no")\n \nelse:\n print("yes")', 'a,b,c = (int(x) for x in input().split())\n\nif a > b * c:\n print("No")\n \nelse:\n print("Yes")'] | ['Runtime Error', 'Accepted'] | ['s925873922', 's613851194'] | [8796.0, 9024.0] | [27.0, 30.0] | [95, 94] |
p02570 | u969708690 | 2,000 | 1,048,576 | Takahashi is meeting up with Aoki. They have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now. Takahashi will leave his house now and go straight to the place at a speed of S meters per minute. Will he arrive in time? | ['import sys\nimport math\nsys.setrecursionlimit(10 ** 7)\ndef input() : return sys.stdin.readline().strip()\ndef INT() : return int(input())\ndef MAP() : return map(int,input().split())\ndef LIST() : return list(MAP())\ndef NIJIGEN(H): return [list(input()) for i in range(H)]\nD,T,S=MAP()\nif T*S<=D:\n print("Yes")\nelse:\n print("No")', 'import sys\nimport math\nsys.setrecursionlimit(10 ** 7)\ndef input() : return sys.stdin.readline().strip()\ndef INT() : return int(input())\ndef MAP() : return map(int,input().split())\ndef LIST() : return list(MAP())\ndef NIJIGEN(H): return [list(input()) for i in range(H)]\nD,T,S=MAP()\nif T*S>=D:\n print("Yes")\nelse:\n print("No")'] | ['Wrong Answer', 'Accepted'] | ['s533369342', 's610588770'] | [9184.0, 9184.0] | [30.0, 31.0] | [331, 331] |
p02570 | u970348538 | 2,000 | 1,048,576 | Takahashi is meeting up with Aoki. They have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now. Takahashi will leave his house now and go straight to the place at a speed of S meters per minute. Will he arrive in time? | ['2000 20 100', "d, t, s = [list(map(int, s.split())) for s in open(0)][0]\nif t >= d/s:\n print('Yes')\nelse:\n print('No')"] | ['Runtime Error', 'Accepted'] | ['s530227212', 's067790504'] | [9068.0, 9168.0] | [26.0, 31.0] | [11, 109] |
p02570 | u972809050 | 2,000 | 1,048,576 | Takahashi is meeting up with Aoki. They have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now. Takahashi will leave his house now and go straight to the place at a speed of S meters per minute. Will he arrive in time? | ['D,T,S=int(input())\nif 1<=D<=10000 and 1<=T<=10000 and 1<=S<=10000:\n if (D/S)>T:\n print("He will be late")\n else:\n print("Yes")', 'D,T,S=map(int,input().split())\nif 1<=D<=10000 and 1<=T<=10000 and 1<=S<=10000:\n if (D/S)>T:\n print("No")\n else:\n print("Yes")'] | ['Runtime Error', 'Accepted'] | ['s319999313', 's191576367'] | [9148.0, 9108.0] | [27.0, 29.0] | [134, 133] |
p02570 | u973069173 | 2,000 | 1,048,576 | Takahashi is meeting up with Aoki. They have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now. Takahashi will leave his house now and go straight to the place at a speed of S meters per minute. Will he arrive in time? | ['d,t,s = int(input().split())\nif d/s <= t: \n print("Yes")\nelse:\n print("No") ', 'd,t,s = input().split()\nif d/s <= t: \n print("Yes")\nelse:\n print("No") ', 'd,t,s = input().split()\nif int(d)/int(s) <= int(t): \n print("Yes")\nelse:\n print("No") '] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s254703111', 's461980831', 's063819458'] | [9004.0, 9060.0, 9144.0] | [25.0, 27.0, 25.0] | [82, 77, 92] |
p02570 | u976065447 | 2,000 | 1,048,576 | Takahashi is meeting up with Aoki. They have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now. Takahashi will leave his house now and go straight to the place at a speed of S meters per minute. Will he arrive in time? | ['d,t,s = map(int,input().split())\n\nprint("Yes" if s*t >= d else "No)', 'd,t,s = map(int,input().split())\nif s*t >= d:\n print("Yes")\nelse:\n print("No")\n'] | ['Runtime Error', 'Accepted'] | ['s580254534', 's375925340'] | [8940.0, 9024.0] | [23.0, 30.0] | [67, 85] |
p02570 | u984149748 | 2,000 | 1,048,576 | Takahashi is meeting up with Aoki. They have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now. Takahashi will leave his house now and go straight to the place at a speed of S meters per minute. Will he arrive in time? | ["D,T,S=[int(input()) for i in range(3)]\nif D/S<=T:\n print('Yes')\nelse:\n print('No')\n", "D,T,S= map(int, input().split())\nif D/S<=T:\n print('Yes')\nelse:\n print('No')\n"] | ['Runtime Error', 'Accepted'] | ['s679716329', 's713394446'] | [9160.0, 9012.0] | [29.0, 28.0] | [89, 83] |
p02570 | u986749883 | 2,000 | 1,048,576 | Takahashi is meeting up with Aoki. They have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now. Takahashi will leave his house now and go straight to the place at a speed of S meters per minute. Will he arrive in time? | ['d,t,s=map(int,input().split())\n\nif d-s*t <= 0:\n\tprint("YES")\n\nelse:\n\tprint("NO")', 'd,t,s=map(int,input().split())\n\nif d-s*t <= 0:\n\tprint("Yes")\n\nelse:\n\tprint("No")'] | ['Wrong Answer', 'Accepted'] | ['s511979904', 's596846746'] | [9156.0, 9032.0] | [28.0, 30.0] | [80, 80] |
p02570 | u990641144 | 2,000 | 1,048,576 | Takahashi is meeting up with Aoki. They have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now. Takahashi will leave his house now and go straight to the place at a speed of S meters per minute. Will he arrive in time? | ["inp = np.fromstring(sys.stdin.read(), dtype=np.int64, sep=' ')\nif inp[0]/inp[2]<inp[1]:\n print('Yes')\nelse:\n print('No')", "inp = np.fromstring(sys.stdin.read(), dtype=np.int64, sep=' ')\nif inp[0]/inp[2]<inp[1]:\n\tprint('Yes')\nelse:\n\tprint('No')", "inp = list(map(int, input().split()))\nif inp[0]/inp[2]<=inp[1]:\n print('Yes')\nelse:\n print('No')"] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s387552176', 's561734866', 's659882647'] | [9084.0, 8940.0, 9152.0] | [23.0, 26.0, 27.0] | [122, 120, 98] |
p02570 | u990967136 | 2,000 | 1,048,576 | Takahashi is meeting up with Aoki. They have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now. Takahashi will leave his house now and go straight to the place at a speed of S meters per minute. Will he arrive in time? | ["d, t, s = map(int, input().split())\nprint(d, t, s)\nif s * t >= d:\n print('Yes')\nelse:\n print('No')", "d, t, s = map(int, input().split())\nif s * t >= d:\n print('Yes')\nelse:\n print('No')"] | ['Wrong Answer', 'Accepted'] | ['s397370694', 's223060372'] | [9160.0, 9068.0] | [29.0, 29.0] | [104, 89] |
p02570 | u992007480 | 2,000 | 1,048,576 | Takahashi is meeting up with Aoki. They have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now. Takahashi will leave his house now and go straight to the place at a speed of S meters per minute. Will he arrive in time? | ['import sys\n\ntry:\n d = int(input(\'D: \'))\n t = int(input(\'T: \'))\n s = int(input(\'S: \'))\nexcept ValueError:\n print(\'エラー:整数以外を入力しないでください\')\n sys.exit(1)\n\nif 1 <= d <= 10000 and 1 <= t <= 10000 and 1 <= s <= 10000:\n take_time = d / s\n if take_time <= t:\n print("Yes")\n else:\n print("No")\nelse:\n print(\'エラー:各入力は1~10000までの整数です\')', 'import sys\n\ntry:\n #d = int(input(\'D: \'))\n #t = int(input(\'T: \'))\n #s = int(input(\'S: \'))\n nums = [int(e) for e in input().split()]\nexcept ValueError:\n print(\'エラー:整数以外を入力しないでください\')\n sys.exit(1)\n\nif 1 <= nums[0] <= 10000 and 1 <= nums[1] <= 10000 and 1 <= nums[2] <= 10000:\n take_time = nums[0] / nums[2]\n if take_time <= nums[1]:\n print("Yes")\n else:\n print("No")\nelse:\n print(\'エラー:各入力は1~10000までの整数です\')'] | ['Runtime Error', 'Accepted'] | ['s843628440', 's458407897'] | [9112.0, 9068.0] | [26.0, 29.0] | [431, 515] |
p02570 | u993893148 | 2,000 | 1,048,576 | Takahashi is meeting up with Aoki. They have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now. Takahashi will leave his house now and go straight to the place at a speed of S meters per minute. Will he arrive in time? | ['a,b,c = map(int, input().split())\nprint("Yes" if b*c<=a else "No")', "a,b,c = map(int, input().split())\nif b*c >=a:\n print('Yes')\nelse:\n print('No')\n\n"] | ['Wrong Answer', 'Accepted'] | ['s683150688', 's539244194'] | [9140.0, 9120.0] | [30.0, 33.0] | [66, 86] |
p02570 | u994865749 | 2,000 | 1,048,576 | Takahashi is meeting up with Aoki. They have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now. Takahashi will leave his house now and go straight to the place at a speed of S meters per minute. Will he arrive in time? | ["D,T,S=int(input().split())\nif D/S<=T:\n print('Yes')\nelse:\n Print('No')", "D,T,S=int(input().split())\nif D/S<=T:\n print('Yes')\nelse:\n print('No')", "D,T,S=int(input().split())\nif D/S=<T:\n print('Yes')\nelse:\n print('No')", "D,T,S=map(int,input().split())\nif D/S<=T:\n print('Yes')\nelse:\n print('No')"] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s307036872', 's433159481', 's964190169', 's833460576'] | [9088.0, 9084.0, 8876.0, 9156.0] | [29.0, 29.0, 30.0, 28.0] | [72, 72, 72, 76] |
p02570 | u995400612 | 2,000 | 1,048,576 | Takahashi is meeting up with Aoki. They have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now. Takahashi will leave his house now and go straight to the place at a speed of S meters per minute. Will he arrive in time? | ['D,T,S=input().split()\nif(float(D)==(float(S)*float(T))):\n print("Yes")\nelse:\n print("No")', 'D,T,S=input()\nif(D==(S*T)):\n print("Yes")\nelse:\n print("No")', 'D,T,S=input().split()\nif(float(T)>=(float(D)/float(S))):\n print("Yes")\nelse:\n print("No")'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s745988698', 's980934996', 's920646893'] | [8908.0, 8856.0, 8984.0] | [24.0, 29.0, 26.0] | [91, 62, 91] |
p02570 | u999503965 | 2,000 | 1,048,576 | Takahashi is meeting up with Aoki. They have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now. Takahashi will leave his house now and go straight to the place at a speed of S meters per minute. Will he arrive in time? | ['s=input()\nt=input()\n\nif len(s)==len(t):\n num=0\n for i,j in zip(s,t):\n if i!=j:\n num+=1\nelse:\n for i in range(len(s)-len(t)+1):\n a=s[i:len(t)+i]\n num=0\n for i,j in zip(t,a):\n if i!=j:\n num+=1\n num=min(1000,num)\n\nprint(num)\n \n ', 'd,t,s=map(int,input().split())\n\nnum=t*s\n\nif num>=d:\n print("Yes")\nelse:\n print("No")'] | ['Runtime Error', 'Accepted'] | ['s296936130', 's070571132'] | [8988.0, 9160.0] | [27.0, 31.0] | [266, 86] |
p02571 | u013617325 | 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())\n\nsuma=0\nsumb=0\nsumc=0\n\nfor i in range(len(T)):\n A = T[i:]\n B = T[:i+1]\n if A in S:\n pass\n else:\n suma+=1\n\n if B in S:\n pass\n else:\n sumb+=1\n\n if A in S:\n if B in S:\n pass\n else:\n sumc+=1\n\n\nsuma = min(suma, sumb)\nsuma = min(suma, sumc)\nprint(suma)\n~ ', "#!/usr/bin/env python3\nimport sys\n\n\ndef solve(S: str, T: str):\n length = len(T)\n s_list =[]\n for i in range(len(S)-length+1):\n\n s = S[i:i+length]\n s_list.append(s)\n\n ans = length\n\n for s in s_list:\n counter = 0\n for i in range(ans):\n print(T)\n if s[i] != T[i]:\n counter+=1\n\n ans = min(ans, counter)\n\n\n return print(ans)\n\n\n# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default template now. You can remove this line by using your custom template)\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n tokens = iterate_tokens()\n S = next(tokens) # type: str\n T = next(tokens) # type: str\n solve(S, T)\n\nif __name__ == '__main__':\n main()\n", "#!/usr/bin/env python3\nimport sys\n\n\ndef solve(S: str, T: str):\n length = len(T)\n s_list =[]\n counter = length\n ans = 0\n\n for i in range(len(S)-length+1):\n s = S[i:i+length]\n for i in range(length):\n #print(s[i], T[i])\n if s[i] != T[i]:\n ans+=1\n\n counter = min(ans, counter)\n\n ans = 0\n\n return print(counter)\n\n\n# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default template now. You can remove this line by using your custom template)\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n tokens = iterate_tokens()\n S = next(tokens) # type: str\n T = next(tokens) # type: str\n solve(S, T)\n\nif __name__ == '__main__':\n main()\n"] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s290378596', 's561051725', 's697126057'] | [8928.0, 129212.0, 9132.0] | [25.0, 418.0, 44.0] | [372, 863, 848] |
p02571 | u015767468 | 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()\nlenS=len(S)\nlenT=len(T)\ncount=[]\n\nfor i in range(lenS-lenT+1):\n c=0\n for j in range(lenT):\n if T[j]!=S[i+j]:\n c=c+1\n j=j+1\n print(c)\n count.append(c)\n i=i+1\nprint(min(count))', 'S=input()\nT=input()\nlenS=len(S)\nlenT=len(T)\ncount=[]\n\nfor i in range(lenS-lenT+1):\n c=0\n for j in range(lenT):\n if T[j]!=S[i+j]:\n c=c+1\n j=j+1\n count.append(c)\n i=i+1\nprint(min(count))'] | ['Wrong Answer', 'Accepted'] | ['s482485501', 's196136681'] | [9180.0, 9020.0] | [142.0, 71.0] | [238, 221] |
p02571 | u039934639 | 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)\n\nans = s_len\nfor i in range(s_len - t_len + 1):\n c = 0\n for j in range(t_len):\n if s[i+j] == t[j]:\n c += 1\n ans = max(ans, c)\nprint(t_len - ans)', 'S = input()\nT = input()\nans = 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 += 1\n ans = max(ans, count)\nprint(len(T) - ans)'] | ['Wrong Answer', 'Accepted'] | ['s404856721', 's091842597'] | [9064.0, 9012.0] | [70.0, 71.0] | [226, 190] |
p02571 | u045953894 | 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\n\nfor start in range(len(s)-len(t)+1):\n l = 0\n for j in range(len(t)):\n if s[j+start] != t[j]:\n l += 1\n print(start,j)\n ans = min(ans,l)\nprint(ans)', 's = input()\nt = input()\nans = len(t)\n\n\nfor start in range(len(s)-len(t)+1):\n l = 0\n for j in range(len(t)):\n if s[j+start] != t[j]:\n l += 1\n ans = min(ans,l)\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s033407337', 's560216716'] | [9172.0, 9116.0] | [183.0, 64.0] | [300, 277] |
p02571 | u061140245 | 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() # all\nt = input() # substring\n\ndef calc_length(str1, str2):\n print(str1)\n print(str2)\n length = 0\n for i in range(len(str1)):\n if str1[i] != str2[i]:\n length += 1\n return length\n\nmin_length = len(t)\nfor i in range(len(s)- len(t) + 1):\n l = calc_length(s[i:i+len(t)], t)\n if l < min_length:\n min_length = l\n\nprint(min_length)', 's = input() # all\nt = input() # substring\n\ndef calc_length(str1, str2):\n length = 0\n for i in range(len(str1)):\n if str1[i] != str2[i]:\n length += 1\n return length\n\nmin_length = len(t)\nfor i in range(len(s)- len(t) + 1):\n l = calc_length(s[i:i+len(t)], t)\n if l < min_length:\n min_length = l\n\nprint(min_length)\n'] | ['Wrong Answer', 'Accepted'] | ['s729510822', 's026726406'] | [9132.0, 9124.0] | [45.0, 43.0] | [382, 351] |
p02571 | u065099501 | 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)):\n if len(S)-i >= len(T):\n for s,t in zip(S[i:i+len(T)],T):\n tmp = len(T)\n if t == s:\n tmp -= 1\n ans = min(ans,tmp)\nelse:\n print(ans)', 'S = input()\nT = input()\nans = len(T)\nfor i in range(len(S)):\n for s,t in zip(S[i:i+len(T)],T):\n tmp = len(T)\n if t == s:\n tmp -= 1\n ans = min(ans,tmp)\nelse:\n print(ans)', 'S = input()\nT = input()\nans = len(T)\nfor i in range(len(S)):\n tmp = len(T)\n if len(S)-i >= len(T):\n for s,t in zip(S[i:i+len(T)],T):\n if t == s:\n tmp -= 1\n ans = min(ans,tmp)\nelse:\n print(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s042257512', 's102666407', 's518215627'] | [8804.0, 9008.0, 9060.0] | [80.0, 131.0, 60.0] | [249, 202, 241] |
p02571 | u071905007 | 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(map(str,input()))\nT=list(map(str,input()))\nX=[]\nZ=0\nfor I in range(len(S)-len(T)):\n Y=S[I:I+len(T)]\n Z=0\n for J in range(len(T)):\n if Y[J]==T[J]:\n Z=Z+1\n X.append(Z)\nif X ==True:\n print(len(T)-max(X))\nelif S==T:\n print(0)\nelse:\n print(len(T))', 'S=list(map(str,input()))\nT=list(map(str,input()))\nX=[]\nZ=0\nfor I in range(len(S)-len(T)+1):\n Y=S[I:I+len(T)]\n Z=0\n for J in range(len(T)):\n if Y[J]==T[J]:\n Z=Z+1\n X.append(Z)\nif not X==[]:\n print(len(T)-max(X))\nelif S==T:\n print(0)\nelse:\n print(len(T))'] | ['Wrong Answer', 'Accepted'] | ['s677223328', 's913626243'] | [9096.0, 9004.0] | [68.0, 68.0] | [288, 291] |
p02571 | u085970119 | 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`. | ['Sr = input()\nTg = input()\n\nans = 10000\nfor i in range(len(Sr)-len(Tg)+1):\n mat = 0\n trimmedSr = Sr[i:i + len(Tg)]\n for j in range(len(Tg)):\n if trimmedSr != Tg[j]:\n mat++;\n ans = min(mat, ans)\nprint(ans)', 'from sys import stdin\n\nS = input()\nT = input()\n\nans =10000\n\nfor i in range(len(S) - len(T) + 1):\n \n mat = 0\n \n U = S[i:i + len(T)]\n for j in range(len(T)):\n \n if U[j] != T[j]:\n mat += 1\n \n ans = min(ans, mat)\n\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s746334998', 's586340189'] | [8940.0, 9036.0] | [26.0, 55.0] | [215, 441] |
p02571 | u100792505 | 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().split())\nT = str(input().split())\nimport numpy as numpy\nlen_S = len(S)\nlen_T = len(T)\ncount = numpy.zeros(len_S-len_T+1)\nfor i in range(len_S-len_T+1):\n for j in range(len_T):\n if not S[i+j] == T[j]:\n count[i] +=1\nprint(int(min(count)))', 'S = str(input())\nT = str(input())\nimport numpy as numpy\nlen_S = len(S)\nlen_T = len(T)\ncount = numpy.zeros(len_S-len_T+1)\nfor i in range(len_S-len_T+1):\n for j in range(len_T):\n if not S[i+j] == T[j]:\n count[i] +=1\nprint(int(min(count)))'] | ['Wrong Answer', 'Accepted'] | ['s448308007', 's144286404'] | [27144.0, 27144.0] | [181.0, 208.0] | [261, 245] |
p02571 | u111471511 | 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`. | ['ans = []\n\nfor i in range(M-N+1):\n\n num = 0\n\n substring = input_list[0][i:i+N]\n\n for j in range(len(substring)):\n\n if substring[j] != input_list[1][j]:\n\n num += 1\n\n ans.append(num)\n\nprint(min(ans))\n', 'S = input()\nT = input()\n\nS_len = len(S)\nT_len = len(T)\n\nans = T_len\n\nfor i in range(S_len - T_len + 1):\n\n diff = 0\n\n for j in range(T_len):\n\n if T[j] != S[i+j]:\n\n diff += 1\n\n ans = min(ans, diff)\n\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s842098345', 's651247184'] | [8904.0, 9016.0] | [31.0, 56.0] | [227, 234] |
p02571 | u114722370 | 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 = 0\nfor i in range(len(S)-len(T)+1):\n cnt = 0\n for j in range(len(T)):\n if S[j+i] == T[j]:\n cnt += 1 \nprint(len(T) - res)', 'S = input()\nT = input()\n\nres = 0\nfor i in range(len(S)-len(T)+1):\n cnt = 0\n for j in range(len(T)):\n if S[j+i] == T[j]:\n cnt += 1\n res = max(res, cnt)\nprint(len(T) - res)'] | ['Wrong Answer', 'Accepted'] | ['s876417683', 's593746893'] | [9040.0, 9080.0] | [73.0, 72.0] | [178, 197] |
p02571 | u115110170 | 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 = len(t)\nfor i in range(len(s)-len(t)+1):\n tmp=0\n for j in range(len(t)):\n if t[j] == s[i+j]:\n tmp+=1\n ans = min(tmp,ans)\n \nprint(ans)', 's = input()\nt = input()\n\nans = len(t)\nfor i in range(len(s)-len(t)+1):\n tmp=0\n for j in range(len(t)):\n if t[j] != s[i+j]:\n tmp+=1\n ans = min(tmp,ans)\n \nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s700556981', 's076358105'] | [9108.0, 9112.0] | [71.0, 55.0] | [175, 175] |
p02571 | u153047519 | 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()\nresult = len(t)\nfor i in range(len(s) - len(t) + 1):\n box = 0\n for j in range(len(t)):\n if t[j] == s[i + j]:\n box += 1\n if result > box :\n result = box\nprint(result)', 's = input()\nt = input()\nresult = len(t)\nfor i in range(len(s) - len(t) + 1):\n box = 0\n for j in range(len(t)):\n if t[j] != s[i + j]:\n box += 1\n if result > box :\n result = box\nprint(result)\n'] | ['Wrong Answer', 'Accepted'] | ['s465374329', 's164852142'] | [9112.0, 9100.0] | [73.0, 56.0] | [203, 204] |
p02571 | u159144188 | 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()\nlis1 = list(T)\nlis2 = list(S)\nans_list = []\nch = True\nfor i in range(len(T)):\n for j in range(len(S)):\n if lis1[i] == lis2[j]:\n ans = 1\n ch = True\n if len(S) - j < len(S) - i or j < i:\n continue\n else:\n while ch == True:\n p = i\n q = j\n if p+1 < len(T) and q+1 < len(S) and lis1[p + 1] == lis2[q + 1]:\n ans += 1\n p += 1\n q += 1\n else:\n ch = False\n ans_list.append(len(T)-ans)\nif ans_list == []:\n print(len(T))\nelse:\n print(max(ans_list))', 'S = input()\nT = input()\nx,y = len(S),len(T)\nA = [0] * (x-y+1)\nfor i in range(0, x-y+1):\n count = 0\n j = 0\n for k in range(i, i+y):\n if S[k] != T[j]:\n count += 1\n j += 1\n A[i] = count\nprint(min(A))'] | ['Wrong Answer', 'Accepted'] | ['s044210969', 's869862733'] | [9040.0, 9032.0] | [2206.0, 65.0] | [591, 211] |
p02571 | u170913092 | 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().split()\nmm = 0\nfor i in range(len(S)-len(T)):\n a = S[i:i+len(T)]\n mm_now = sum([x == y for x,y in [*zip(a,T)]])\n mm = max(mm_now, mm)\nprint(len(T) - mm)\n', 'S = input()\nT = input()\nmm = 0\nfor i in range(len(S)-len(T)+1):\n a = S[i:i+len(T)]\n mm_now = sum([x == y for x,y in [*zip(a,T)]])\n mm = max(mm_now, mm)\nprint(len(T) - mm)\n'] | ['Runtime Error', 'Accepted'] | ['s261114768', 's474488716'] | [8988.0, 8964.0] | [23.0, 49.0] | [176, 180] |
p02571 | u173178698 | 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 = [x for x in input()]\nT = [x for x in input()]\ncmin = 1000\nt = 0\nfor i in range(len(S)):\n c = 0\n t = i\n\n for j in range(len(T)):\n if t == len(S):\n exit()\n if S[t] != T[j]:\n c += 1\n else:\n if c < cmin:\n cmin = c\n t += 1\n \nprint(cmin)', 'S = list(input())\nT = list(input())\ncmin = 1000\n\nfor i in range(len(S)-len(T)+1):\n c = 0\n s = S[i:i+len(T)]\n for j in range(len(T)):\n if s[j] != T[j]:\n c += 1\n cmin = min(c,cmin)\n\nprint(cmin)'] | ['Wrong Answer', 'Accepted'] | ['s280204359', 's059864791'] | [9036.0, 9044.0] | [86.0, 56.0] | [327, 221] |
p02571 | u182178426 | 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\nc = 0\nu = []\nfor i in range(len(s)-len(t)+1):\n for j in range(len(t)):\n if t[j]!=s[j+i]:\n c+=1\n u.append(c)\nprint(min(u))', 's = input()\nt = input()\n\nc = 0\nu = []\nfor i in range(len(s)-len(t)+1):\n c = 0\n for j in range(len(t)):\n if t[j]!=s[j+i]:\n c+=1\n u.append(c)\nprint(min(u))'] | ['Wrong Answer', 'Accepted'] | ['s799793380', 's801408462'] | [9104.0, 9084.0] | [63.0, 67.0] | [170, 180] |
p02571 | u183432736 | 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())\ntempcount = 0\nmincount = 0\n\nif S in T:\n print("0")\n exit\n\nfor i in range(len(S) - len(T)+1):\n for j in range(len(T)+1):\n if S[i + j] != T[j]:\n tempcount += 1\n if i == 0:\n mincount = tempcount\n elif tempcount < mincount:\n mincount = tempcount\n tempcount = 0\n \nprint(mincount)\n\n', 'S = str(input())\nT = str(input())\ntempcount = 0\nmincount = 0\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 tempcount += 1\n if i == 0:\n mincount = tempcount\n elif tempcount < mincount:\n mincount = tempcount\n tempcount = 0\n \nprint(mincount)\n\n'] | ['Runtime Error', 'Accepted'] | ['s399214585', 's664752168'] | [9024.0, 9120.0] | [25.0, 65.0] | [363, 325] |
p02571 | u185405877 | 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()\nl=input()\nlen_s=len(s)\nlen_l=len(l)\na=len_s-len_l\nans=1001\nfor i in range(len_s-len_l+!):\n cnt=0\n for j in range(len_l):\n if l[j]!=s[i+j]:\n cnt+=1\n ans=min(ans,cnt)\n\nprint(ans)\n', 's=input()\nl=input()\nlen_s=len(s)\nlen_l=len(l)\na=len_s-len_l\nans=1001\nfor i in range(len_s-a):\n cnt=0\n for j in range(len_s):\n if l[j]==s[i+j]:\n cnt+=1\n ans=min(ans,len_l-cnt)\n\nprint(ans)', 's=input()\nl=input()\nlen_s=len(s)\nlen_l=len(l)\na=len_s-len_l\nans=1001\nfor i in range(len_s-len_l+1):\n cnt=0\n for j in range(len_l):\n if l[j]!=s[i+j]:\n cnt+=1\n ans=min(ans,cnt)\n\nprint(ans)\n\n'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s526092297', 's718702212', 's441378015'] | [8888.0, 9068.0, 9108.0] | [25.0, 31.0, 68.0] | [214, 213, 215] |
p02571 | u190616335 | 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`. | ['#!/usr/bin/python3\n# -*- coding: utf-8 -*-\ns = input()\nt = input()\nmin_count = 1000\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 += 1\n min_count = min(count, min_count)\n if min_count == 0:\n break\nprint(min_count)', '#!/usr/bin/python3\n# -*- coding: utf-8 -*-\ns = input()\nt = input()\nmin_count = 1000\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 min_count = min(count, min_count)\n if min_count == 0:\n break\nprint(min_count)'] | ['Runtime Error', 'Accepted'] | ['s395042452', 's620478302'] | [9008.0, 8964.0] | [21.0, 64.0] | [303, 304] |
p02571 | u195177386 | 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\nlent = len(T)\nans = lent\nfor i in range(len(S)-lent+1):\n s = S[i:i+lent]\n lev = 0\n lev = sum(map(lambda x: x[0] != x[1], zip(s, T)))\n print(s)\n print(lev)\n if lev == 0:\n ans = 0\n # break\n elif lev < ans:\n ans = lev\nprint(ans)\n', 'S = input()\nT = input()\n\nlent = len(T)\nans = lent\nfor i in range(len(S)-lent+1):\n s = S[i:i+lent]\n lev = 0\n lev = sum(map(lambda x: x[0] != x[1], zip(s, T)))\n if lev == 0:\n ans = 0\n break\n elif lev < ans:\n ans = lev\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s840806864', 's730049297'] | [9040.0, 9120.0] | [60.0, 59.0] | [292, 263] |
p02571 | u196455939 | 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`. | ['#B - Substring \nS = str(input())\nT = str(input())\ni = 0\nj = 0\n\nSlen = len(S)\nTlen = len(T)\nchange_min = Tlen\n\nfor i in range(Slen - Tlen):\n diff = 0\n for j in range(Tlen):\n if S[i] != T[i + j]:\n diff += 1\n change_min = min(change_min,diff)\n\n\nprint(change_min)', "#B - Substring \nS = str(input())\nT = str(input())\ni = 0\nj = 0\n\nk = len(S)\nl = len(T)\nchange_min = l\n\nfor i in range(l):\n for m in range(l - i) :\n change = l\n for j in range(k - (l -i)+1):\n print(S[j+m:j +l-i],T[m:l-i],change,l-i-m)\n if S[j+m:j +l-i] == T[m:l-i]:\n print('Match !!')\n change -= l-i-m\n if change_min > change:\n change_min = change\n\nprint(change_min)\n", '#B - Substring \nS = str(input())\nT = str(input())\ni = 0\nj = 0\n\nSlen = len(S)\nTlen = len(T)\nchange_min = Tlen\n\nfor i in range(Slen - Tlen):\n diff = 0\n for j in range(Tlen):\n if S[i] != T[j]:\n diff += 1\n change_min = min(change_min,diff)\n\n\nprint(change_min)', '#B - Substring \nS = str(input())\nT = str(input())\ni = 0\nj = 0\n\nSlen = len(S)\nTlen = len(T)\nchange_min = Tlen\n\nfor i in range(Slen - Tlen + 1):\n diff = 0\n for j in range(Tlen):\n if T[j] != S[i + j]:\n diff += 1\n change_min = min(change_min,diff)\n\n\nprint(change_min)\n'] | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s033682490', 's149224260', 's257407073', 's463725876'] | [9108.0, 137908.0, 9108.0, 8916.0] | [28.0, 1710.0, 56.0, 62.0] | [294, 459, 290, 299] |
p02571 | u202400119 | 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 = len(t)\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 if s[i+j] != t[j]:\n dif += 1\n ans = min(ans, dif)\n\nprint(ans)', 's = input()\nt = input()\n\nans = len(s)\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 if s[i+j] != t[j]:\n dif += 1\n ans = min(ans, dif)\n\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s726347337', 's950275994'] | [9032.0, 9064.0] | [104.0, 60.0] | [227, 223] |
p02571 | u204616996 | 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 _ans=0\n for j in range(len(T)):\n if S[i+j]!=T[i+j]:\n _ans+=1\n ans=min(ans,_ans)\nprint(ans)', 'S=input()\nT=input()\nans=len(T)\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 _ans+=1\n ans=min(ans,_ans)\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s366348112', 's538788746'] | [9016.0, 8800.0] | [27.0, 59.0] | [166, 164] |
p02571 | u207582576 | 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 = [str(i) for i in input().split()]\n \ns = list(S)\nt = list(T)\ns_n = len(s)\nt_n = len(t)\nn = 0\nn = s_n - t_n + 1\nmin = t_n\n \nfor a in range(n):\n count = 0 \n\tfor b in range(t_n):\n if S[a+b] != T[b]:\n count += 1\n if count < min:\n min = count\n \nprint(min)', 'S, T = [str(i) for i in input().split()]\n\ns = list(S)\nt = list(T)\ns_n = len(S)\nt_n = len(T)\nn = 0\nn = s_n - t_n + 1\nmin = t\n \nfor a in range(n):\n count = 0 \n\tfor b in range(t_n):\n if S[a+b] != T[b]:\n count += 1\n if count < min:\n min = count\n \nprint(min)', 'S, T = input().split()\n \nn = len(S) - len(T) + 1\nmin = len(T)\n \nfor a in range(n):\n count = 0 \n\tfor b in range(len(T)):\n if S[a+b] != T[b]:\n count += 1\n if count < min:\n min = count\nprint(min)', 's = input().split()\n\nn = len(s[0]) - len(s[1]) + 1\nmin = len(s[1])\n \nfor a in range(n):\n count = 0 \n\tfor b in range(len(s[1])):\n if s[0][a+b] != s[1][b]:\n count += 1\n if count < min:\n min = count\nprint(min)', '\nx = input().split()\nS = x[0]\nT = x[1]\ns = list(S)\nt = list(T)\ns_n = len(s)\nt_n = len(t)\nn = 0\nn = s_n - t_n + 1\nmin = t_n\n \nfor a in range(n):\n count = 0 \n\tfor b in range(t_n):\n if S[a+b] != T[b]:\n count += 1\n if count < min:\n min = count\nprint(min)\n', 'S, T = [str(i) for i in input().split()]\n \n#s = list(S)\n#t = list(T)\n#s_n = len(s)\n#t_n = len(t)\n#n = 0\n#n = s_n - t_n + 1\n#min = t_n\n \n#for a in range(n):\n #count = 0 \n\t#for b in range(t_n):\n #if S[a+b] != T[b]:\n #count += 1\n #if count < min:\n #min = count\n \n#print(min)', 'x = input().split()\nS = list(x[0])\nT = list(x[1])\nn = 0\nn = len(S) - len(T) + 1\nmin = t\n \nfor a in range(n):\n count = 0 \n\tfor b in range(len(T)):\n if S[a+b] != T[b]:\n count += 1\n if count < min:\n min = count\nprint(min)\n', 'x = input().split()\nS = list(x[0])\nT = list(x[1])\ns = len(S)\nt = len(T)\nn = 0\nn = s - t + 1\nmin = t\n \nfor a in range(n):\n count = 0 \n\tfor b in range(t):\n if S[a+b] != T[b]:\n count += 1\n if count < min:\n min = count\nprint(min)\n', 'x = [input() for i in range(2)]\nS = list(x[0])\nT = list(x[1])\nn = 0\nn = len(S) - len(T) + 1\nmin = len(T)\n \nfor a in range(n):\n count = 0 \n\tfor b in range(len(T)):\n if S[a+b] != T[b]:\n count += 1\n if count < min:\n min = count\nprint(min)', 'x = [input() for i in range(2)]\nS = list(x[0])\nT = list(x[1])\n\nn = int(len(S)) - int(len(T)) + 1\nmin = int(len(T))\n \nfor a in range(n):\n count = 0 \n\tfor b in range(int(len(T))):\n if S[a+b] != T[b]:\n count += 1\n if count < min:\n min = count\nprint(min)', 'S, T = [input() for i in range(2)]\n\ns = list(S)\nt = list(T)\n\nn = len(s) - len(t) + 1\nmin = len(t)\n\nfor a in range(n):\n count = 0 \n\tfor b in range(len(t)):\n if s[a+b] != t[b]:\n count += 1\n if count < min:\n min = count\n \nprint(min)', 'S, T = [str(i) for i in input().split()]\n \ns = len(S)\nt = len(T)\nn = s - t + 1\nmin = t\n \nfor a in range(n):\n count = 0 \n\tfor b in range(t):\n if S[a+b] != T[b]:\n count += 1\n if count < min:\n min = count\n \nprint(min)', 'S, T = input().split()\n \nn = len(S) - len(T) + 1\nmoji = len(T)\n \nfor a in range(n):\n count = 0 \n\tfor b in range(len(T)):\n if S[a+b] != T[b]:\n count += 1\n if count < moji:\n moji = count\n \nprint(moji)', 'S, T = input().split()\n \nn = len(S) - len(T) + 1\nmoji = len(T)\n \nfor a in range(n):\n count = 0 \n for b in range(len(T)):\n if S[a+b] != T[b]:\n count += 1\n if count < moji:\n moji = count\n \nprint(moji)', 'x = [input() for i in range(2)]\nS = x[0]\nT = x[1]\nmoji = len(T)\n\nfor a in range(len(S) - len(T) + 1):\n count = 0\n for b in range(len(T)):\n \n if S[a+b] != T[b]:\n count += 1\n if count < moji:\n moji = count\n\nprint(moji)'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s075723062', 's116276861', 's186510049', 's203304231', 's232695605', 's238776012', 's263842827', 's294371604', 's402171218', 's482668338', 's660909958', 's811386660', 's833193138', 's995982439', 's194874527'] | [8956.0, 8928.0, 8860.0, 8972.0, 8944.0, 8984.0, 8864.0, 9036.0, 8860.0, 8952.0, 9016.0, 8920.0, 8968.0, 9108.0, 9124.0] | [24.0, 23.0, 23.0, 23.0, 27.0, 25.0, 29.0, 25.0, 20.0, 24.0, 22.0, 26.0, 26.0, 23.0, 62.0] | [278, 275, 209, 223, 309, 293, 236, 243, 252, 267, 251, 236, 218, 215, 233] |
p02571 | u209268771 | 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())\n\nslen = len(s)\ntlen = len(t)\n\ni = tlen\nn = 0\na = 0\ntuu = [0] * tlen\nans = [0] * tlen\nmax_count = 0\nwhile i <= slen:\n ps = s[ n : i + tlen -1 ]\n count = 0\n for j in range(tlen):\n if ps[j] == t[j]:\n count += 1\n tuu[j] = "True"\n\n# print(count)\n if max_count < count:\n max_count = count\n\n a = n\n ans = tuu\n \n# print(a) \n n += 1\n i += 1\n# print(a)\n# print(ans)\n\nfor h in range(tlen):\n if ans[h] == "True":\n pass\n else:\n t[h] = s[a + h] ', 's = str(input())\nt = str(input())\n\nslen = len(s)\ntlen = len(t)\n\ni = tlen\nn = 0\na = 0\n\n# ans = [0] * tlen\nmax_count = 0\nwhile i <= slen:\n ps = s[ n : i + tlen -1 ]\n count = 0\n for j in range(tlen):\n if ps[j] == t[j]:\n count += 1\n\n\n# print(count)\n if max_count < count:\n max_count = count\n n += 1\n i += 1\nprint(tlen - max_count)'] | ['Runtime Error', 'Accepted'] | ['s072517329', 's893795415'] | [9120.0, 9032.0] | [76.0, 66.0] | [632, 452] |
p02571 | u213497190 | 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()\nmax_len = 0\n\nfor i in range(len(t)):\n for j in range(i, len(t)+1):\n print(t[i:j])\n if t[i:j] in s[i:len(s)-j+1]:\n max_len = max(max_len, j-i)\n\nprint(len(t) - max_len)', 's = input()\nt = input()\nmax_count = 0\n\nfor i in range(len(s)-len(t)+1):\n count = 0\n s_ = s[i:i+len(t)+1]\n for j in range(len(t)):\n if s_[j] == t[j]:\n count += 1\n max_count = max(max_count, count)\n\nprint(len(t) - max_count)'] | ['Runtime Error', 'Accepted'] | ['s401474506', 's835765802'] | [137912.0, 9116.0] | [2096.0, 67.0] | [218, 252] |
p02571 | u216752093 | 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())\nn=len(t)\nm=len(s)\nfor i in range(n):\n l=n-i\n for j in range(i+1):\n print(t[j:j+l],i,s[j:j+m-i])\n if ''.join(t[j:j+l]) in ''.join(s[j:j+m-i]):\n print(i)\n exit()\nprint(n)", 's=list(input())\nt=list(input())\nn=len(t)\nm=len(s)\nmn=n\nfor i in range(m-n+1):\n err=0\n for j in range(n):\n if s[i+j]!=t[j]:\n err+=1\n mn=min(mn,err)\nprint(mn)'] | ['Runtime Error', 'Accepted'] | ['s991068797', 's507201674'] | [138008.0, 9036.0] | [3641.0, 65.0] | [242, 183] |
p02571 | u222643068 | 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\nt_len = len(t)\ns_len = len(s)\nmax_ = 0\ntemp = 0\n\nfor i in range(s_len - t_len):\n for j in range(t_len):\n if s[i + j] == t[j]:\n temp += 1\n if max_ < temp:\n max_ = temp\n temp = 0\nprint(t_len - max_ + 1)', 's = input()\nt = input()\n\nt_len = len(t)\ns_len = len(s)\nmax_ = 0\ntemp = 0\n\nfor i in range(s_len - t_len + 1):\n for j in range(t_len):\n if s[i + j] == t[j]:\n temp += 1\n if max_ < temp:\n max_ = temp\n temp = 0\n\nprint(t_len - max_)'] | ['Wrong Answer', 'Accepted'] | ['s245560891', 's761569837'] | [9064.0, 8988.0] | [73.0, 71.0] | [239, 240] |
p02571 | u225463683 | 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`. | ['list_data = [input() for _ in range(2)]\nprint(list_data)\n\ns = list_data[0]\nt = list_data[1]\n\nlen_t = len(t)\n\nmax_correct = 0\nfor i in range(len(s)-len(t)):\n correct = 0\n for j in range(len(t)):\n if s[i+j] == t[j]:\n correct += 1\n \n if max_correct < correct:\n max_correct = correct\n\nprint(len_t - max_correct)', 'list_data = [input() for _ in range(2)]\n\ns = list_data[0]\nt = list_data[1]\n\nlen_t = len(t)\n\nmax_correct = 0\nfor i in range(len(s)-len(t)+1):\n correct = 0\n for j in range(len(t)):\n if s[i+j] == t[j]:\n correct += 1\n \n if max_correct < correct:\n max_correct = correct\n\nprint(len_t - max_correct)'] | ['Wrong Answer', 'Accepted'] | ['s947285052', 's242145368'] | [9052.0, 9092.0] | [70.0, 73.0] | [322, 307] |
p02571 | u231570044 | 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), 0, -1):\n for j in range(len(T)-i+1):\n subst = T[j:i+j]\n# print(subst)\n if S.find(subst, j)>=0:\n print (len(T)-i)\n \n', 'S = input()\nT = input()\n\nfor i in range(len(T), 0, -1):\n for j in range(len(T)-i+1):\n subst = T[j:i+j]\n# print(subst)\n if S.find(subst, j, len(S)-(len(T)-i-j))>=0:\n print (len(T)-i)\n print(subst)\n# exit(0)\n', 'S = input()\nT = input()\n\nfor i in range(len(T), 0, -1):\n for j in range(len(T)-i+1):\n subst = T[j:i+j]\n print(subst)\n if S.find(subst, j, len(S)-(len(T)-i-j))>=0:\n print (len(T)-i)\n# print(subst)\n exit(0)\n\n', 'S = input()\nT = input()\n\ndef matchcount(x, y):\n ret = 0\n for i in range(len(x)):\n if x[i] == y[i]: ret += 1\n return ret\n\nrec = len(T)\nfor i in range(len(S)-len(T)+1):\n subst = S[i:i+len(T)]\n# print(subst, matchcount(subst, T))\n rec = min(rec, len(T) - matchcount(subst, T))\n\nprint(rec)\n\n'] | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s231675699', 's317978054', 's789325423', 's080871514'] | [9196.0, 137884.0, 137936.0, 9124.0] | [815.0, 2395.0, 699.0, 49.0] | [209, 263, 263, 312] |
p02571 | u234454594 | 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()\nsz=len(t)\nans=100000000000\nfor i in range(0,len(s),sz):\n k=s[i:i+sz]\n c=0\n for j in range(sz):\n if s[j]==t[j]:\n c+=1\n else:\n ans=min(ans,sz-c)\nans=min(ans,sz-c)\nprint(ans)\n', 's=input()\nt=input()\nsz=len(t)\nans=100000000000\nc=0\nif len(s)==sz:\n c=0\n for j in range(sz):\n if s[j]==t[j]:\n c+=1\n else:\n ans=min(ans,sz-c)\nelse:\n for i in range(0,len(s)-sz):\n k=s[i:i+sz]\n c=0\n for j in range(sz):\n if k[j]==t[j]:\n c+=1\n else:\n ans=min(ans,sz-c)\n # print(c)\nans=min(ans,sz-c)\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s722407140', 's017496667'] | [9124.0, 8896.0] | [26.0, 72.0] | [237, 429] |
p02571 | u235508145 | 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_min = 1000\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++\n if count < count_min:\n count_min = count\n\nprint(count_min) ', 's=input()\nt=input()\n\ncount_min = 1000\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 if count < count_min:\n count_min = count\n\nprint(count_min)'] | ['Runtime Error', 'Accepted'] | ['s838143437', 's378795032'] | [8948.0, 8976.0] | [23.0, 64.0] | [216, 212] |
p02571 | u235792800 | 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 sys import stdin\ndef ip(): return [int(i) for i in stdin.readline().split()]\ndef sp(): return [str(i) for i in stdin.readline().split()]\n\n\ns = str(input())\nt = str(input())\n\nans = len(t)\nfor i in range(len(s) - len(t)):\n curr = len(t)\n for j in range(i, len(t) + i):\n if s[j] == t[j-i]:\n curr -= 1\n else:\n curr = len(t)\n ans = min(ans, curr)\nprint(ans)\n', "from sys import stdin\ndef ip(): return [int(i) for i in stdin.readline().split()]\ndef sp(): return [str(i) for i in stdin.readline().split()]\n\n\ns = str(input())\nt = str(input())\n\nans = len(t)\nfor i in range(len(s) - len(t) + 1):\n # print(f'{i=} | {ans=}')\n curr = len(t)\n for j in range(i, len(t) + i):\n # print(f'{curr=} | {s[j]=} | {t[j-i]=}')\n if s[j] == t[j-i]:\n curr -= 1\n ans = min(ans, curr)\nprint(ans)\n"] | ['Wrong Answer', 'Accepted'] | ['s518951323', 's005714054'] | [9068.0, 9116.0] | [73.0, 70.0] | [403, 447] |
p02571 | u239368018 | 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\nlt= len(t)\nfor i in range(lt):\n is_double = True\n size = lt-i\n for j in range(0,i+1):\n _t = t[j:j+size]\n print(i,j,size,_t)\n if _t in s:\n is_double = False\n break\n if not is_double:\n print(lt-1)\n break\n ', "s, t = input(), input()\n\nls = len(s)\nlt= len(t)\nprint(ls,lt)\nis_double = False\n\nfor i in range(0,lt):\n size = lt-i\n for j in range(0,lt-size+1):\n jps = (j+size)\n # 0 j (j+size) lt\n _t = t[j:jps]\n print(i,j,size,_t, f'\\t{s[j:ls-(lt-(j+size))]}')\n if _t in s[j:ls-(lt-(j+size))]:\n is_double = True\n break\n if is_double:\n print(i)\n break\n\nif not is_double:\n print(lt)\n\n", 's, t = input(), input()\n\nls = len(s)\nlt= len(t)\nis_double = False\nc = len(s)\nfor i in range(ls-lt+1):\n _c = 0 \n for j in range(lt):\n if not s[i+j] == t[j]:\n _c +=1\n if c > _c:\n c = _c\n \nprint(c)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s158629814', 's235944956', 's387588739'] | [137784.0, 137776.0, 9104.0] | [781.0, 716.0, 62.0] | [260, 401, 211] |
p02571 | u244434589 | 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()\na = len(s)\nb = len(t)\nl = []\nfor i in range(a-b+1):\n cnt = 0\n c = s[i,i+t]\n for x, y in zip(c, t):\n if x != y:\n cnt +=1\n l.append(cnt)\nprint(min(l))', 's=input()\nt=input()\na = len(s)\nb = len(t)\nl = []\nfor i in range(a-b+1):\n cnt = 0\n c = s[i:i+b]\n for x, y in zip(c, t):\n if x != y:\n cnt +=1\n l.append(cnt)\nprint(min(l))'] | ['Runtime Error', 'Accepted'] | ['s679704149', 's022150971'] | [9048.0, 9084.0] | [26.0, 50.0] | [198, 198] |
p02571 | u244466744 | 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)\nans1 = 10000000\n\nfor i in range(s - t + 1):\n ans = 0\n for j in range(t):\n if t[j] != s[i + j]:\n ans += 1\n \n ans1 = ans\n \nprint(ans1)', 'S = input()\nT = input()\n\ns = len(S)\nt = len(T)\nans1 = 10000000\n\nfor i in range(s - t + 1):\n ans = 0\n for j in range(t):\n if T[j] != S[i + j]:\n ans += 1\n \n ans1 = min(ans, ans1)\n \nprint(ans1)\n'] | ['Runtime Error', 'Accepted'] | ['s097963898', 's311114110'] | [9060.0, 9068.0] | [28.0, 62.0] | [200, 212] |
p02571 | u247211039 | 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\nans=0\n\nb=[0]*len(S)\na=[0]*len(S)\nfor i in range(len(S)):\n cnt = 0\n for j in range(len(T)):\n cnt = 0\n #print(S[i],T[j])\n if S[i]==T[j]:\n cnt+=1\n if j != len(T):\n for k in range(j+1,len(T)-j-2):\n if S[i+k]==T[j+k]:\n cnt+=1\n else:\n b[i]=cnt\n break\n b[i]=cnt\n a[i]=j\n\nfor i in range(len(a)):\n if a[i]==a.index(a[i]):\n c = a.index(a[i])\n ans = b[c]\n break\n \nprint(len(T)-ans)', 'S=input()\nT=input()\ncnt=0\nans=len(T)\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=min(ans,cnt)\n \nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s199557793', 's834411668'] | [9036.0, 8896.0] | [2205.0, 62.0] | [621, 194] |
p02571 | u250734103 | 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 = len(T)\nfor i in range(len(T)):\n for j in range(i+1,len(T)+1):\n if T[i:j] in S:\n if i - S.find(T[i:j]) <= 0 and len(T) - S.find(T[i:j]) - 1 >= len(T) - i - 1:\n ans = min(ans, len(T)-len(T[i:j]))\nprint(ans)', "S = input()\nT = input()\n\nans = float('INF')\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)\nprint(ans)"] | ['Wrong Answer', 'Accepted'] | ['s948400267', 's685976309'] | [9120.0, 9116.0] | [927.0, 62.0] | [271, 206] |
p02571 | u267718666 | 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\nfor i in range(len(T)):\n for j in range(1, len(T)+1):\n if i >= j:\n continue\n\n if T[i:j] in S[i:j]:\n ans = max(ans, j-i)\n\nans = len(T)-ans\nprint(ans)', 'S = input()\nT = input()\nans = len(T)\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\n ans = min(ans, tmp)\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s421627378', 's463256512'] | [9000.0, 9108.0] | [534.0, 60.0] | [220, 193] |
p02571 | u273283768 | 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 = len(s)\n\nfor s_start in range(len(s)):\n if i + len(t) - 1 >= 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)', 's = input()\nt - input()\n\nans = len(s)\n\nfor s_start in range(len(s)):\n if i + len(t) - 1 >= 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)', 's = input()\nt = input()\n\nans = len(s)\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 if s[i+j] != t[j]:\n dif += 1\n ans = min(ans, dif)\nprint(ans)', 's = input()\nt = input()\n\nans = len(s)\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 if s[i+j] != t[j]:\n dif += 1\n ans = min(ans, dif)\nprint(ans)'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s420369827', 's531319634', 's661011692', 's937737462'] | [8948.0, 8864.0, 8832.0, 9040.0] | [27.0, 23.0, 30.0, 64.0] | [220, 220, 214, 204] |
p02571 | u276765287 | 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 = list(input().split())\ns = len(S)\nt = len(T)\nlist1 = [] \nlist2 = []\nn = 0\n\n\nfor i in range(n, s-t+1): \n ss = S[n:t + n]\n n += 1\n m = 0\n for x in ss:\n \n if x == T[m]:\n list1.append(1)\n m +=1\n else:\n list1.append(0)\n m +=1\n \n list2.append(sum(list1))\n list1 = []\n \nprint(t - max(list2))', 'S, T = list(input().split())\ns = len(S)\nt = len(T)\nlist1 = [] \nlist2 = []\nn = 0\n\n\nfor i in range(n, s-t+1): \n ss = S[n:t + n]\n n += 1\n m = 0\n for x in ss:\n \n if x == T[m]:\n list1.append(1)\n m +=1\n else:\n list1.append(0)\n m +=1\n \n print(list1)\n list2.append(sum(list1))\n list1 = []\n \nprint(t - max(list2))', '#!/usr/bin/env python\n# coding: utf-8\n\n# In[48]:\n\n\nS, T = list(input().split())\ns = len(S)\nt = len(T)\nlist1 = [] \nlist2 = []\nn = 0\n\n\nfor i in range(n, s-t+1): \n ss = S[n:t + n]\n n += 1\n m = 0\n for x in ss:\n \n if x == T[m]:\n list1.append(1)\n m +=1\n else:\n list1.append(0)\n m +=1\n \n list2.append(sum(list1))\n list1 = []\n \nprint(t - max(list2))\n\n\n# In[ ]:\n\n\n\n\n', 'S, T = list(input().split())\ns = len(S)\nt = len(T)\nl1 = [] \nl2 = []\nn = 0\nfor i in range(n, s-t+1): \n ss = S[n:t + n]\n n += 1\n m = 0\n for x in ss: \n if x == T[m]:\n l1.append(1)\n m +=1\n else:\n l1.append(0)\n m +=1 \n l2.append(sum(l1))\n l1 = []\nprint(t - max(l2))', '#!/usr/bin/env python\n# coding: utf-8\n\n# In[55]:\n\n\nS, T = list(input().split())\ns = len(S)\nt = len(T)\nl1 = [] \nl2 = []\nn = 0\n\n\nfor i in range(n, s-t+1): \n ss = S[n:t + n]\n n += 1\n m = 0\n for x in ss:\n \n if x == T[m]:\n l1.append(1)\n m +=1\n else:\n l1.append(0)\n m +=1\n \n l2.append(sum(l1))\n l1 = []\n \nprint(t - max(l2))\n\n\n# In[ ]:\n\n\n\n\n', 'S = input()\nT = input()\ns = len(S)\nt = len(T)\nl1 = [] \nl2 = []\nn = 0\nfor i in range(n, s-t+1): \n ss = S[n:t + n]\n n += 1\n m = 0\n for x in ss: \n if x == T[m]:\n l1.append(1)\n m +=1\n elif x != T[m]:\n l1.append(0)\n m +=1 \n l2.append(sum(l1))\n l1 = [ ]\nprint(t - max(l2)) '] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s298371780', 's358795422', 's501112970', 's695530937', 's825739584', 's180666612'] | [9148.0, 9048.0, 9128.0, 9024.0, 9140.0, 9156.0] | [27.0, 21.0, 28.0, 25.0, 26.0, 72.0] | [378, 395, 445, 344, 422, 351] |
p02571 | u278601006 | 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\nfrom copy import deepcopy\nfrom heapq import heappop, heappush\nfrom bisect import bisect_left, bisect\nfrom collections import Counter, defaultdict, deque\nfrom itertools import product, permutations, combinations\n\nS = input()\nT = input()\n\nreplaced = S.replace(T, '')\nprint(len(S) - len(replaced))\n\nexit()\n", "import numpy as np\nfrom copy import deepcopy\nfrom heapq import heappop, heappush\nfrom bisect import bisect_left, bisect\nfrom collections import Counter, defaultdict, deque\nfrom itertools import product, permutations, combinations\n\nS = input()\nT = input()\n\nreplaced = T.replace(S, '')\nprint(len(T) - len(replaced))\n\nexit()\n", 'import numpy as np\nfrom copy import deepcopy\nfrom heapq import heappop, heappush\nfrom bisect import bisect_left, bisect\nfrom collections import Counter, defaultdict, deque\nfrom itertools import product, permutations, combinations\n\nS = input()\nT = input()\n\nm = len(T)\n\nfor i in range(len(S) - len(T) + 1):\n c = 0\n\n for j in range(len(T)):\n if (S[i + j] != T[j]):\n c += 1\n\n m = min(c, m)\n\nprint(m)\nexit()\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s595174227', 's897005304', 's852114090'] | [27168.0, 27132.0, 27136.0] | [123.0, 133.0, 153.0] | [322, 322, 430] |
p02571 | u279439669 | 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 core(s, t):\n if t in s:\n return 0\n for i in range(1, len(t)):\n for j in range(i+1):\n temp = t[j:]\n if temp in s:\n return j\n return len(t)\n \nif __name__ == "__main__":\n strings = [input() for i in range(2)]\n print(core(strings[0], strings[1]))\n', 'def subst(S, T)-> int:\n lenT = len(T)\n result = lenT\n for i in range(lenT, len(S) + 1):\n tempS = S[i-lenT:i]\n tempResult = 0\n for j in range(lenT):\n if T[j] != tempS[j]:\n tempResult += 1\n if tempResult < result:\n result = tempResult\n \n return result\n\nif __name__ == "__main__":\n S = input()\n T = input()\n print(subst(S, T))'] | ['Wrong Answer', 'Accepted'] | ['s407694006', 's582321339'] | [9104.0, 9024.0] | [548.0, 40.0] | [276, 362] |
p02571 | u283929013 | 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()\nmaxs = 0\nif len(s) == len(t):\n c = 0\n for k in range(len(t)):\n if s[k] == t[k]: c += 1\n print(len(t) - c)\n quit()\nfor i in range(len(s)-len(t)):\n c = 0\n for k in range(len(t)):\n if s[i+k] == t[k]: c += 1\n maxs = max(c,maxs)\nprint(maxs)\nprint(len(t) - maxs)', 's = input()\nt = input()\nmaxs = 0\nif len(s) == len(t):\n c = 0\n for k in range(len(t)):\n if s[k] == t[k]: c += 1\n print(len(t) - c)\n quit()\nfor i in range(len(s)-len(t)):\n c = 0\n for k in range(len(t)):\n if s[i+k] == t[k]: c += 1\n maxs = max(c,maxs)\nprint(len(t) - maxs)'] | ['Wrong Answer', 'Accepted'] | ['s073457449', 's934553072'] | [9144.0, 9072.0] | [79.0, 75.0] | [315, 303] |
p02571 | u284120954 | 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 = 100000\n\nfor i in range(len(S) - len(T) + 1):\n count = 0\n for n in range(len(T)):\n if S[i + n] != T[n]:\n count += 1\n print(count)\n if count < Min:\n Min = count\n\nprint(Min)', ' S = input()\nT = input()\n\nMin = 100000\n\nfor i in range(len(S) - len(T) + 1):\n count = 0\n for n in range(len(T)):\n if S[i + n] != T[n]:\n count += 1\n if count < Min:\n Min = count\n\nprint(count)', 'S = input()\nT = input()\n\nMin = 100000\n\nfor i in range(len(S)):\n if i + len(T) > len(S) - 1:\n break\n count = 0\n for n in range(len(T)):\n if S[i + n] != T[n]:\n count += 1\n if count < Min:\n Min = count\n\nprint(count)', 'S = input()\nT = input()\n\nMin = 100000\n\nfor i in range(len(S) - len(T) + 1):\n count = 0\n for n in range(len(T)):\n if S[i + n] != T[n]:\n count += 1\n if count < Min:\n Min = count\n\nprint(Min)'] | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s069164322', 's204261753', 's959442194', 's946236337'] | [9092.0, 8860.0, 9040.0, 9036.0] | [60.0, 32.0, 59.0, 62.0] | [238, 224, 256, 221] |
p02571 | u303039933 | 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 -*-\nimport sys\nimport math\nimport os\nimport itertools\nimport string\nimport heapq\nimport _collections\nfrom collections import Counter\nfrom collections import defaultdict\nfrom collections import deque\nfrom functools import lru_cache\nimport bisect\nimport re\nimport queue\nimport copy\nimport decimal\n\n\nclass Scanner():\n @staticmethod\n def int():\n return int(sys.stdin.readline().rstrip())\n\n @staticmethod\n def string():\n return sys.stdin.readline().rstrip()\n\n @staticmethod\n def map_int():\n return [int(x) for x in Scanner.string().split()]\n\n @staticmethod\n def string_list(n):\n return [Scanner.string() for i in range(n)]\n\n @staticmethod\n def int_list_list(n):\n return [Scanner.map_int() for i in range(n)]\n\n @staticmethod\n def int_cols_list(n):\n return [Scanner.int() for i in range(n)]\n\n\ndef solve():\n S = Scanner.string()\n T = Scanner.string()\n ma = len(S) - len(T) + 1\n ans = len(T)\n for i in range(0, ma):\n cnt = 0\n for j in range(len(T)):\n if S[i + j] != T[j]:\n cnt += 1\n ans = min(ans, cnt)\n print(ans)\n\n\ndef main():\n \n sys.stdin = open("sample.txt")\n solve()\n\n\nif __name__ == "__main__":\n main()\n', '# -*- coding: utf-8 -*-\nimport sys\nimport math\nimport os\nimport itertools\nimport string\nimport heapq\nimport _collections\nfrom collections import Counter\nfrom collections import defaultdict\nfrom collections import deque\nfrom functools import lru_cache\nimport bisect\nimport re\nimport queue\nimport copy\nimport decimal\n\n\nclass Scanner():\n @staticmethod\n def int():\n return int(sys.stdin.readline().rstrip())\n\n @staticmethod\n def string():\n return sys.stdin.readline().rstrip()\n\n @staticmethod\n def map_int():\n return [int(x) for x in Scanner.string().split()]\n\n @staticmethod\n def string_list(n):\n return [Scanner.string() for i in range(n)]\n\n @staticmethod\n def int_list_list(n):\n return [Scanner.map_int() for i in range(n)]\n\n @staticmethod\n def int_cols_list(n):\n return [Scanner.int() for i in range(n)]\n\n\ndef solve():\n S = Scanner.string()\n T = Scanner.string()\n ma = len(S) - len(T) + 1\n ans = len(T)\n for i in range(0, ma):\n cnt = 0\n for j in range(len(T)):\n if S[i + j] != T[j]:\n cnt += 1\n ans = min(ans, cnt)\n print(ans)\n\n\ndef main():\n \n \n solve()\n\n\nif __name__ == "__main__":\n main()\n'] | ['Runtime Error', 'Accepted'] | ['s115975376', 's245921591'] | [10600.0, 10604.0] | [41.0, 57.0] | [1307, 1309] |
p02571 | u304058693 | 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 = []\nfor i in range(len(t)):\n for k in range(i + 1, len(t) + 1):\n if t[i:k] in s[i:]:\n cnt.append(k - i)\n print(t[i:k], k - i)\n#print(cnt)\nprint(len(t) - max(cnt))\n', 's = input()\nt = input()\n\ncnt1 = 0\nif len(s) == len(t):\n for i in range(len(t)):\n if s[i] != t[i]:\n cnt1 += 1\nprint(cnt1)\nelse:\n cnt = []\n for i in range(len(t)):\n for k in range(i + 1, len(t) + 1):\n if t[i:k] in s[i:]:\n cnt.append(k - i)\n print(t[i:k], s[i:], k-i)\n else:\n cnt.append(0)\n \n#print(cnt)\nprint(len(t) - max(cnt))\n', 's = input()\nt = input()\n\ncnt1 = 0\nif len(s) == len(t):\n for i in range(len(t)):\n if s[i] != t[i]:\n cnt1 += 1\n print(cnt1)\nelse:\n cnt = []\n for i in range(len(t)):\n for k in range(i + 1, len(t) + 1):\n if t[i:k] in s[i:]:\n cnt.append(k - i)\n print(t[i:k], s[i:], k-i)\n else:\n cnt.append(0)\n \n#print(cnt)\n print(len(t) - max(cnt))\n', 's = input()\nt = input()\n\ncnt = []\nfor i in range(len(t)):\n for k in range(i + 1, len(t) + 1):\n if t[i:k] in s[i:]:\n cnt.append(k - i)\n else:\n cnt = [0]\n \n#print(cnt)\nprint(len(t) - max(cnt))\n', 's = input()\nt = input()\n\ncnt = []\nfor i in range(len(s) - len(t) + 1):\n cnt1 = 0\n for k in range(len(t)):\n if t[k] == s[i: i + len(t)][k]:\n cnt1 += 1\n cnt.append(cnt1)\n #print(t[i:k], s[i:], k-i)\n else:\n cnt.append(0)\n \n#print(cnt)\nprint(len(t) - max(cnt))\n'] | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s259929117', 's447591399', 's757511124', 's938006844', 's525678551'] | [147536.0, 8948.0, 131036.0, 21452.0, 14324.0] | [922.0, 23.0, 534.0, 468.0, 123.0] | [225, 463, 471, 262, 353] |
p02571 | u306033313 | 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 = len(t)\nflag = 0\nfor i in range(1, l+1):\n if flag == 1:\n break\n for j in range(i):\n if t[j:j+(l-i)+2] in s[j:len(s)-i+j]:\n flag = 1\n print(i-1)\n break\n\nif flag == 0:\n print(l)', 's = input()\nt = input()\n\nl = len(t)\nsame = 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 += 1\n if count > same:\n same = count\n\nprint(len(t) - same)'] | ['Wrong Answer', 'Accepted'] | ['s878135112', 's081385252'] | [9064.0, 8912.0] | [273.0, 70.0] | [259, 233] |
p02571 | u314350544 | 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\nT_length = len(T)\nmax_count = 0\n\nfor i in range(len(S)-T_length+1):\n count = 0\n for j in range(T_length):\n if S[i:i + T_length][j] == T[j]:\n count += 1\n else:\n if max_count > count:\n max_count = count\n\nprint(T_length - max_count)\n', 'S = list(input())\nT = list(input())\n\nT_length = len(T)\nmax_count = 0\n\nfor i in range(len(S)-T_length+1):\n count = 0\n for j in range(T_length):\n if S[i:i + T_length][j] == T[j]:\n count += 1\n else:\n if max_count < count:\n max_count = count\n\nprint(T_length - max_count)\n'] | ['Wrong Answer', 'Accepted'] | ['s266568103', 's688351809'] | [9016.0, 9060.0] | [472.0, 480.0] | [286, 286] |
p02571 | u317423698 | 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\n\ndef resolve(in_):\n S = next(in_).strip()\n T = next(in_).strip()\n\n x = 0\n for i in range(len(S)):\n if len(S) - i < len(T):\n break\n v = 0\n for x, y in zip(S[i:], T)\n if x == y:\n v += 1\n x = max(x, len(T) - v)\n \n return x\n \n\ndef main():\n answer = resolve(sys.stdin)\n print(answer)\n\n\nif __name__ == '__main__':\n main()\n", "import sys\n\n\ndef resolve(in_):\n S = next(in_).strip()\n T = next(in_).strip()\n\n ans = 0\n for i in range(len(S)):\n if len(S) - i < len(T):\n break\n v = 0\n for x, y in zip(S[i:], T):\n if x == y:\n v += 1\n ans = max(ans, v)\n \n return len(T) - ans\n \n\ndef main():\n answer = resolve(sys.stdin)\n print(answer)\n\n\nif __name__ == '__main__':\n main()\n"] | ['Runtime Error', 'Accepted'] | ['s238944312', 's033333149'] | [9036.0, 9028.0] | [23.0, 74.0] | [427, 436] |
p02571 | u321611522 | 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()\nlist1 = list()\ny = list()\nfor i in range(len(s)):\n if i < (len(s)-len(t)+1):\n list1.append(s[i:(i+len(t))])\nprint(list1)\nfor j in range(len(list1)):\n count = 0\n for k in range(len(t)):\n if list1[j][k] != t[k]:\n count = count + 1\n y.append(count)\nprint(min(y))\n', 's = input()\nt = input()\nlist1 = list()\ny = list()\nfor i in range(len(s)):\n if i < (len(s)-len(t)+1):\n list1.append(s[i:(i+len(t))])\nfor j in range(len(list1)):\n count = 0\n for k in range(len(t)):\n if list1[j][k] != t[k]:\n count = count + 1\n y.append(count)\nprint(min(y))\n'] | ['Wrong Answer', 'Accepted'] | ['s203564783', 's089181105'] | [9252.0, 9184.0] | [57.0, 57.0] | [321, 308] |
p02571 | u331606500 | 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()\nprint(len(t)-min(sum(x!=y for x,y in zip(s[i:],t))for i in range(-~len(s)-len(t))))', 's=input()\nt=input()\nprint(min(sum(x!=y for x,y in zip(s[i:],t))for i in range(-~len(s)-len(t))))'] | ['Wrong Answer', 'Accepted'] | ['s748926120', 's020385108'] | [9000.0, 9028.0] | [43.0, 45.0] | [103, 96] |
p02571 | u334242570 | 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 matcher(s1,s2):\n match=0\n for i in range(len(s1)):\n if(s1[i]!=s2[i]):\n match+=1\n \n return match\n\ns = input()\nst = input()\nmx=10**9\n\nrangeforloop= len(s)+1 - len(st)\n\nfor i in range(rangeforloop):\n if(mx> matcher(s[i:len(st)],st)):\n mx=matcher(s[i:len(st)],st)\n\nans = mx \nprint(ans)\n \n', 's = input()\nst = input()\nmx=10**5\n\nrangeforloop= len(s)+1 - len(st)\n \nfor i in range(rangeforloop):\n mx=min(mx,matcher(s[i:len(st)+i], st))\n \n \nprint(mx)', 's = input()\nst = input()\nmx=10**9\n\nrangeforloop= len(s)+1 - len(st)\n \nfor i in range(rangeforloop):\n mx=min(mx,matcher(s[i:len(st)+i], st))\n \n \nprint(mx)', 'from math import min\ns = input()\nst = input()\nmx=10**5\n\nrangeforloop= len(s)+1 - len(st)\n \nfor i in range(rangeforloop):\n mx=min(mx,matcher(s[i:len(st)+i], st))\n \n \nprint(mx)', 's = input()\nst = input()\nmx=10**9\n\nrangeforloop= len(s)+1 - len(st)\n \nfor i in range(rangeforloop):\n mx=min(mx,matcher(s[i:len(st)+i], st))\n \n \nprint(mx)', 's = input()\nst = input()\nmx=10**9\n\nrangeforloop= len(s)+1 - len(st)\n \nfor i in range(rangeforloop):\n mx=min(mx,matcher(s[i:len(st+i)], st))\n \n \nprint(mx)', 'def matcher(s1,s2):\n match=0\n for i in range(len(s1)):\n if(s1[i]!=s2[i]):\n match+=1\n \n return match\n\n\n\ns = input()\nst = input()\nmx=0\n \nrangeforloop= len(s)+1 - len(st)\n \nfor i in range(rangeforloop):\n if(mx < matcher(s[i:len(st)],st)):\n mx=matcher(s[i:len(st)],st)\n \n \nprint(mx)', 'def matcher(s1,s2):\n match=0\n for i in range(len(s1)):\n if(s1[i]!=s2[i]):\n match+=1\n \n return match\n\n#print(matcher("eforces","atcoder"))\n\ns = input()\nst = input()\nmx=10**5\n\nrangeforloop= len(s)+1 - len(st)\n \nfor i in range(rangeforloop):\n mx=min(mx,matcher(s[i:len(st)+i], st))\n \n \nprint(mx)'] | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s028605677', 's127957540', 's161556308', 's215393963', 's554661303', 's555297418', 's804593274', 's496277001'] | [9080.0, 8984.0, 9100.0, 9016.0, 9044.0, 9056.0, 9168.0, 9052.0] | [39.0, 24.0, 25.0, 25.0, 25.0, 23.0, 33.0, 39.0] | [338, 163, 163, 184, 163, 163, 324, 340] |
p02571 | u335406314 | 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=open(0).read().split()\ndef main():\n for i in range(1,len(T)+1):\n for j in range(i+1):\n print(T[j:(len(T)-i+j)], S[j:(len(S)-i+j)])\n if T[j:(len(T)-i+j)] in S[j:(len(S)-i+j)]:\n return i\n break\nif T in S:\n print(0)\nelse:\n print(main())', 'S,T=open(0).read().split()\nscore = 0\nfor i in range(len(S)-len(T)+1):\n score=max(score,sum([T[k]==S[i+k] for k in range(len(T))]))\nprint(len(T)-score)'] | ['Runtime Error', 'Accepted'] | ['s290244652', 's685297319'] | [137812.0, 9024.0] | [2353.0, 54.0] | [305, 153] |
p02571 | u345389118 | 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 len(S) == 1:\n if S == T:\n print(0)\n else:\n print(1)\n\nelse:\n l = []\n for i in range(len(S) - len(T) + 1):\n A = S[i:i + (len(T))]\n print(A)\n count = 0\n for j in range(len(A)):\n if A[j] == T[j]:\n count += 1\n print(count)\n l.append(count)\n\n print(l)\n if len(l) > 0:\n a = len(T) - max(l)\n print(a)\n else:\n a = 1\n print(a)\n', 'S = input()\nT = input()\n\nif len(S) == 1:\n if S == T:\n print(0)\n else:\n print(1)\n\nelse:\n l = []\n for i in range(len(S) - len(T) + 1):\n A = S[i:i + (len(T))]\n # print(A)\n count = 0\n for j in range(len(A)):\n if A[j] == T[j]:\n count += 1\n # print(count)\n l.append(count)\n\n # print(l)\n if len(l) > 0:\n a = len(T) - max(l)\n print(a)\n else:\n a = 1\n print(a)\n'] | ['Wrong Answer', 'Accepted'] | ['s934651801', 's537519365'] | [9032.0, 9148.0] | [143.0, 65.0] | [484, 490] |
p02571 | u350491208 | 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())\n\nlS = len(S)\nlT = len(T)\nq = 0\n\nprint(S,lS,T,lT)\n\nfor i in range(0,lS-lT+1):\n p = 0\n for j in range(0, lT):\n if S[i+j] == T[j]:\n p += 1\n print("p", p, "q", q)\n q = max(q, p)\nans = lT-q\nprint(ans)', 'S = str(input())\nT = str(input())\n\nlS = len(S)\nlT = len(T)\nq = 0\n\nfor i in range(0,lS-lT+1):\n p = 0\n for j in range(0, lT):\n if S[i+j] == T[j]:\n p += 1\n q = max(q, p)\nans = lT-q\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s069598095', 's922747163'] | [9148.0, 9068.0] | [77.0, 73.0] | [259, 215] |
p02571 | u355078864 | 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 sys import stdin\n\ndef check_str(s,t):\n com = 0\n print(s)\n for a,b in zip(s,t):\n if a == b:\n com += 1\n return com\n\ndef main():\n s = input()\n t = input()\n\n common = 0\n for i in range(len(s)):\n common = max(common, check_str(s[i:],t))\n\n print(len(t)-common)\n\n \nif __name__ == "__main__":\n main()', 'from sys import stdin\n\ndef check_str(s,t):\n com = 0\n if len(t) > len(s):\n return 0\n for a,b in zip(s,t):\n if a == b:\n com += 1\n return com\n\ndef main():\n s = input()\n t = input()\n\n common = 0\n for i in range(len(s)):\n common = max(common, check_str(s[i:],t))\n\n print(len(t)-common)\n\n \nif __name__ == "__main__":\n main()'] | ['Wrong Answer', 'Accepted'] | ['s665344836', 's244404403'] | [9204.0, 9072.0] | [61.0, 50.0] | [355, 383] |
p02571 | u365491796 | 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`. | ['# 171 B\nS = input()\nT = input()\nans = [0]\ntmp = 0\nfor i in range(0, (len(S)-len(T))):\n if S[i] == T[0]:\n for j in range(1, len(T)):\n if T[j] != S[i + j]:\n tmp += 1\n ans.append(tmp)\n \nprint(min(ans))\n ', "# 171 B\nS = input()\nT = input()\nans = []\nfor i in range(0, (len(S)-len(T) + 1)):\n tmp = 0\n #print(i)\n for j in range(0, len(T)):\n if T[j] != S[i +j]:\n tmp += 1\n print(S[i +j] + T[j])\n #print('tmp:' + str(tmp))\n ans.append(tmp)\n \nprint(min(ans))", "# 171 B\nS = input()\nT = input()\nans = []\nfor i in range(0, (len(S)-len(T) + 1)):\n tmp = 0\n #print(i)\n for j in range(0, len(T)):\n if T[j] != S[i +j]:\n tmp += 1\n #print(S[i +j] + T[j])\n #print('tmp:' + str(tmp))\n ans.append(tmp)\n \nprint(min(ans))"] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s467759141', 's666896239', 's997217953'] | [9072.0, 9100.0, 9056.0] | [57.0, 100.0, 57.0] | [257, 299, 300] |
p02571 | u366784601 | 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`. | ["main = input()\nword = input()\ntemp = main\nresultArray = []\nfinal = len(word)\nfor j in range(len(main) - (len(word) - 1)):\n result = ''\n for i in range(len(word)):\n if main[j + i] == word[i]:\n result += '1'\n else:\n result += '0'\n resultArray.append(result)\nfor i in resultArray:\n if i.count('0') < final:\n final = i.count('0')\nprint(resultArray)\nprint(final)\n", "main = input()\nword = input()\ntemp = main\nresultArray = []\nfinal = len(word)\nfor j in range(len(main) - (len(word) - 1)):\n result = ''\n for i in range(len(word)):\n if main[j + i] == word[i]:\n result += '1'\n else:\n result += '0'\n resultArray.append(result)\nfor i in resultArray:\n if i.count('0') < final:\n final = i.count('0')\nprint(final)\n"] | ['Wrong Answer', 'Accepted'] | ['s548826399', 's605413693'] | [9312.0, 9084.0] | [87.0, 94.0] | [413, 394] |
p02571 | u369133448 | 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\ns=input()\nt=input()\nli=[]\ncntli=[]\nn=len(t)\nfor i in range(1,1<<n):\n wk=""\n cnt=0\n for j in range(n):\n if (i>>j) & 1 == 1:\n wk+=t[j]\n else:\n wk+="."\n cnt+=1\n li.append(wk)\n cntli.append(cnt)\nans=n\nfor i in range(len(li)):\n if re.search(li[i],s):\n ans=cntli[i]\n break\nprint(ans)\n', 's=input()\nt=input()\nans=len(t)\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\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s606383016', 's922107167'] | [34044.0, 9028.0] | [2207.0, 68.0] | [321, 174] |
p02571 | u373956679 | 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\nfrom sys import stdin\ninput = stdin.readline\n\nINF = 10**9\n\ns = input()\nt = input()\nans = INF\nfor i in range(len(s) - len(t)):\n cnt = 0\n for j in range(len(t)):\n if (s[i+j] != t[j]): cnt += 1\n ans = min(cnt, ans)\nprint(ans)', 'import sys\nfrom sys import stdin\ninput = stdin.readline\n\nINF = 10**9\n\ns = input()\nt = input()\nans = 10**10\nls = len(s)\nlt = len(t)\nfor i in range(ls - lt + 1):\n cnt = 0\n for j in range(lt:\n if (s[i+j] != t[j]): cnt += 1\n ans = min(cnt, ans)\nprint(ans)', '# import sys\n# from sys import stdin\n# input = stdin.readline\n\nINF = 10**9\n\ns = input()\nt = input()\nans = 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 ans = min(ans, cnt)\nprint(ans)'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s481217689', 's803269816', 's516641197'] | [9024.0, 9012.0, 9036.0] | [63.0, 27.0, 57.0] | [239, 257, 256] |
p02571 | u375193358 | 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)\nelse:\n min = 1000\n for i in range(len(S)-len(T)):\n tmp = 0\n for j in range(len(T)):\n if S[j] != T[j]:\n tmp += 1\n if tmp < min:\n min = tmp\n print(min)', 'S = input()\nT = input()\n\nif T in S:\n print(0)\nelse:\n min = 1000\n for 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 if tmp < min:\n min = tmp\n print(min)'] | ['Wrong Answer', 'Accepted'] | ['s558694450', 's055172615'] | [9092.0, 8976.0] | [53.0, 62.0] | [265, 269] |
p02571 | u382639013 | 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\nfor i in range(len(s)-len(t)+1):\n if ans < count_ans(s[i:i+len(t)],t):\n ans = count_ans(s[i:i+len(t)],t)\n\nprint(len(t)-ans)', 's = input()\nt = input()\n\ndef count_ans(a,b):\n ans = 0\n for c1,c2 in zip(a, b):\n if c1 == c2:\n ans += 1\n return ans\n\nans = 0\nfor i in range(len(s)-len(t)+1):\n ans_ = count_ans(s[i:i+len(t)],t)\n if ans < ans_:\n ans = ans_\n\nprint(len(t)-ans)'] | ['Runtime Error', 'Accepted'] | ['s683261600', 's463781420'] | [9120.0, 9140.0] | [22.0, 47.0] | [166, 278] |
p02571 | u391725895 | 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 l in reversed(range(len(T))):\n length = l + 1\n #print(length)\n for start in range(len(T) - l):\n #print(T[start:start + length])\n if T[start:start + length] in S[start:start + length]:\n print(len(T) - length)\n #print(T[start:start + length])\n #print(S[start:])\n break\n elif l == 0 and start == len(T) - length and T[start:start + length] not in S[start:]:\n print(len(T))\n break\n else:\n continue\n break', 'S = input()\nT = input()\n\nans = len(T)\n\nfor S_start in range(len(S) - len(T) + 1):\n correct = 0\n for i in range(len(T)):\n if T[i] != S[S_start + i]:\n correct += 1\n ans = min(ans, correct)\n #print(ans)\n\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s447664172', 's762869953'] | [9068.0, 9020.0] | [362.0, 61.0] | [538, 241] |
p02571 | u401382183 | 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_cnt = 0\nfor i in range(len(S)-len(T)+1):\n print(i)\n cnt = 0\n for j in range(len(T)):\n if S[i+j] == T[j]:\n cnt += 1\n max_cnt = max(max_cnt, cnt)\nprint(len(T) - max_cnt)', 'S = input()\nT = input()\n\nmax_cnt = 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 max_cnt = max(max_cnt, cnt)\nprint(len(T) - max_cnt)'] | ['Wrong Answer', 'Accepted'] | ['s466444717', 's820911861'] | [9096.0, 9104.0] | [116.0, 119.0] | [210, 199] |
p02571 | u402492580 | 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().split("\\n")\n\ncnt = []\nfor i in range(len(S)-len(T)+1):\n\tmismatch = 0\n\tfor j in range(len(T)):\n\t\tif S[i+j] != T[j]:\n\t\t\tmismatch += 1\n\tcnt.append(mismatch)\n\t\nprint(min(cnt))\n\n\t\t\t', 'S = input()\nT = input()\n\ncnt = 0\nfor i in range(len(S)-len(T)+1):\n\tif S[i] == T[0]:\n\t\tfor j in 1 <= j <= len(T)+1:\n\t\t\tif S[i+j] != T[j]:\n\t\t\t\tcnt += 1\n\nprint(cnt)\n\n\t\t\t', 'S, T = input().split("\\n")\n\ncnt = []\nfor i in range(len(S)-len(T)+1):\n\t\n\tmismatch = 0\n\tfor j in range(len(T)):\n\t\tif S[i+j] != T[j]:\n\t\t\tmismatch += 1\n\tcnt.append(mismatch)\n\t\nprint(min(cnt))\n\n\t\t\t\n', 'S = input()\nT = input()\n \ncnt = []\nfor i in range(len(S)-len(T)+1):\n\tmismatch = 0\n\tfor j in range(len(T)):\n\t\tif S[i+j] != T[j]:\n\t\t\tmismatch += 1\n\tcnt.append(mismatch)\n\t\nprint(min(cnt))\n\n\t\t\t'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s002884678', 's133493917', 's672704965', 's346316555'] | [9036.0, 9068.0, 9084.0, 9036.0] | [24.0, 26.0, 25.0, 62.0] | [191, 166, 194, 190] |
p02571 | u404842368 | 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 S>=(T+2):\n countbox=[]\n for n in range(len(S)-2-len(T)+1):\n count =0\n for i in range(len(T)):\n if T[i] != S[i+n+1]:\n count+=1\n countbox.append(count)\n print(min(countbox))\nelse:\n print(0)', 'S = input()\nT = input()\n\nif len(S)==len(T):\n count=0\n for i in range(len(T)):\n if T[i] != S[i]:\n count+=1\n print(count)\n\nelse:\n countbox=[]\n for n in range(len(S)-len(T)+1):\n count =0\n for i in range(len(T)):\n if T[i] != S[i+n]:\n count+=1\n countbox.append(count)\n print(min(countbox))'] | ['Runtime Error', 'Accepted'] | ['s191530346', 's570049391'] | [9124.0, 8892.0] | [27.0, 65.0] | [274, 367] |
p02571 | u412177362 | 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\tp=s[i:i+len(t)]\n\tcur = 0\n\tfor j in range(len(t)):\n\t\tif t[j] != t[i + j]:\n\t\t\tcur += 1\t\n\tans=max(ans,cur)\nprint(ans)\n', 's=input()\nt=input()\nans=len(t)\nfor i in range(len(s)-len(t)+1):\n\tp=s[i:i+len(t)]\n\tcur = 0\n\tfor j in range(len(t)):\n\t\tif t[j] != p[j]:\n\t\t\tcur += 1\n\tans=min(ans,cur)\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s360774265', 's053476759'] | [8908.0, 9044.0] | [27.0, 56.0] | [180, 175] |
p02571 | u414050834 | 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())\nn=len(t)\nm=len(s)\nans=0\na=[]\nif t in s:\n print(0)\nelse:\n for i in range(m-n+1): \n for j in range(n):\n if s[i+j]!=t[j]:\n ans+=1\n a.append(ans)\n print(min(a))', 's=str(input())\nt=str(input())\nn=len(t)\nm=len(s)\na=[]\nif t in s:\n print(0)\nelse:\n for i in range(m-n+1): \n ans=0\n for j in range(n):\n if s[i+j]!=t[j]:\n ans+=1\n a.append(ans)\n print(min(a))'] | ['Wrong Answer', 'Accepted'] | ['s387137277', 's653114835'] | [9128.0, 9116.0] | [67.0, 59.0] | [226, 230] |
p02571 | u420780655 | 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,m=0,1e9\nwhile(i<len(s)):\n c=0\n if(i+len(t)<len(s)):\n for j in range(len(t)):\n if(s[i]!=t[j]):\n c+=1\n i+=1 \n else:\n break\n m=min(m,c)\nprint(m) \n ', 's=input()\nt=input()\ni,m=0,1e9\nwhile(i+len(t)<=len(s)):\n c=0\n for j in range(len(t)):\n if(s[i+j]!=t[j]):\n c+=1\n m=min(m,c)\n i+=1\nprint(m) \n '] | ['Wrong Answer', 'Accepted'] | ['s299426903', 's860269036'] | [9116.0, 9116.0] | [30.0, 60.0] | [238, 178] |
p02571 | u421674761 | 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\nfor i in range(s-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(ans,cnt)\n\nprint(len(t)-ans)\n', 's = input()\nt = input()\n\nans = 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 ans = max(ans,cnt)\n\nprint(len(t)-ans)\n'] | ['Runtime Error', 'Accepted'] | ['s078033466', 's227138497'] | [9008.0, 9084.0] | [23.0, 73.0] | [186, 196] |
p02571 | u423952743 | 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\tdiff = 0\n\tfor j in range(len(t)):\n\t\tif not s[i+j] == t[j]:\n\t\t\tdiff=diff+1\n\tprint(diff)\n\tans = min(ans, diff)\nprint(ans)', 's = input()\nt = input()\nans = len(t)\nfor i in range(len(s)-len(t)+1):\n\tdiff = 0\n\tfor j in range(len(t)):\n\t\tif not s[i+j] == t[j]:\n\t\t\tdiff=diff+1\n\tans = min(ans, diff)\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s248046986', 's985219706'] | [9032.0, 9068.0] | [63.0, 60.0] | [190, 177] |
p02571 | u427427681 | 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`. | ['\nS=input()\nT=input()\ncheck=[]\nfor i,tt in enumerate(T):\n check.append(0)\n for ss in S[i:-(len(T)-i)]:\n if ss==tt:\n check[i]+=1\n# print(check)\nprint(len(T)-max(check))', '\nS=input()\nT=input()\ncheck=[]\nfor i in range(len(S)-len(T)+1):\n check.append(0)\n for j,tt in enumerate(T):\n if tt==S[i+j]:\n check[i]+=1\n# print(check)\ncheck.append(0)\n# print(check)\nprint(len(T)-max(check))'] | ['Wrong Answer', 'Accepted'] | ['s396514507', 's956356668'] | [9104.0, 9120.0] | [57.0, 87.0] | [190, 230] |
p02571 | u432621419 | 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`. | ['\nS = input()\nT = input()\n\nlast = len(S) - len(T) + 1\nans = len(T)\n\nfor i in range(last):\n tent = 0\n for j in range(len(T)):\n if(S[i+j] != T[j]):\n tent += 1\n print(tent)\n if(tent < ans):\n ans = tent\nprint(ans)', '\nS = input()\nT = input()\n\nlast = len(S) - len(T) + 1\nans = len(T)\n\nfor i in range(last):\n tent = 0\n for j in range(len(T)):\n if(S[i+j] != T[j]):\n tent += 1\n if(tent < ans):\n ans = tent\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s908876470', 's024389419'] | [9116.0, 9048.0] | [65.0, 65.0] | [260, 244] |
p02571 | u433380437 | 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())\nl=0\nfor i in range(len(s)-len(t)+1):\n print(s[i:i+len(t)])\n p=0\n for j in range(len(t)):\n if t[j] == s[i:i+len(t)][j]:\n p+=1\n l=max(l,p)\nprint(len(t)-l)', 's=str(input())\nt=str(input())\nl=0\nfor i in range(len(s)-len(t)+1):\n p=0\n for j in range(len(t)):\n if t[j] == s[i:i+len(t)][j]:\n p+=1\n l=max(l,p)\nprint(len(t)-l)'] | ['Wrong Answer', 'Accepted'] | ['s379306271', 's292299991'] | [8984.0, 8932.0] | [107.0, 114.0] | [212, 187] |
p02571 | u447837274 | 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("")\ncnt = 0\n\nans = 10000\n\nfor i in range(len(s)-len(t)+1):\n S = s[i:i+len(t)]\n for j in range(len(t)):\n if S[j] != t[j]:\n cnt += 1\n \n ans = min(ans,cnt)\n \nprint(ans)', 's = input("")\nt = input("")\n\nans = 10000\n\nfor i in range(len(s)-len(t)+1):\n cnt = 0\n S = s[i:i+len(t)]\n for j in range(len(t)):\n if S[j] != t[j]:\n cnt += 1\n ans = min(ans,cnt)\n \nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s131348161', 's713147018'] | [8976.0, 8940.0] | [50.0, 51.0] | [222, 221] |
p02571 | u458967973 | 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()\nnum=len(s)-len(t)\nres=[]\nfor n1 in range(0,num+1):\n count=0\n for n2 in range(0,len(t)):\n if(t[n2]!=s[n1+n2]):\n count+=1\n print(count)\n res.append(count)\nprint(min(res))', 's=input()\nt=input()\nnum=len(s)-len(t)\nres=[]\nfor n1 in range(0,num+1):\n count=0\n for n2 in range(0,len(t)):\n if(t[n2]!=s[n1+n2]):\n count+=1\n res.append(count)\nprint(min(res))'] | ['Wrong Answer', 'Accepted'] | ['s826224904', 's975444582'] | [9044.0, 9116.0] | [58.0, 56.0] | [218, 201] |
p02571 | u459276984 | 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)\nprint(T)\n\nlens = len(S)\nlent = len(T)\n\nans = 1000000\n\nfor i in range(lens - lent):\n count = 0\n for j in range(lent):\n if(S[i+j] != T[j]):\n count = count + 1\n\n if count < ans:\n ans = count\n \nprint(ans)\n', 'S = input()\nT = input()\n\nprint(S)\nprint(T)\n\nlens = len(S)\nlent = len(T)\n\nans = 1000000\n\nfor i in range(lens - lent):\n count = 0\n for j in range(lent):\n if(S[i+j] != T[j]):\n count = count + 1\n\n if count < ans:\n ans = count\n \nprint(ans)', 'S = input()\nT = input()\n\nlens = len(S)\nlent = len(T)\n\nans = lent\n\nfor i in range(lens - lent + 1):\n count = 0\n for j in range(lent):\n if S[i+j] != T[j]:\n count = count + 1\n\n if count < ans:\n ans = count\n \nprint(ans)\n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s061808166', 's671729058', 's430044082'] | [9048.0, 9132.0, 9112.0] | [55.0, 62.0, 59.0] | [252, 251, 233] |
p02571 | u463594063 | 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()\nmaxi = 0 \nfor i in range(len(s)):\n maxG = 0\n print(s[i:len(t)+i])\n if len(s[i:len(t)+i]) >= len(t):\n for l, j in zip(s[i:len(t)+i], t):\n if l == j:\n maxG += 1\n maxi = max(maxi, maxG)\n else:\n break\nprint(len(t)-maxi)\n', 's = input()\nt = input()\nmaxi = 0 \nfor i in range(len(s)):\n maxG = 0\n print(s[i:len(t)+i])\n if len(s[i:len(t)+i]) >= len(t):\n for l, j in zip(s[i:len(t)+i], t):\n if l == j:\n maxG += 1\n maxi = max(maxi, maxG)\nprint(len(t)-maxi)\n', 's = input()\nt = input()\nmaxi = 0 \nfor i in range(len(s)):\n maxG = 0\n print(s[i:len(t)+i])\n if len(s[i:len(t)+i]) >= len(t):\n for l, j in zip(s[i:len(t)+i], t):\n if l == j:\n maxG += 1\n maxi = max(maxi, maxG)\n else:\n \tbreak\nprint(len(t)-maxi)\n', 's = input()\nt = input()\nmaxi = 0 \nfor i in range(len(s)):\n maxG = 0\n if len(s[i:len(t)+i]) >= len(t):\n for l, j in zip(s[i:len(t)+i], t):\n if l == j:\n maxG += 1\n maxi = max(maxi, maxG)\nprint(len(t)-maxi)\n'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s368384350', 's380708497', 's874867339', 's628353815'] | [9132.0, 9092.0, 8952.0, 9004.0] | [57.0, 63.0, 26.0, 58.0] | [299, 275, 299, 250] |
p02571 | u463893436 | 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 in range(len(s) - len(t) + 1):\n score = 0\n U = [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', 'Accepted'] | ['s628175735', 's681343631'] | [8884.0, 9004.0] | [31.0, 54.0] | [225, 226] |
p02571 | u464912173 | 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 = input()\nb = input()\n\nT=1000\nans = 0\nfor i in range(len(a)-len(b)+1):\n for j in range(len(b)):\n if a[i+j]=!b[j]:\n ans +=1\n ans = min(T, ans)\nprint(ans)\n \n ', 'a = input()\nb = input()\n\nT=1000\n\nfor i in range(len(a)-len(b)+1):\n ans = 0\n for j in range(len(b)):\n if a[i+j]!=b[j]:\n ans +=1\n T = min(T, ans)\nprint(T)'] | ['Runtime Error', 'Accepted'] | ['s809082258', 's533974561'] | [9020.0, 8912.0] | [24.0, 59.0] | [180, 163] |
Subsets and Splits