buggy_code stringlengths 11 625k | fixed_code stringlengths 17 625k | bug_type stringlengths 2 4.45k | language int64 0 8 | token_count int64 5 200k |
|---|---|---|---|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
S = input()
T = input()
SL = len(S)
TL = len(T)
X = SL - TL
min = SL
for i in range(X):
dif = 0
for j in range(TL):
if S[i+j] != T[j]:
dif += 1
if dif < min:
min = dif
print(min)
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
S = input()
T = input()
SL = len(S)
TL = len(T)
X = SL - TL + 1
min = SL
for i in range(X):
dif = 0
for j in range(TL):
if S[i+j] != T[j]:
dif += 1
if dif < min:
min = dif
# print(dif)
print(min)
| [["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 72], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612]] | 5 | 79 |
#include <bits/stdc++.h>
#include <iostream>
#define int long long int
#define vi vector<int>
#define vvi vector<vector<int>>
#define pii pair<int, int>
#define vpii vector<pair<int, int>>
#define mp make_pair
using namespace std;
int N = 1e6 + 3;
vi sieve(N, 1);
vi vis(N, 0);
void sievex(int n) {
int i, j;
sieve[1... | #include <bits/stdc++.h>
#include <iostream>
#define int long long int
#define vi vector<int>
#define vvi vector<vector<int>>
#define pii pair<int, int>
#define vpii vector<pair<int, int>>
#define mp make_pair
using namespace std;
int N = 1e6 + 3;
vi sieve(N, 1);
vi vis(N, 0);
void sievex(int n) {
int i, j;
sieve[1... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]] | 1 | 299 |
#include <bits/stdc++.h>
using namespace std;
#define bitCount(num) __builtin_popcount(num)
#define pb push_back
#define ll long long
#define bye return 0;
#define f(i, a, b) for (long long i = a; i < b; i++)
#define testCases \
long long t; ... | #include <bits/stdc++.h>
using namespace std;
#define bitCount(num) __builtin_popcount(num)
#define pb push_back
#define ll long long
#define bye return 0;
#define f(i, a, b) for (long long i = a; i < b; i++)
#define testCases \
long long t; ... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 167 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int res = 100000000, tmp;
for (int i = 0; i < (s.size() - t.size()); i++) {
if (s.substr(i, t.size()) == t) {
cout << 0 << endl;
return 0;
} else {
tmp = 0;
int index = i;
for (int j = ... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int res = 100000000, tmp;
for (int i = 0; i <= (s.size() - t.size()); i++) {
if (s.substr(i, t.size()) == t) {
cout << 0 << endl;
return 0;
} else {
tmp = 0;
int index = i;
for (int j =... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 158 |
s = gets.chomp.split("").map(&:to_s);
t = gets.chomp.split("").map(&:to_s);
n = (s.length) - (t.length)+1
time=Array.new(n+1,0)
for i in 0..n do
for j in 0..(t.length-1) do
if s[i+j] == t[j] then
time[i]+=1
end
end
end
p (t.length) - time.max
| s = gets.chomp.split("").map(&:to_s);
t = gets.chomp.split("").map(&:to_s);
n = (s.length) - (t.length)+1
time=Array.new(n,0)
for i in 0..n-1 do
for j in 0..(t.length-1) do
if s[i+j] == t[j] then
time[i]+=1
end
end
end
p (t.length) - time.max | [["-", 0, 662, 12, 652, 3, 4, 0, 738, 17, 72], ["-", 0, 662, 12, 652, 3, 4, 0, 738, 12, 612], ["+", 0, 88, 51, 267, 0, 475, 444, 738, 17, 33], ["+", 0, 88, 51, 267, 0, 475, 444, 738, 12, 612]] | 4 | 115 |
#include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>
typedef long long ll;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const... | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>
typedef long long ll;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const... | [["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72]] | 1 | 727 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void solve(std::string S, std::string T) {
int ans = (int)T.size();
for (int i = 0; i < S.size() - T.size(); i++) {
int cnt = 0;
for (int j = 0; j < T.size(); j++) {
if (S[i + j] != T[j])
cnt++;
}
ans = min(cnt, ans);... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void solve(std::string S, std::string T) {
int ans = (int)T.size();
for (int i = 0; i < S.size() - T.size() + 1; i++) {
int cnt = 0;
for (int j = 0; j < T.size(); j++) {
if (S[i + j] != T[j])
cnt++;
}
ans = min(cnt, a... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 161 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
long ans = 0;
cin >> s >> t;
for (long i = 0; i < s.length() - t.length(); i++) {
long counter = 0;
for (long j = i; j < i + t.length(); j++) {
if (s[j] == t[j - i]) {
counter++;
}
}
ans = max(ans, coun... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
long ans = 0;
cin >> s >> t;
for (long i = 0; i < s.length() - t.length() + 1; i++) {
long counter = 0;
for (long j = i; j < i + t.length(); j++) {
if (s[j] == t[j - i]) {
counter++;
}
}
ans = max(ans, ... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 128 |
s=input()
t=input()
a = len(s)
b = len(t)
c = a-b;
min1 = 0;
min2 = 0;
for i in range(c):
for j in range(b):
if s[j+i]==t[j]:
min2 += 1
if min1<min2:
min1 = min2
min2 =0
print(b-min1) | s=input()
t=input()
a = len(s)
b = len(t)
c = a-b;
min1 = 0;
min2 = 0;
for i in range(c+1):
for j in range(b):
if s[j+i]==t[j]:
min2 += 1
if min1<min2:
min1 = min2
min2 =0
print(b-min1) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 85 |
#include <iostream>
using namespace std;
#include <algorithm>
#include <string>
int main() {
string sStr, tStr;
cin >> sStr >> tStr;
int res = 100000000;
int temp = 0;
for (int i = 0; i < (int)sStr.length() - (int)tStr.length(); i++) {
temp = 0;
for (int j = 0; j < (int)tStr.length(); j++) {
if... | #include <iostream>
using namespace std;
#include <algorithm>
#include <string>
int main() {
string sStr, tStr;
cin >> sStr >> tStr;
int res = 1000;
int temp = 0;
for (int i = 0; i <= (int)sStr.length() - (int)tStr.length(); i++) {
temp = 0;
for (int j = 0; j < (int)tStr.length(); j++) {
if (sS... | [["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 132 |
import java.util.Scanner;
/* Name of the class has to be "Main" only if the class is public. */
public class Main {
public static void main(String[] args) throws java.lang.Exception {
try {
Scanner sc = new Scanner(System.in);
String s, t;
int c, m, i, j;
s = sc.nextLine();
t = sc.n... | import java.util.Scanner;
/* Name of the class has to be "Main" only if the class is public. */
public class Main {
public static void main(String[] args) throws java.lang.Exception {
try {
Scanner sc = new Scanner(System.in);
String s, t;
int c, m, i, j;
s = sc.nextLine();
t = sc.n... | [["-", 0, 246, 8, 196, 0, 1, 0, 11, 12, 499], ["+", 0, 246, 8, 196, 0, 1, 0, 11, 12, 499], ["-", 8, 196, 0, 1, 0, 492, 3, 4, 0, 22], ["+", 8, 196, 0, 1, 0, 492, 3, 4, 0, 22]] | 3 | 185 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int min = t.size();
for (int i = 0; i < s.size() - t.size(); i++) {
int cnt = 0;
for (int j = 0; j < t.size(); j++) {
if (s.at(i + j) != t.at(j)) {
cnt++;
}
}
if (min > cnt) {
min =... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int min = t.size();
for (int i = 0; i <= s.size() - t.size(); i++) {
int cnt = 0;
for (int j = 0; j < t.size(); j++) {
if (s.at(i + j) != t.at(j)) {
cnt++;
}
}
if (min > cnt) {
min ... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 124 |
S=list(map(str,input()))
T=list(map(str,input()))
X=[]
Z=0
for I in range(len(S)-len(T)):
Y=S[I:I+len(T)]
Z=0
for J in range(len(T)):
if Y[J]==T[J]:
Z=Z+1
X.append(Z)
if X ==True:
print(len(T)-max(X))
elif S==T:
print(0)
else:
print(len(T)) | S=list(map(str,input()))
T=list(map(str,input()))
X=[]
Z=0
for I in range(len(S)-len(T)+1):
Y=S[I:I+len(T)]
Z=0
for J in range(len(T)):
if Y[J]==T[J]:
Z=Z+1
X.append(Z)
if not X==[]:
print(len(T)-max(X))
elif S==T:
print(0)
else:
print(len(T)) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 36, 36, 0, 656, 0, 57, 15, 681, 0, 372], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 146], ["+", 0, 57, 15, 681, 28, 666, 0, 634, 0, 70], ["+", 0, 57, 15, 681, 28, 666, 0, 634, 0, 73]] | 5 | 133 |
S = input()
T = input()
LS = len(S)
LT = len(T)
L = []
if T in S:
print(0)
else:
for ls in range(LS - LT + 1):
d = 0
for lt in range(LT):
if S[ls] != T[lt]:
d += 1
L.append(d)
print(min(L)) | S = input()
T = input()
LS = len(S)
LT = len(T)
L = []
if T in S:
print(0)
else:
for ls in range(LS - LT + 1):
d = 0
for lt in range(LT):
if S[ls + lt] != T[lt]:
d += 1
L.append(d)
print(min(L))
| [["+", 0, 57, 15, 666, 0, 206, 206, 657, 17, 72], ["+", 0, 57, 15, 666, 0, 206, 206, 657, 12, 22]] | 5 | 87 |
#include <cstdio>
#include <cstring>
#define min(a, b) ((a) < (b) ? (a) : (b))
char s[1003], t[1003];
int lens, lent, ans = 1 << 30, sum;
int main() {
scanf("%s%s", s, t);
lens = strlen(s), lent = strlen(t);
for (int i = 0; i <= lens - lent + 1; i++) {
sum = 0;
for (int j = 0; j < lent; j++)
if (s[i... | #include <cstdio>
#include <cstring>
#define min(a, b) ((a) < (b) ? (a) : (b))
char s[1003], t[1003];
int lens, lent, ans = 1 << 30, sum;
int main() {
scanf("%s%s", s, t);
lens = strlen(s), lent = strlen(t);
for (int i = 0; i < lens - lent + 1; i++) {
sum = 0;
for (int j = 0; j < lent; j++)
if (s[i ... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18]] | 1 | 144 |
#define CPP17
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <complex>
#include <cstddef>
#include <deque>
#include <functional>
#include <initializer_list>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <numeric>... | #define CPP17
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <complex>
#include <cstddef>
#include <deque>
#include <functional>
#include <initializer_list>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <numeric>... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 876 |
#include <stdio.h>
#include <string.h>
int main(void) {
char s[1005];
char t[1005];
int lens;
int lent;
int cnt = 0;
int ans;
int i;
int j;
scanf("%s", s);
lens = strlen(s);
scanf("%s", t);
lent = strlen(t);
ans = lent;
// printf("%d, %d", lens, lent);
for (i = 0; i <= (lens - lent + 1... | #include <stdio.h>
#include <string.h>
int main(void) {
char s[1005];
char t[1005];
int lens;
int lent;
int cnt = 0;
int ans;
int i;
int j;
scanf("%s", s);
lens = strlen(s);
scanf("%s", t);
lent = strlen(t);
ans = lent;
// printf("%d, %d", lens, lent);
for (i = 0; i < (lens - lent + 1)... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18]] | 0 | 163 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
int main() {
string S, T;
cin >> S >> T;
int N = S.size();
int M = T.size();
vector<int> V;
int P = 0;
for (int i = 0; i < N - M + 1; i++) {
for (int j = 0; j < M; j++) {
if (S.at(i + j) == T.at(j))
P++;
}
... | #include <bits/stdc++.h>
using namespace std;
using ll = long long int;
int main() {
string S, T;
cin >> S >> T;
int N = S.size();
int M = T.size();
vector<int> V;
int P = 0;
for (int i = 0; i < N - M + 1; i++) {
for (int j = 0; j < M; j++) {
if (S.at(i + j) == T.at(j))
P++;
}
... | [["-", 0, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 13]] | 1 | 155 |
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
using namespace std;
int lt, ls, i, j, tt, ans = 0x7fffffff;
char s[1010], t[1010];
int main() {
scanf("%s%s", s + 1, t + 1);
ls = strlen(s + 1);
lt = strlen(t + 1);
for (i = 1; i <= ls - lt + 1; i+... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
using namespace std;
int lt, ls, i, j, tt, ans = 0x7fffffff;
char s[1010], t[1010];
int main() {
scanf("%s%s", s + 1, t + 1);
ls = strlen(s + 1);
lt = strlen(t + 1);
for (i = 1; i <= ls - lt + 1; i+... | [["-", 0, 7, 15, 16, 12, 16, 31, 16, 12, 22], ["+", 0, 7, 15, 16, 12, 16, 31, 16, 12, 22], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]] | 1 | 161 |
S = input()
T = input()
M = len(S)
N = len(T)
ans = N
diff = M - N
for i in range(diff + 1):
U = '0' * diff + T
count = N
for j in range(N + i):
if U[j] == S[j]:
count -= 1
ans = min(ans, count)
print(ans) | S = input()
T = input()
M = len(S)
N = len(T)
ans = N
diff = M - N
for i in range(diff + 1):
U = '0' * i + T
count = N
for j in range(N + i):
if U[j] == S[j]:
count -= 1
ans = min(ans, count)
print(ans) | [["-", 0, 1, 0, 662, 12, 657, 31, 657, 12, 22], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 12, 22]] | 5 | 88 |
#include <bits/stdc++.h>
using namespace std;
#define int long long
void Digvijay() {
string s, t;
cin >> s >> t;
int ans = 1e9;
for (int i = 0; i < s.length() - t.length(); i++) {
int cnt = 0;
for (int j = 0; j < t.length(); j++) {
if (s[i + j] != t[j])
cnt++;
}
ans = min(ans, cnt... | #include <bits/stdc++.h>
using namespace std;
#define int long long
void Digvijay() {
string s, t;
cin >> s >> t;
int ans = 1e9;
for (int i = 0; i <= s.length() - t.length(); i++) {
int cnt = 0;
for (int j = 0; j < t.length(); j++) {
if (s[i + j] != t[j])
cnt++;
}
ans = min(ans, cn... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 169 |
S = input()
T = input()
n = len(T)
if S.count(T) > 0:
print(0)
exit()
ans = n
for i in range(len(S) - len(T)):
s = S[i:i+n]
tmp = 0
for j in range(n):
if s[j] == T[j]:
tmp += 1
ans = min(ans, n - tmp)
print(ans)
| S = input()
T = input()
n = len(T)
if S.count(T) > 0:
print(0)
exit()
ans = n
for i in range(len(S) - n + 1):
s = S[i:i+n]
tmp = 0
for j in range(n):
if s[j] == T[j]:
tmp += 1
ans = min(ans, n - tmp)
print(ans)
| [["-", 12, 652, 3, 4, 0, 657, 12, 652, 63, 22], ["-", 3, 4, 0, 657, 12, 652, 3, 4, 0, 24], ["-", 3, 4, 0, 657, 12, 652, 3, 4, 0, 22], ["-", 3, 4, 0, 657, 12, 652, 3, 4, 0, 25], ["+", 12, 652, 3, 4, 0, 657, 31, 657, 12, 22], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 101 |
s=input()
t=input()
y=len(t)
z=len(s)
for i in range(0,(z-y+1)):
xx=i+y
s1=s[i:xx]
ct=0
yy=y
for j in range(0,y):
if(s1[j]==t[j]):
ct+=1
z=y-ct
if(z<yy):
yy=z
print(yy)
| s=input()
t=input()
y=len(t)
z=len(s)
yy=y
for i in range(0,(z-y+1)):
xx=i+y
s1=s[i:xx]
ct=0
for j in range(0,y):
if(s1[j]==t[j]):
ct+=1
z=y-ct
if(z<yy):
yy=z
print(yy)
| [["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 22], ["-", 0, 7, 8, 196, 0, 1, 0, 662, 31, 22], ["-", 0, 7, 8, 196, 0, 1, 0, 662, 0, 32], ["-", 0, 7, 8, 196, 0, 1, 0, 662, 12, 22]] | 5 | 102 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int ans = 0;
int now_max = 0;
for (int i = 0; i < s.length() - t.length(); i++) {
now_max = 0;
for (int j = 0; j < t.length(); j++) {
if (s[j + i] == t[j])
now_max++;
}
ans = max(ans, now_max... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int ans = 0;
int now_max = 0;
for (int i = 0; i < s.length() - t.length() + 1; i++) {
now_max = 0;
for (int j = 0; j < t.length(); j++) {
if (s[j + i] == t[j])
now_max++;
}
ans = max(ans, now... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 121 |
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
typedef long long int LL;
typedef pair<int, int> ... | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
typedef long long int LL;
typedef pair<int, int> ... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 470 |
#include <iostream>
#include <string>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
int main() {
string s = (char *)calloc(1000, sizeof(char));
string t = (char *)calloc(1000, sizeof(char));
cin >> s >> t;
int s_len = s.length(), t_len = t.length();
int dif = t_len;
for (int i = 0; i... | #include <iostream>
#include <string>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
int main() {
string s = (char *)calloc(1000, sizeof(char));
string t = (char *)calloc(1000, sizeof(char));
cin >> s >> t;
int s_len = s.length(), t_len = t.length();
int dif = t_len;
for (int i = 0; i... | [["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]] | 1 | 174 |
#include <bits/stdc++.h>
#define f(i, j, k) for (int i = j; i < k; i++)
using namespace std;
int main() {
long long ans = 0, ans2 = 0;
string s, t, d;
cin >> s >> t;
f(i, 0, s.size() - t.size()) {
d = s.substr(i, t.size());
ans2 = 0;
f(j, 0, t.size()) {
if (t[j] == d[j]) {
ans2++;
... | #include <bits/stdc++.h>
#define f(i, j, k) for (int i = j; i < k; i++)
using namespace std;
int main() {
long long ans = 0, ans2 = 0;
string s, t, d;
cin >> s >> t;
f(i, 0, s.size() - t.size() + 1) {
d = s.substr(i, t.size());
ans2 = 0;
f(j, 0, t.size()) {
if (t[j] == d[j]) {
ans2++;
... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 141 |
import math
s = input()
t = input()
res = len(t)
num =0
for i in range(len(s)-len(t)):
for j in range(len(t)):
if t[j]!=s[i+j]:
num+=1
res = min(res,num)
num = 0
print(res) | import math
s = input()
t = input()
res = len(t)
num =0
for i in range(len(s)-len(t)+1):
for j in range(len(t)):
if t[j]!=s[i+j]:
num+=1
res = min(res,num)
num = 0
print(res) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 79 |
//#pragma GCC optimize "trapv"
#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define sz(x) (long long)x.size()
#define debug(x) cout << #x << ':' << x << endl;
#define rep(i, n) for (int i = 0; i < n; i++)
#define reps(i, n) for (int i = 1; i <= n; i++)
#define make_unique(v) ... | //#pragma GCC optimize "trapv"
#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define sz(x) (long long)x.size()
#define debug(x) cout << #x << ':' << x << endl;
#define rep(i, n) for (int i = 0; i < n; i++)
#define reps(i, n) for (int i = 1; i <= n; i++)
#define make_unique(v) ... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18]] | 1 | 566 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int num, max = 0;
for (int i = 0; i < s.size() - t.size(); i++) {
num = 0;
for (int j = 0; j < t.size(); j++) {
if (s[i + j] == t[j])
num++;
if (num > max)
max = num;
}
}
cout <... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int num, max = 0;
for (int i = 0; i < s.size() - t.size() + 1; i++) {
num = 0;
for (int j = 0; j < t.size(); j++) {
if (s[i + j] == t[j])
num++;
if (num > max)
max = num;
}
}
co... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 122 |
#include <bits/stdc++.h>
using namespace std;
int str_distance(int n, string s, string t) {
int d = 0;
for (int i = 0; i < n; i++) {
if (s.at(i) != t.at(i)) {
d++;
}
}
return d;
}
int main() {
string s, t;
cin >> s >> t;
int ans = 1000;
for (unsigned long int i = 0; i < s.size() - t.size... | #include <bits/stdc++.h>
using namespace std;
int str_distance(int n, string s, string t) {
int d = 0;
for (int i = 0; i < n; i++) {
if (s.at(i) != t.at(i)) {
d++;
}
}
return d;
}
int main() {
string s, t;
cin >> s >> t;
int ans = 1000;
for (unsigned long int i = 0; i <= s.size() - t.siz... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 180 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int ss, ts;
ss = s.size();
ts = t.size();
int ans = ts;
for (int i = 0; i < ss - ts; i++) { // sのそれぞれに対して
int k = ts;
for (int j = 0; j < ts; j++) {
if (s.at(i + j) == t.at(j)) {
k--;
}
... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int ss, ts;
ss = s.size();
ts = t.size();
int ans = ts;
for (int i = 0; i < ss - ts + 1; i++) { // sのそれぞれに対して
int k = ts;
for (int j = 0; j < ts; j++) {
if (s.at(i + j) == t.at(j)) {
k--;
}
... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 127 |
S=input()
T=input()
k = len(T)
ans=k
lim=0
for i in range(len(S)-len(T)+1):
for j in range(k):
if S[i+j]==T[j]:
lim+=1
if lim<=ans:
ans=len(T)-lim
lim=0
print(ans) | S=input()
T=input()
k = len(T)
ans=k
lim=0
for i in range(len(S)-len(T)+1):
for j in range(k):
#print(i, j, S[i+j],T[j])
if S[i+j]!=T[j]:
lim+=1
if lim<=ans:
ans=lim
lim=0
print(ans) | [["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 60], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 79], ["-", 0, 1, 0, 662, 12, 657, 31, 652, 63, 22], ["-", 0, 662, 12, 657, 31, 652, 3, 4, 0, 24], ["-", 0, 662, 12, 657, 31, 652, 3, 4, 0, 22], ["-", 0, 662, 12, 657, 31, 652, 3, 4, 0, 25], ["-", 64, 196, 0, 1, 0, 662, 12, 657, 17, ... | 5 | 84 |
import java.io.*;
import java.util.*;
public class Main {
static BufferedReader s1;
static BufferedWriter out;
static String read() throws IOException {
String line = "";
while (line.length() == 0) {
line = s1.readLine();
continue;
}
return line;
}
static int int_v(String s1) { r... | import java.io.*;
import java.util.*;
public class Main {
static BufferedReader s1;
static BufferedWriter out;
static String read() throws IOException {
String line = "";
while (line.length() == 0) {
line = s1.readLine();
continue;
}
return line;
}
static int int_v(String s1) { r... | [["+", 0, 57, 15, 15, 0, 16, 31, 16, 17, 33], ["+", 0, 57, 15, 15, 0, 16, 31, 16, 12, 499]] | 3 | 546 |
#include <iostream>
#include <limits.h>
#include <string>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int mn = INT_MAX;
for (int i = 0; i < s.length() - t.length(); i++) {
int temp = i;
int count = 0;
for (int j = 0; j < t.length(); j++) {
if (temp >= s.length()) {
b... | #include <iostream>
#include <limits.h>
#include <string>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int mn = INT_MAX;
for (int i = 0; i <= (s.length() - t.length()); i++) {
int temp = i;
int count = 0;
for (int j = 0; j < t.length(); j++) {
if (temp >= s.length()) {
... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 8, 9, 0, 7, 15, 16, 12, 23, 0, 24], ["+", 12, 23, 0, 16, 12, 2, 3, 4, 0, 25]] | 1 | 155 |
package main
import (
"fmt"
)
func main() {
var S string
fmt.Scanf("%s", &S)
var T string
fmt.Scanf("%s", &T)
var max = 0
for n:=0 ; n < len(S) - len(T); n++{
var count = 0
var str = S[n:n+len(T)]
for i:=0; i < len(T); i++{
if T[i] == str[i]{
count += 1
}
}
if max < count{
max = c... | package main
import (
"fmt"
)
func main() {
var S string
fmt.Scanf("%s", &S)
var T string
fmt.Scanf("%s", &T)
var max = 0
for n:=0 ; n < len(S) - len(T) +1; n++{
var count = 0
var str = S[n:n+len(T)]
for i:=0; i < len(T); i++{
if T[i] == str[i]{
count += 1
}
}
if max < count{
max =... | [["+", 0, 7, 0, 430, 15, 16, 12, 16, 17, 72], ["+", 0, 7, 0, 430, 15, 16, 12, 16, 12, 433]] | 7 | 158 |
#include <algorithm>
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
const int MAXN = 1e6 + 10;
typedef long long LL;
int main() {
string s, t;
cin >> s >> t;
LL ans;
int lens = s.size();
int lent = t.size();
ans = lens;
for (int i = 0; i + lent < lens; ++i) {
LL cnt = ... | #include <algorithm>
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
const int MAXN = 1e6 + 10;
typedef long long LL;
int main() {
string s, t;
cin >> s >> t;
LL ans;
int lens = s.size();
int lent = t.size();
ans = lens;
for (int i = 0; i + lent <= lens; ++i) {
LL cnt =... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 145 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double dl;
typedef unsigned long long ull;
#define pb push_back
#define PB pop_back
#define nn "\n"
#define O_O \
ios_base::sync_with_stdio(false); ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double dl;
typedef unsigned long long ull;
#define pb push_back
#define PB pop_back
#define nn "\n"
#define O_O \
ios_base::sync_with_stdio(false); ... | [["+", 8, 9, 0, 7, 15, 16, 12, 23, 0, 24], ["+", 15, 16, 12, 23, 0, 16, 31, 16, 17, 33], ["+", 15, 16, 12, 23, 0, 16, 31, 16, 12, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 23, 0, 25]] | 1 | 376 |
#include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <string.h>
using namespace std;
#define pb push_back
#define all(v) v.begin(), v.end()
#define rep(i, n, v) for (i = n; i < v; i++)
#define per(i, n, v) for (i = n; i > v; i--)
#define ff first
#define ss seco... |
#include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <string.h>
using namespace std;
#define pb push_back
#define all(v) v.begin(), v.end()
#define rep(i, n, v) for (i = n; i < v; i++)
#define per(i, n, v) for (i = n; i > v; i--)
#define ff first
#define ss seco... | [["-", 0, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 0, 9, 0, 1, 0, 2, 3, 4, 0, 13]] | 1 | 265 |
package main
import (
"fmt"
"strings"
)
func main() {
var s string
var t string
fmt.Scan(&s)
fmt.Scan(&t)
sliceS := strings.Split(s, "")
sliceT := strings.Split(t, "")
i := 0
ans := len(sliceT)
count := 0
for {
count = 0
for j := 0; j < len(sliceT); j++ {
if sliceS[j+i] != sliceT[j] {
count++
... | package main
import (
"fmt"
"strings"
)
func main() {
var s string
var t string
fmt.Scan(&s)
fmt.Scan(&t)
sliceS := strings.Split(s, "")
sliceT := strings.Split(t, "")
i := 0
ans := len(sliceT)
count := 0
for {
count = 0
for j := 0; j < len(sliceT); j++ {
if sliceS[j+i] != sliceT[j] {
count++
... | [["-", 36, 36, 0, 434, 0, 435, 8, 196, 0, 165], ["+", 36, 36, 0, 434, 0, 435, 8, 196, 0, 165], ["+", 0, 57, 15, 16, 31, 16, 12, 23, 0, 24], ["-", 0, 57, 15, 16, 31, 16, 12, 16, 17, 48], ["+", 15, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 0, 57, 15, 16, 31, 16, 12, 23, 0, 25]] | 7 | 168 |
#include <iostream>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int ans = 0;
int cnt = 0;
for (int i = 0; i < s.size() - t.size(); ++i) {
for (int j = 0; j < t.size(); ++j) {
if (s[i + j] == t[j])
++cnt;
}
ans = max(ans, cnt);
cnt = 0;
}
cout << t.size() ... | #include <iostream>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int ans = 0;
int cnt = 0;
for (int i = 0; i < s.size() - t.size() + 1; ++i) {
for (int j = 0; j < t.size(); ++j) {
if (s[i + j] == t[j])
++cnt;
}
ans = max(ans, cnt);
cnt = 0;
}
cout << t.siz... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 121 |
#include <stdio.h>
#include <string.h>
int main() {
char S[1000], T[1000];
int num, ans, i, j;
scanf("%s", S);
scanf("%s", T);
int s = strlen(S);
int t = strlen(T);
for (i = 0; i < s - t; i++) {
num = 0;
for (j = 0; j < t; j++) {
if (S[i + j] == T[j])
num++;
}
if (num > ... | #include <stdio.h>
#include <string.h>
int main() {
char S[1000], T[1000];
int num, ans, i, j;
ans = 0;
scanf("%s", S);
scanf("%s", T);
int s = strlen(S);
int t = strlen(T);
for (i = 0; i <= s - t; i++) {
num = 0;
for (j = 0; j < t; j++) {
if (S[i + j] == T[j])
num++;
}
... | [["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 0 | 142 |
#include <bits/stdc++.h>
using namespace std;
int minimumChange(string S, string T) {
int n = S.length(), m = T.length();
int ans = 999999;
for (int i = 0; i < m - n + 1; i++) {
int minchg = 0;
for (int j = 0; j < n; j++) {
if (S[j] != T[i + j]) {
minchg++;
}
}
ans = min(minchg... | #include <bits/stdc++.h>
using namespace std;
int minimumChange(string S, string T) {
int n = S.length(), m = T.length();
int ans = 999999;
for (int i = 0; i < m - n + 1; i++) {
int minchg = 0;
for (int j = 0; j < n; j++) {
if (S[j] != T[i + j]) {
minchg++;
}
}
ans = min(minchg... | [["-", 8, 9, 0, 1, 0, 2, 63, 118, 28, 22], ["-", 8, 9, 0, 1, 0, 2, 63, 118, 17, 131], ["-", 8, 9, 0, 1, 0, 2, 63, 118, 119, 120], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]] | 1 | 152 |
a = input()
b = input()
l = []
for i in range(len(a) - len(b) + 1):
cnt = 0
for j in range(len(b)):
if b[j] == a[i + j]:
cnt += 1
l.append(cnt)
print(l)
print(len(b) - max(l)) | a = input()
b = input()
l = []
for i in range(len(a) - len(b) + 1):
cnt = 0
for j in range(len(b)):
if b[j] == a[i + j]:
cnt += 1
l.append(cnt)
#print(l)
print(len(b) - max(l)) | [["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25], ["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24]] | 5 | 84 |
#include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t = 1;
/*is Single Test case?*/
while (t--) {
solve();
cout << "\n";
}
cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
return 0;
}
void s... | #include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t = 1;
/*is Single Test case?*/
while (t--) {
solve();
cout << "\n";
}
cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
return 0;
}
void s... | [["+", 51, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["+", 51, 16, 12, 69, 341, 342, 0, 16, 12, 22]] | 1 | 191 |
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return... | #!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return... | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 402 |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
String S = stdin.readLine();
String T = stdin.readLine... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
String S = stdin.readLine();
String T = stdin.readLine... | [["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]] | 3 | 238 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int c = INT_MAX;
for (int i = 0; i < (s.length() - t.length()); i++) {
int k = i;
int c1 = 0;
for (int j = 0; j < t.length(); j++) {
if (s[k] != t[j])
c1++;
k++;
}
c = min(c, c1);
}... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int c = INT_MAX;
for (int i = 0; i < (s.length() - t.length() + 1); i++) {
int k = i;
int c1 = 0;
for (int j = 0; j < t.length(); j++) {
if (s[k] != t[j])
c1++;
k++;
}
c = min(c, c1);... | [["+", 0, 7, 15, 16, 12, 23, 0, 16, 17, 72], ["+", 0, 7, 15, 16, 12, 23, 0, 16, 12, 13]] | 1 | 119 |
s = input()
t = input()
n = len(t)
ans = 100100100100
for i in range(len(s)-n):
cnt = 0
a = s[i:i+n]
for j in range(n):
if t[j] != a[j]:
cnt += 1
ans = min(ans,cnt)
print(ans) | s = input()
t = input()
n = len(t)
ans = 100100100100
for i in range(len(s)-n+1):
cnt = 0
a = s[i:i+n]
for j in range(n):
if t[j] != a[j]:
cnt += 1
ans = min(ans,cnt)
print(ans)
| [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 79 |
S = input()
T = input()
MIN = len(T)
while len(T) < len(S):
cnt = 0
for(SL,TL) in zip(list(S),list(T)):
if SL != TL:
cnt = cnt + 1
if MIN > cnt:
MIN = cnt
S = S[1:]
print(MIN) | S = input()
T = input()
MIN = len(T)
while len(T) <= len(S):
cnt = 0
for(SL,TL) in zip(list(S),list(T)):
if SL != TL:
cnt = cnt + 1
if MIN > cnt:
MIN = cnt
S = S[1:]
print(MIN) | [["-", 36, 36, 0, 656, 0, 52, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 52, 15, 666, 667, 19]] | 5 | 79 |
S = input()
T = input()
length_s, length_t = len(S), len(T)
dif = length_s-length_t
res = 0
for i in range(dif):
st = sum(1 if s == t else 0 for s, t in zip(S[i:i+length_t], T))
res = max(res, st)
print(length_t-res) | S = input()
T = input()
length_s, length_t = len(S), len(T)
dif = length_s-length_t+1
res = 0
for i in range(dif):
st = sum(1 if s == t else 0 for s, t in zip(S[i:i+length_t], T))
res = max(res, st)
print(length_t-res) | [["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 72], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612]] | 5 | 83 |
def check(S,T,i):
count=0
for j in range(i,len(T)+i):
if S[j] == T[j-i]:
count+=1
return count
S=input()
T=input()
b=[]
for i in range(0,len(S)-len(T)+1):
b.append(check(S,T,i))
b.sort()
print(b[0])
| def check(S,T,i):
count=0
for j in range(i,len(T)+i):
if S[j] != T[j-i]:
count+=1
return count
S=input()
T=input()
b=[]
for i in range(0,len(S)-len(T)+1):
b.append(check(S,T,i))
b.sort()
print(b[0])
| [["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 60], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 79]] | 5 | 105 |
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <queue>
#include <set>
#include <vector>
#define fo(i, n) for (ll i = 0; i < n; i++)
#define f(i, n) for (ll i = 1; i < n; i++)
#define ff(i, k, n) for (ll i = k; i < n; i++)
#define ll long long
#define vt vector<ll>
#define pb(x) pu... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <queue>
#include <set>
#include <vector>
#define fo(i, n) for (ll i = 0; i < n; i++)
#define f(i, n) for (ll i = 1; i < n; i++)
#define ff(i, k, n) for (ll i = k; i < n; i++)
#define ll long long
#define vt vector<ll>
#define pb(x) pu... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 168 |
s = str(input())
t = str(input())
cnt = 0
s_len = len(s)
t_len = len(t)
sa = s_len - t_len
Max = 0
for i in range(len(s) - len(t) - 1):
ss = s[i:i+len(t)]
for j in range(len(t)):
if ss[j] == t[j]:
cnt += 1
Max = max(Max,cnt)
cnt = 0
print(len(t) - Max) | s = str(input())
t = str(input())
cnt = 0
s_len = len(s)
t_len = len(t)
sa = s_len - t_len
Max = 0
for i in range(len(s) - len(t) + 1):
ss = s[i:i+len(t)]
for j in range(len(t)):
if ss[j] == t[j]:
cnt += 1
Max = max(Max,cnt)
cnt = 0
print(len(t) - Max)
| [["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72]] | 5 | 115 |
s = gets.chomp
t = gets.chomp
tlength = t.length
min = tlength
(s.length - tlength).times{|i|
diff = tlength
ss = s[i .. i + tlength - 1]
tlength.times{|j|
diff -= 1 if ss[j] == t[j]
}
min = diff if min > diff
}
puts min
| s = gets.chomp
t = gets.chomp
tlength = t.length
min = tlength
(s.length - tlength + 1).times{|i|
diff = tlength
ss = s[i .. i + tlength - 1]
tlength.times{|j|
# p [s, t, ss, i, j, ss[j], t[j]]
diff -= 1 if ss[j] == t[j]
}
min = diff if min > diff
}
puts min
| [["+", 0, 493, 0, 652, 486, 739, 0, 738, 17, 72], ["+", 0, 493, 0, 652, 486, 739, 0, 738, 12, 612]] | 4 | 77 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vll vector<ll>
#define pll pair<ll, ll>
#define forA(i, a, n, x) for (auto i = a; i < n; i += x)
#define forD(i, a, n, x) for (auto i = n - 1; i >= 0; i -= x)
#define ranit(it, n) for (auto it : n)
#define testCases ... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vll vector<ll>
#define pll pair<ll, ll>
#define forA(i, a, n, x) for (auto i = a; i < n; i += x)
#define forD(i, a, n, x) for (auto i = n - 1; i >= 0; i -= x)
#define ranit(it, n) for (auto it : n)
#define testCases ... | [["+", 51, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["+", 51, 16, 12, 69, 341, 342, 0, 16, 12, 22]] | 1 | 206 |
s=str(input())
t=str(input())
n=len(t)
m=len(s)
ans=0
a=[]
if t in s:
print(0)
else:
for i in range(m-n+1): #ずらす文字数
for j in range(n):
if s[i+j]!=t[j]:
ans+=1
a.append(ans)
print(min(a)) | s=str(input())
t=str(input())
n=len(t)
m=len(s)
a=[]
if t in s:
print(0)
else:
for i in range(m-n+1): #ずらす文字数
ans=0
for j in range(n):
if s[i+j]!=t[j]:
ans+=1
a.append(ans)
print(min(a)) | [["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["-", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 12, 612]] | 5 | 96 |
S = input()
T = input()
ls = len(S)
lt = len(T)
ans = lt
for i in range(0,ls-lt+1):
m = 0
for j in range(lt):
if S[i:i+lt][j]!=T[j]:
m += 1
ans = min(lt,m)
print(ans) | S = input()
T = input()
ls = len(S)
lt = len(T)
ans = lt
for i in range(0,ls-lt+1):
m = 0
for j in range(lt):
if S[i:i+lt][j]!=T[j]:
m += 1
ans = min(ans,m)
print(ans) | [["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22]] | 5 | 83 |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
char[] c1 = sc.next().toCharArray();
char[] c2 = sc.next().toCharArray();
int num1 = c1.length;
int num2 = c2.length;
int count = 0;
for (int i = 0; i < (num1 - num2); i+... | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
char[] c1 = sc.next().toCharArray();
char[] c2 = sc.next().toCharArray();
int num1 = c1.length;
int num2 = c2.length;
int count = 0;
for (int i = 0; i < (num1 - num2 + 1)... | [["+", 0, 7, 15, 16, 12, 23, 0, 16, 17, 72], ["+", 0, 7, 15, 16, 12, 23, 0, 16, 12, 499]] | 3 | 171 |
#include <algorithm>
#include <assert.h>
#include <climits>
#include <cmath>
#include <iostream>
#include <queue>
#include <unordered_map>
#include <vector>
using namespace std;
constexpr uint64_t INF = 1e18;
int main() {
std::cin.tie(0);
std::ios::sync_with_stdio(false);
string S, T;
cin >> S;
cin >> T;
... | #include <algorithm>
#include <assert.h>
#include <climits>
#include <cmath>
#include <iostream>
#include <queue>
#include <unordered_map>
#include <vector>
using namespace std;
constexpr uint64_t INF = 1e18;
int main() {
std::cin.tie(0);
std::ios::sync_with_stdio(false);
string S, T;
cin >> S;
cin >> T;
... | [["+", 8, 9, 0, 7, 15, 16, 31, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 31, 16, 12, 13]] | 1 | 168 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string a, b;
cin >> a >> b;
int c = a.size() - b.size(), d = b.size();
int ans = 10000;
for (int i = 0; i < c; i++) {
int cnt = 0;
for (int j = i; j < i + d; j++) {
if (a[j] != b[j - i]) {
cnt++;
}
if (j == i + d - ... | #include <bits/stdc++.h>
using namespace std;
int main() {
string a, b;
cin >> a >> b;
int c = a.size() - b.size(), d = b.size();
int ans = 10000;
for (int i = 0; i <= c; i++) {
int cnt = 0;
for (int j = i; j < i + d; j++) {
if (a[j] != b[j - i]) {
cnt++;
}
if (j == i + d -... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 136 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
string s, t;
cin >> s >> t;
int ans = 1005;
rep(i, s.size() - t.size()) {
int a = 0;
rep(j, t.size()) {
if (s.at(i + j) != t.at(j)) {
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
string s, t;
cin >> s >> t;
int ans = 1005;
rep(i, s.size() - t.size() + 1) {
int a = 0;
rep(j, t.size()) {
if (s.at(i + j) != t.at(j)) {
... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 130 |
#include <iostream>
#include <string>
using namespace std;
int main() {
string a, b;
cin >> a >> b;
int ans = 2147483647;
for (long unsigned int i = 0; i < a.size() - b.size(); i++) {
int num = 0;
for (long unsigned int j = 0; j < b.size(); j++)
if (a[i + j] != b[j])
num++;
ans = min(a... | #include <iostream>
#include <string>
using namespace std;
int main() {
string a, b;
cin >> a >> b;
int ans = 2147483647;
for (long unsigned int i = 0; i <= a.size() - b.size(); i++) {
int num = 0;
for (long unsigned int j = 0; j < b.size(); j++)
if (a[i + j] != b[j])
num++;
ans = min(... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 118 |
#include <stdio.h>
int main() {
char s[1002] = {0}, t[1002] = {0};
int i, n, cnt_t = 0, cnt_s = 0, min, num;
///読み込み
scanf("%s", &s);
scanf("%s", &t);
// tの文字数カウント
for (i = 0; t[i] != 0; i++, cnt_t++)
;
// sの文字数カウント
for (i = 0; s[i] != 0; i++, cnt_s++)
;
//最初の最小値は最悪の数字
min = cnt_t;
//メ... | #include <stdio.h>
int main() {
char s[1002] = {0}, t[1002] = {0};
int i, n, cnt_t = 0, cnt_s = 0, min, num;
///読み込み
scanf("%s", &s);
scanf("%s", &t);
// tの文字数カウント
for (i = 0; t[i] != 0; i++, cnt_t++)
;
// sの文字数カウント
for (i = 0; s[i] != 0; i++, cnt_s++)
;
//最初の最小値は最悪の数字
min = cnt_t;
//メ... | [["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]] | 1 | 198 |
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define all(x) (x).begin(), (x).end()
using ll = long long;
using namespace std;
template <typename T> using vec = std::vector<T>;
int main() {
string S;
string T;
cin >> S >> T;
int s = S.size();
int t = T.size();
ll mx = 0;
rep(i,... | #include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define all(x) (x).begin(), (x).end()
using ll = long long;
using namespace std;
template <typename T> using vec = std::vector<T>;
int main() {
string S;
string T;
cin >> S >> T;
int s = S.size();
int t = T.size();
ll mx = 0;
rep(i,... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 144 |
xmoji=input()
ymoji=input()
x=len(xmoji)
y=len(ymoji)
tempmin = 0
for i in range(0,x-y+1):
xmin=xmoji[i:i+y]
samenum=0
for j in range(0,y-1):
if(xmin[j]==ymoji[j]):
samenum+=1
if(tempmin<samenum):
tempmin = samenum
print(y-tempmin) | xmoji=input()
ymoji=input()
x=len(xmoji)
y=len(ymoji)
tempmin = 0
for i in range(0,x-y+1):
xmin=xmoji[i:i+y]
samenum=0
for j in range(0,y):
if(xmin[j]==ymoji[j]):
samenum+=1
if(tempmin<samenum):
tempmin = samenum
print(y-tempmin) | [["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 96 |
ss = str(input())
tt = str(input())
#print(ss,tt)
maxmatch = 0
#
for i in range(len(ss)-len(tt)):
nofmatch = 0
for j in range(len(tt)):
if ss[i+j] == tt[j]:
nofmatch += 1
if nofmatch > maxmatch:
maxmatch = nofmatch
print(len(tt)-maxmatch) | ss = str(input())
tt = str(input())
#print(ss,tt)
maxmatch = 0
#
for i in range(len(ss)-len(tt)+1):
nofmatch = 0
for j in range(len(tt)):
#print(ss[i + j], tt[j])
if ss[i+j] == tt[j]:
nofmatch += 1
if nofmatch > maxmatch:
maxmatch = nofmatch
print(len(tt)-maxmatch) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 84 |
# from pprint import pprint
# import math
# import collections
s = input()
t = input()
# n, k = map(int, input().split(' '))
# a = list(map(int, input().split(' ')))
max_cnt = 0
for i in range(len(s) - len(t)):
_s = s[i:i + len(t)]
cnt = 0
for j in range(len(t)):
if _s[j] == t[j]:
cnt... | # from pprint import pprint
# import math
# import collections
s = input()
t = input()
# n, k = map(int, input().split(' '))
# a = list(map(int, input().split(' ')))
max_cnt = 0
for i in range(len(s) - len(t) + 1):
_s = s[i:i + len(t)]
cnt = 0
for j in range(len(t)):
if _s[j] == t[j]:
... | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 93 |
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
int min = 10007, count;
string s, t;
cin >> s;
cin >> t;
for (int i = 0; i < s.length() - t.length(); i++) {
count = 0;
for (int j = 0; j < t.length(); j++) {
if (s[i + j] != t[j]) {
count++;
}
}
... | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
int min = 10007, count;
string s, t;
cin >> s;
cin >> t;
for (int i = 0; i <= s.length() - t.length(); i++) {
count = 0;
for (int j = 0; j < t.length(); j++) {
if (s[i + j] != t[j]) {
count++;
}
}
... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 119 |
#include <iostream>
#include <string>
using namespace std;
int main() {
string word;
string part_word;
cin >> word;
cin >> part_word;
int length_word = word.size();
int length_part_word = part_word.size();
int num_mod[length_word - length_part_word + 1] = {};
for (int i = 0; i < length_word - lengt... | #include <iostream>
#include <string>
using namespace std;
int main() {
string word;
string part_word;
cin >> word;
cin >> part_word;
int length_word = word.size();
int length_part_word = part_word.size();
int num_mod[length_word - length_part_word + 1] = {};
for (int i = 0; i < length_word - lengt... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 161 |
s=input()
t=input()
for i in range(len(s)-len(t)+1):
a=s[i:len(t)+i]
num=0
for i,j in zip(t,a):
if i!=j:
num+=1
num=min(1000,num)
print(num)
| s=input()
t=input()
ans=1000
for i in range(len(s)-len(t)+1):
a=s[i:len(t)+i]
num=0
for i,j in zip(t,a):
if i!=j:
num+=1
ans=min(ans,num)
print(ans)
| [["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["-", 0, 7, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 31, 22], ["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 612], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["-", 0, 65... | 5 | 76 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
int ans = 10000;
int i, j, c;
cin >> s >> t;
int len = s.length() - t.length() + 1;
int tlen = t.length();
for (i = 0; i < len; i++) {
c = 0;
for (j = 0; j < tlen; j++) {
if (s[i + j] != t[j]) {
c++;
}
... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
int ans = 10000;
int i, j, c;
cin >> s >> t;
int len = s.length() - t.length() + 1;
int tlen = t.length();
for (i = 0; i < len; i++) {
c = 0;
for (j = 0; j < tlen; j++) {
if (s[i + j] != t[j]) {
c++;
}
... | [["-", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46], ["+", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46]] | 1 | 132 |
s, t = input(), input()
i, j = 0, 0
longest = 0
for i in range(len(s)-len(t)):
count = sum([s[i+j] == t[j] for j in range(len(t))])
longest = max(longest, count)
print(len(t)-longest)
| s, t = input(), input()
i, j = 0, 0
longest = 0
for i in range(len(s)-len(t)+1):
count = sum([s[i+j] == t[j] for j in range(len(t))])
longest = max(longest, count)
print(len(t)-longest)
| [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 82 |
// This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include <algorithm>
#include <bits/stdc++.h>
#include <cstdlib>
#include <iostream>
using namespace std;
int main() {
int i, len, lent, a, j, k, m = 0, saisyou = 1000, c = 0;
char s[10000];
char t[10000];
scanf("%s", s);
scanf("%s", t);
... | // This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include <algorithm>
#include <bits/stdc++.h>
#include <cstdlib>
#include <iostream>
using namespace std;
int main() {
int i, len, lent, a, j, k, m = 0, saisyou = 10000, c = 0;
char s[10000];
char t[10000];
scanf("%s", s);
scanf("%s", t);
... | [["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35]] | 1 | 171 |
#include <stdio.h>
#include <string.h>
int main() {
char s[1010], t[1010];
scanf("%s %s", s, t);
int i, j, count = 0, high = 0;
for (j = 0; j < (strlen(s) - strlen(t)); j++) {
for (i = j; i < (strlen(t) + j); i++) {
if (s[i] == t[i - j]) {
count++;
}
}
if (count >= high) {
... | #include <stdio.h>
#include <string.h>
int main() {
char s[1010], t[1010];
scanf("%s %s", s, t);
int i, j, count = 0, high = 0;
for (j = 0; j <= (strlen(s) - strlen(t)); j++) {
for (i = j; i < (strlen(t) + j); i++) {
if (s[i] == t[i - j]) {
count++;
}
}
if (count >= high) {
... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 0 | 145 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
// input
string S, T;
cin >> S >> T;
// calc
int ls, lt;
ls = S.length();
lt = T.length();
int max = ls - lt + 1;
int cand = lt;
string teststr;
int change = 0;
rep(i, max) {
test... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
// input
string S, T;
cin >> S >> T;
// calc
int ls, lt;
ls = S.length();
lt = T.length();
int max = ls - lt + 1;
int cand = lt;
string teststr;
int change = 0;
rep(i, max) {
test... | [["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22]] | 1 | 147 |
#include <algorithm>
#include <cmath>
#include <cstring>
#include <fstream>
#include <iostream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
int main() {
string S, T;
cin >> S >> T;
int ss = S.length();
int ts = T.length();
int cnt = ts;
for (int i = 0; i < s... | #include <algorithm>
#include <cmath>
#include <cstring>
#include <fstream>
#include <iostream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
int main() {
string S, T;
cin >> S >> T;
int ss = S.length();
int ts = T.length();
int cnt = ts;
for (int i = 0; i + t... | [["-", 8, 9, 0, 7, 15, 16, 31, 16, 17, 18], ["-", 8, 9, 0, 7, 15, 16, 31, 16, 12, 22], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 98], ["-", 0, 7, 15, 16, 12, 16, 31, 16, 31, 22], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 138 |
#include <iostream>
#include <string>
#define MAX (1001)
using namespace std;
int main(void) {
string s, t;
cin >> s;
cin >> t;
int min = MAX;
for (int i = 0; i < s.length() - t.length(); i++) {
string tmp = s.substr(i, t.length());
int count = 0;
for (int j = 0; j < t.length(); j++) {
if ... | #include <iostream>
#include <string>
#define MAX (1001)
using namespace std;
int main(void) {
string s, t;
cin >> s;
cin >> t;
int min = MAX;
for (int i = 0; i <= s.length() - t.length(); i++) {
string tmp = s.substr(i, t.length());
int count = 0;
for (int j = 0; j < t.length(); j++) {
if... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 138 |
#!/usr/bin/env python3
s = input()
t = input()
result = len(t)
for i in range(len(s) - len(t) + 1):
dif = 0
for j in range(len(t)):
if(s[i + j] != t[j]):
dif += 1
if result > dif:
result = dif
print(dif)
| #!/usr/bin/env python3
s = input()
t = input()
result = len(t)
for i in range(len(s) - len(t) + 1):
dif = 0
for j in range(len(t)):
if(s[i + j] != t[j]):
dif += 1
if result > dif:
result = dif
print(result)
| [["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]] | 5 | 79 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string S, T;
cin >> S >> T;
int N, M;
N = S.size();
M = T.size();
vector<int> vec(M);
for (int i = 0; i < N - M + 1; i++) {
for (int j = 0; j < M; j++) {
if (T.at(j) == S.at(j + i))
vec.at(i)++;
}
}
sort(vec.begin(), ... | #include <bits/stdc++.h>
using namespace std;
int main() {
string S, T;
cin >> S >> T;
int N, M;
N = S.size();
M = T.size();
vector<int> vec(N);
for (int i = 0; i < N - M + 1; i++) {
for (int j = 0; j < M; j++) {
if (T.at(j) == S.at(j + i))
vec.at(i)++;
}
}
sort(vec.begin(), ... | [["-", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 0, 43, 49, 53, 54, 55, 0, 56, 39, 78], ["-", 12, 16, 12, 2, 3, 4, 0, 16, 31, 22], ["+", 12, 16, 12, 2, 3, 4, 0, 16, 31, 22]] | 1 | 145 |
#include <bits/stdc++.h>
using namespace std;
int main() {
char t[1123], s[1123];
int t1, s1, maior = 0, aux = 0;
scanf("%s", s);
scanf("%s", t);
t1 = strlen(t);
s1 = strlen(s);
for (int i = 0; i <= s1 - t1; i++) {
aux = 0;
for (int j = 0; j < t1; j++) {
// printf("%d %c %d %c\n", i+j, s[... | #include <bits/stdc++.h>
using namespace std;
int main() {
char t[1123], s[1123];
int t1, s1, maior = 0, aux = 0;
scanf("%s", s);
scanf("%s", t);
t1 = strlen(t);
s1 = strlen(s);
for (int i = 0; i <= s1 - t1; i++) {
aux = 0;
for (int j = 0; j < t1; j++) {
// printf("%d %c %d %c\n", i+j, s[... | [["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 22]] | 1 | 152 |
#include <iostream>
#include <vector>
typedef long long ll;
using namespace std;
int main(void) {
string S, T;
cin >> S >> T;
int min = 0;
int tmp = 0;
for (int i = 0; S[i]; i++) {
tmp = 0;
if (S.length() - i <= T.length())
break;
for (int j = i, k = 0; T[k]; j++, k++) {
if (S[j] !=... | #include <iostream>
#include <vector>
typedef long long ll;
using namespace std;
int main(void) {
string S, T;
cin >> S >> T;
int min = 0;
int tmp = 0;
for (int i = 0; S[i]; i++) {
tmp = 0;
if (S.length() - i < T.length())
break;
for (int j = i, k = 0; T[k]; j++, k++) {
if (S[j] != ... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]] | 1 | 155 |
#include <bits/stdc++.h>
typedef long long int lli;
#define mod 1000000007
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
string a, b;
int n, m;
cin >> a;
cin >> b;
n = a.length();
m = b.length();
int minn = INT_MAX;
int count;
for (int i = 0; i <= n - m; i++) {
count =... | #include <bits/stdc++.h>
typedef long long int lli;
#define mod 1000000007
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
string a, b;
int n, m;
cin >> a;
cin >> b;
n = a.length();
m = b.length();
int minn = INT_MAX;
int count;
for (int i = 0; i <= (n - m); i++) {
count... | [["+", 8, 9, 0, 7, 15, 16, 12, 23, 0, 24], ["+", 8, 9, 0, 7, 15, 16, 12, 23, 0, 25], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22]] | 1 | 157 |
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<ll> vll;
const int INF = 1e9... | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<ll> vll;
const int INF = 1e9... | [["-", 0, 7, 26, 11, 12, 2, 63, 118, 28, 22], ["-", 0, 7, 26, 11, 12, 2, 63, 118, 17, 131], ["-", 0, 7, 26, 11, 12, 2, 63, 118, 119, 120], ["-", 0, 7, 26, 11, 12, 2, 3, 4, 0, 24], ["-", 0, 7, 26, 11, 12, 2, 3, 4, 0, 25], ["+", 0, 14, 8, 9, 0, 7, 26, 11, 12, 13]] | 1 | 243 |
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ld, ld> pd;
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl... | #pragma GCC optimize("O3")
#pragma GCC target("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ld, ld> pd;
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35]] | 1 | 410 |
#include <bits/stdc++.h>
using namespace std;
#define int int64_t
signed main() {
string s, t;
int a, b;
cin >> s >> t;
a = t.size();
for (int i = 0; i < s.size(); i++) {
b = t.size();
for (int j = 0; j < t.size() && i + j < s.size(); j++) {
// cout<<s[i+j];
if (s[i + j] == t[j])
b... | #include <bits/stdc++.h>
using namespace std;
#define int int64_t
signed main() {
string s, t;
int a, b;
cin >> s >> t;
a = t.size();
for (int i = 0; i < s.size(); i++) {
b = t.size();
for (int j = 0; j < t.size() && i + t.size() <= s.size(); j++) {
if (s[i + j] == t[j])
b--;
}
a... | [["-", 0, 7, 15, 16, 12, 16, 31, 16, 12, 22], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 18], ["+", 12, 16, 31, 16, 12, 2, 63, 118, 28, 22], ["+", 12, 16, 31, 16, 12, 2, 63, 118, 17, 131], ["+", 12, 16, 31, 16, 12, 2, 63, 118, 119, 120], ["+", 12, 16, 31, 16, 12, 2, 3, 4, 0, 24], ["+", 12, 16, 31, 16, 12, 2, 3, 4, 0, 25], [... | 1 | 136 |
#include <stdio.h>
int main(void) {
char s[1001];
char t[1001];
int i, j, k, memo, mcount, slen, len;
if (scanf("%s\n%s", s, t) < 2)
return 0;
len = 0;
slen = 0;
while (t[len])
len++;
while (s[slen])
slen++;
mcount = 0;
i = 0;
while (i < slen - len) {
j = 0;
k = i;
memo =... | #include <stdio.h>
int main(void) {
char s[1001];
char t[1001];
int i, j, k, memo, mcount, slen, len;
if (scanf("%s\n%s", s, t) < 2)
return 0;
len = 0;
slen = 0;
while (t[len])
len++;
while (s[slen])
slen++;
mcount = 0;
i = 0;
while (i < slen - len + 1) {
j = 0;
k = i;
me... | [["+", 0, 52, 15, 23, 0, 16, 12, 16, 17, 72], ["+", 0, 52, 15, 23, 0, 16, 12, 16, 12, 13]] | 0 | 171 |
s = str(input())
t = str(input())
ns = len(s)
nt = len(t)
ans = nt
for i in range(ns-nt):
count=0
for j in range(nt):
if not s[i+j] == t[j]:
count += 1
ans = min(count,ans)
print(ans)
| s = str(input())
t = str(input())
ns = len(s)
nt = len(t)
ans = nt
for i in range(ns-nt+1):
count=0
for j in range(nt):
if not s[i+j] == t[j]:
count += 1
ans = min(count,ans)
print(ans)
| [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 81 |
/*
__ __
/\ | | /\ | | | | /\ | / | ) /\ | )
/__\ | | /__\ |--| | | /__\ |< |-< /__\ |-<
/ \ |__ |__ / \ | | \__/ / \ | \ |__) / \ | \
*/
#import <bits/stdc++.h>
typedef long long ll;
#def... | /*
__ __
/\ | | /\ | | | | /\ | / | ) /\ | )
/__\ | | /__\ |--| | | /__\ |< |-< /__\ |-<
/ \ |__ |__ / \ | | \__/ / \ | \ |__) / \ | \
*/
#import <bits/stdc++.h>
typedef long long ll;
#def... | [["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 173 |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.next();
String t = sc.next();
int out = Integer.MAX_VALUE;
for (int i = 0; i < s.length() - t.length(); i++) {
int diff = 0;
for (int j = 0; j <... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.next();
String t = sc.next();
int out = Integer.MAX_VALUE;
for (int i = 0; i < s.length() - t.length() + 1; i++) {
int diff = 0;
for (int j = 0;... | [["+", 8, 196, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 196, 0, 7, 15, 16, 12, 16, 12, 499]] | 3 | 152 |
s, t = input(), input()
mn = 1000
for i in range(len(s)-len(t)):
curr = 0
for j in range(len(t)):
curr += t[j] != s[i+j]
mn = min(mn, curr)
print(mn)
| s, t = input(), input()
mn = 1000
for i in range(len(s)-len(t)+1):
curr = 0
for j in range(len(t)):
curr += t[j] != s[i+j]
mn = min(mn, curr)
print(mn)
| [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 69 |
def input_from_console():
s = input()
t = input()
return s, t
def solve(s, t):
min_count = len(t)
for i in range(len(s)-len(t)):
temp_count = 0
for j in range(len(t)):
if s[j+i] != t[j]:
temp_count += 1
min_count = min(min_count, temp_count)
... | def input_from_console():
s = input()
t = input()
return s, t
def solve(s, t):
min_count = len(t)
for i in range(len(s)-len(t) + 1):
temp_count = 0
for j in range(len(t)):
if s[j+i] != t[j]:
temp_count += 1
min_count = min(min_count, temp_count)
... | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 136 |
S = input()
T = input()
s = len(S)
t = len(T)
M = 0
tmp = [ord(char) - 96 for char in T]
for n in range(s-t+1):
m = [ord(char) - 96 - tmp[i] for i, char in enumerate(S[n:n+t])].count(0)
if M < m:
M = m
print(t-m) | S = input()
T = input()
s = len(S)
t = len(T)
M = 0
tmp = [ord(char) for char in T]
for n in range(s-t+1):
m = [ord(char) - tmp[i] for i, char in enumerate(S[n:n+t])].count(0)
if M < m:
M = m
print(t-M) | [["-", 0, 1, 0, 662, 12, 658, 8, 657, 17, 33], ["-", 0, 1, 0, 662, 12, 658, 8, 657, 12, 612], ["-", 63, 319, 500, 658, 8, 657, 31, 657, 17, 33], ["-", 63, 319, 500, 658, 8, 657, 31, 657, 12, 612], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]] | 5 | 101 |
import sys
S = input()
T = input()
if T in S:
print(0)
sys.exit(0)
ans = []
for i in range(len(S)-len(T)+1):
s = S[i:len(T)]
cnt = 0
for x, y in zip(s, T):
if x == y:
cnt += 1
ans.append(cnt)
print(len(T)-max(ans)) | import sys
S = input()
T = input()
if T in S:
print(0)
sys.exit(0)
ans = []
for i in range(len(S)-len(T)+1):
s = S[i:i+len(T)]
cnt = 0
for x, y in zip(s, T):
if x == y:
cnt += 1
ans.append(cnt)
print(len(T)-max(ans)) | [["+", 0, 662, 12, 206, 206, 663, 0, 657, 31, 22], ["+", 0, 662, 12, 206, 206, 663, 0, 657, 17, 72]] | 5 | 101 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
int main() {
string s, t;
cin >> s >> t;
string ss;
int ans = 0, cnt = 0;
for (int i = 0; i < s.size() - t.size(); i++) {
ss = s.substr(i, t.size());
for (int j = 0; j < t.size(); j++)... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
int main() {
string s, t;
cin >> s >> t;
string ss;
int ans = 0, cnt = 0;
for (int i = 0; i <= s.size() - t.size(); i++) {
ss = s.substr(i, t.size());
for (int j = 0; j < t.size(); j++... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 157 |
s=str(input())
t=str(input())
sl=[]
tl=[]
for i in range(len(s)):
sl.append(s[i])
for i in range(len(t)):
tl.append(t[i])
m=100000
for i in range(len(s)-len(t)):
cnt=0
for j in range(len(t)):
if t[j]!=s[i+j]:
cnt+=1
m=min(m,cnt)
print(m) | s=str(input())
t=str(input())
sl=[]
tl=[]
for i in range(len(s)):
sl.append(s[i])
for i in range(len(t)):
tl.append(t[i])
m=100000
for i in range(len(s)-len(t)+1):
cnt=0
for j in range(len(t)):
if t[j]!=s[i+j]:
cnt+=1
m=min(m,cnt)
print(m) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 125 |
S = input()
T = input()
i = 0
min = len(S)
#print(S[2])
if(T in S):
print("0")
while(i < len(S)-len(T)):
count = 0
for j in range(len(T)):
if(T[j] == S[j + i]):
count+=1
if(count <= min and count != 0):
min = count
i+=1
print(min) | S = input()
T = input()
i = 0
min = len(T)
#print(S[2])
if(T in S):
print("0")
else:
while(i <= len(S)-len(T)):
count = 0
#print("count min")
#print(count)
#print(min)
for j in range(len(T)):
#print("T S")
#print(T[j])
#print(S[j + i])
... | [["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 36, 36, 0, 656, 0, 57, 75, 76, 0, 95], ["+", 36, 36, 0, 656, 0, 57, 75, 76, 0, 102], ["-", 0, 656, 0, 52, 15, 23, 0, 666, 667, 18], ["+", 8, 196, 0, 52, 15, 23, 0, 666, 667, 19], ["-", 8, 196, 0, 57, 15, 23, 0, 666, 667, 60], [... | 5 | 101 |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
// #include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
using namespace __gnu_pbds;
#define pb push_back
// #define INT_MAX 1000000000 th... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
// #include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
using namespace __gnu_pbds;
#define pb push_back
// #define INT_MAX 1000000000 th... | [["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 22], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 381 |
#include <bits/stdc++.h>
#include <chrono>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#define endl "\n"
#define ll long long int
#define vi vector<int>
#define vll vector<ll>
#define vvi vector<vi>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define mod 1000000007
#de... | #include <bits/stdc++.h>
#include <chrono>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#define endl "\n"
#define ll long long int
#define vi vector<int>
#define vll vector<ll>
#define vvi vector<vi>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define mod 1000000007
#de... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["-", 0, 7, 15, 16, 12, 2, 63, 118, 28, 22], ["-", 0, 7, 15, 16, 12, 2, 63, 118, 17, 131], ["-", 0, 7, 15, 16, 12, 2, 63, 118, 119, 120], ["-", 0, 7, 15, 16, 12, 2, 3, 4, 0, 24], ["-", 0, 7, 15, 16, 12, 2, 3, 4, 0, 25], ["+", 0, 7, 8, ... | 1 | 202 |
# coding:utf-8
import sys
import math
import time
#import numpy as np
import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools
sys.setrecursionlimit(10**7)
#N, Q = map(int, input().split())
#G = [list(input()) for i in range... | # coding:utf-8
import sys
import math
import time
#import numpy as np
import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools
sys.setrecursionlimit(10**7)
#N, Q = map(int, input().split())
#G = [list(input()) for i in range... | [["-", 8, 196, 0, 57, 15, 23, 0, 666, 667, 19], ["+", 8, 196, 0, 57, 15, 23, 0, 666, 667, 18], ["-", 0, 57, 15, 23, 0, 666, 0, 657, 12, 22], ["+", 15, 23, 0, 666, 0, 657, 12, 652, 63, 22], ["+", 0, 666, 0, 657, 12, 652, 3, 4, 0, 24], ["+", 0, 666, 0, 657, 12, 652, 3, 4, 0, 22], ["+", 0, 666, 0, 657, 12, 652, 3, 4, 0, 2... | 5 | 136 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.