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 |
|---|---|---|---|---|
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using ll = long long;
using namespace std;
int main(void) {
string S, T;
cin >> S >> T;
int ans = T.size();
rep(i, S.size() - T.size()) {
string tmp = S.substr(i, T.size());
int n = 0;
rep(j, T.size()) if (T[j] != tmp[j]) n++;... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using ll = long long;
using namespace std;
int main(void) {
string S, T;
cin >> S >> T;
int ans = T.size();
rep(i, S.size() - T.size() + 1) {
string tmp = S.substr(i, T.size());
int n = 0;
rep(j, T.size()) if (T[j] != tmp[j]) ... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 131 |
S = input()
T = input()
res = len(T)
for i in range(len(S)-len(T)):
target = S[i:i+len(T)]
matchCount = 0
for s, t in zip(T, target):
if s == t:
matchCount += 1
res = min(res, len(T)-matchCount)
print(res) | S = input()
T = input()
res = len(T)
for i in range(len(S)-len(T)+1):
target = S[i:i+len(T)]
matchCount = 0
for s, t in zip(T, target):
if s == t:
matchCount += 1
res = min(res, len(T)-matchCount)
print(res) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 85 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
template <class T> using v = vector<T>;
template <class T> using vv = v<v<T>>;
#define ALL(c) (c).begin(), (c).end()
int main() {
string S, T;
cin >> S >> T;
int ans = INT32_MAX;
for (int i = 0; i < S.size() - T.si... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
template <class T> using v = vector<T>;
template <class T> using vv = v<v<T>>;
#define ALL(c) (c).begin(), (c).end()
int main() {
string S, T;
cin >> S >> T;
int ans = INT32_MAX;
for (int i = 0; i < S.size() - T.si... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 167 |
s = list(str(input()))
t = list(str(input()))
l = []
count = 0
for i in range(len(s)-len(t)):
for j in range(len(t)):
if s[i+j] != t[j]:
count += 1
l.append(count)
count = 0
print(min(l)) | s = list(str(input()))
t = list(str(input()))
l = []
count = 0
for i in range(len(s)-len(t) + 1):
for j in range(len(t)):
if s[i+j] != t[j]:
count += 1
l.append(count)
count = 0
print(min(l))
| [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 88 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main() {
string s, t;
cin >> s >> t;
ll cng = INT_MAX;
ll len_t = t.size();
ll len_s = s.size();
for (int i = 0; i < len_s; i++) {
ll curr = 0;
for (int j = 0; j < len_t; j++) {
if (s[i + j] == t[j]) {
continue;... | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main() {
string s, t;
cin >> s >> t;
ll cng = INT_MAX;
ll len_t = t.size();
ll len_s = s.size();
for (int i = 0; i <= len_s - len_t; i++) {
ll curr = 0;
for (int j = 0; j < len_t; j++) {
if (s[i + j] == t[j]) {
... | [["-", 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, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 22]] | 1 | 123 |
<?php
list($S) = sscanf(trim(fgets(STDIN)), "%s");
list($T) = sscanf(trim(fgets(STDIN)), "%s");
$d = [];
for ($i = 0; $i < strlen($S) - strlen($T); $i++) {
$cnt = 0;
for ($j = 0; $j < strlen($T); $j++) {
if ($S[$i+ $j] != $T[$j]) {
$cnt++;
}
}
$d[$i] = $cnt;
}
asort($d);
//va... | <?php
list($S) = sscanf(trim(fgets(STDIN)), "%s");
list($T) = sscanf(trim(fgets(STDIN)), "%s");
$d = [];
for ($i = 0; $i < strlen($S) - strlen($T) + 1; $i++) {
$cnt = 0;
for ($j = 0; $j < strlen($T); $j++) {
if ($S[$i+ $j] != $T[$j]) {
$cnt++;
}
}
$d[$i] = $cnt;
}
asort($d);
... | [["+", 0, 493, 0, 7, 0, 16, 12, 16, 17, 72], ["+", 0, 493, 0, 7, 0, 16, 12, 16, 12, 612]] | 6 | 156 |
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
using Grid = vector<vector<char>>;
using vin = vector<int>;
using ll = long long;
using vll = vector<ll>;
using vbl = vector<bool>;
using vch = vector<char>;
using pinin = pair<int, int>;
#define rep(i, n) for (int i = 0; i < (int)(n); i... | #include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
using Grid = vector<vector<char>>;
using vin = vector<int>;
using ll = long long;
using vll = vector<ll>;
using vbl = vector<bool>;
using vch = vector<char>;
using pinin = pair<int, int>;
#define rep(i, n) for (int i = 0; i < (int)(n); i... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 193 |
s = input()
t = input()
sl = len(s)
tl = len(t)
ans = 10**5
for i in range(sl-tl):
tmp = s[i:i+tl]
pen = 0
for j,k in enumerate(tmp):
if t[j]!=k: pen += 1
ans = min(ans,pen)
print(ans) | s = input()
t = input()
sl = len(s)
tl = len(t)
ans = 10**8
for i in range(sl-tl+1):
tmp = s[i:i+tl]
pen = 0
for j,k in enumerate(tmp):
if t[j]!=k: pen += 1
ans = min(ans,pen)
print(ans) | [["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 83 |
s = input()
t = input()
LS = len(s)
LT = len(t)
# 最長で何文字一致するか
max_match = 0
for i in range(LS - LT + 1):
ss = s[i:i+LT]
match = 0
for a,b in zip(t, ss):
if a==b:
match += 1
max_match = max(max_match, match)
else:
match = 0
print(LT - max_match)
| s = input()
t = input()
LS = len(s)
LT = len(t)
# 最長で何文字一致するか
max_match = 0
for i in range(LS - LT + 1):
ss = s[i:i+LT]
match = 0
for a,b in zip(t, ss):
if a==b:
match += 1
max_match = max(max_match, match)
print(LT - max_match)
| [["-", 0, 7, 8, 196, 0, 57, 75, 76, 0, 95], ["-", 0, 7, 8, 196, 0, 57, 75, 76, 0, 102], ["-", 75, 76, 8, 196, 0, 1, 0, 662, 31, 22], ["-", 75, 76, 8, 196, 0, 1, 0, 662, 0, 32], ["-", 75, 76, 8, 196, 0, 1, 0, 662, 12, 612]] | 5 | 90 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rep1(i, n) for (int i = 1; i < n + 1; ++i)
#define repN(i, m, n) for (int i = m; i < n; ++i)
#define repR(i, n) for (int i = n - 1; i >= 0; --i)
using namespace std;
int main() {
string s, t;
int max = 0;
cin >> s >> t;
rep(i, s.... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rep1(i, n) for (int i = 1; i < n + 1; ++i)
#define repN(i, m, n) for (int i = m; i < n; ++i)
#define repR(i, n) for (int i = n - 1; i >= 0; --i)
using namespace std;
int main() {
string s, t;
int max = 0;
cin >> s >> t;
rep(i, s.... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 149 |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ff first
#define ss second
#define int long long
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define vi vector<int>
#define mii map<int, int>
#define pqb priority_queue<in... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ff first
#define ss second
#define int long long
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define vi vector<int>
#define mii map<int, int>
#define pqb priority_queue<in... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 288 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
#define m0(x) memset(x, 0, sizeof(x))
#define all(x) x.begin(), x.end()
#define rep(i, n) for (int i = 0; i < (n); i++)
#define asort(x) sort(all(x));
#define dsort(x, t) sort(x.begin(), x.end(), greater<t>());
#define vuni(... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
#define m0(x) memset(x, 0, sizeof(x))
#define all(x) x.begin(), x.end()
#define rep(i, n) for (int i = 0; i < (n); i++)
#define asort(x) sort(all(x));
#define dsort(x, t) sort(x.begin(), x.end(), greater<t>());
#define vuni(... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 242 |
#B
S = input()
T = input()
def counter(A,B):
tmp = 0
for j in range(len(A)):
if A[j]==B[j]:
tmp += 1
return tmp
result = 0
if S == T:
result = len(T)
else:
for i in range(len(S)-len(T)):
if counter(S[i:i+len(T)],T) > result:
result = counter(S[i:i+len(T)],T)
p... | #B
S = input()
T = input()
def counter(A,B):
tmp = 0
for j in range(len(A)):
if A[j]==B[j]:
tmp += 1
return tmp
result = 0
if S == T:
result = len(T)
else:
for i in range(len(S)-len(T)+1):
if counter(S[i:i+len(T)],T) > result:
result = counter(S[i:i+len(T)],T)... | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 128 |
#include <deque>
#include <iostream>
#include <string>
#include <vector>
#define INF 100000000
#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;
uint64_t max, temp;
max = 0;
temp = 0;
cin >> s >> t;
for (uint64_t ... | #include <deque>
#include <iostream>
#include <string>
#include <vector>
#define INF 100000000
#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;
uint64_t max, temp;
max = 0;
temp = 0;
cin >> s >> t;
for (uint64_t ... | [["+", 0, 7, 15, 16, 12, 23, 0, 16, 17, 72], ["+", 0, 7, 15, 16, 12, 23, 0, 16, 12, 13]] | 1 | 166 |
S = input()
T = input()
ans = [0 for i in range(len(S)-len(T))]
for i in range(len(S)-len(T)):
cnt = len(T)
for j in range(len(T)):
if S[i+j] == T[j]:
cnt -= 1
ans[i] = cnt
print(min(ans))
| S = input()
T = input()
ans = [0 for i in range(len(S)-len(T)+1)]
for i in range(len(S)-len(T)+1):
cnt = len(T)
for j in range(len(T)):
if S[i+j] == T[j]:
cnt -= 1
ans[i] = cnt
print(min(ans))
| [["+", 0, 659, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 659, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 92 |
#include <bits/stdc++.h>
using namespace std;
int main(void) {
string a;
string b;
cin >> a;
cin >> b;
int n = a.size();
int m = b.size();
int count = 0;
int min = INT_MAX;
for (int i = 0; i + m - 1 < n; i++) {
count = 0;
for (int j = 0; j < m; j++) {
if (a[i + j] == b[j]) {
coun... | #include <bits/stdc++.h>
using namespace std;
int main(void) {
string a;
string b;
cin >> a;
cin >> b;
int n = a.size();
int m = b.size();
int count = 0;
int min = INT_MAX;
for (int i = 0; i + m - 1 < n; i++) {
count = 0;
for (int j = 0; j < m; j++) {
if (a[i + j] != b[j]) {
coun... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 79]] | 1 | 132 |
#include <bits/stdc++.h>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
typedef long long int ll;
const int maxn = 1e6 + 7;
using namespace std;
int main() {
ios::sync_with_stdio(false);
char ch1[1005], ch2[1005];
cin >> ch1 >> ch2;
int y = strlen(ch2);
int Max = 0;
for (int i ... | #include <bits/stdc++.h>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
typedef long long int ll;
const int maxn = 1e6 + 7;
using namespace std;
int main() {
ios::sync_with_stdio(false);
char ch1[1005], ch2[1005];
cin >> ch1 >> ch2;
int y = strlen(ch2);
int Max = 0;
for (int i ... | [["-", 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, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 22]] | 1 | 166 |
S = input()
T = input()
ls = len(S)
lt = len(T)
ans = 10000
for i in range(ls - lt):
S1 = S[i: i+lt]
cnt = 0
for j in range(lt):
if S1[j] == T[j]:
cnt += 1
ans = min(ans, lt-cnt)
print(ans) | S = input()
T = input()
ls = len(S)
lt = len(T)
ans = 10000
for i in range(ls - lt + 1):
S1 = S[i: i+lt]
same = 0
for j in range(lt):
if S1[j] == T[j]:
same += 1
ans = min(ans, lt-same)
print(ans) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["-", 0, 7, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 31, 22], ["-", 0, 57, 64, 196, 0, 1, 0, 677, 31, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 677, 31, 22], ["-", 0, 662, 12, 652, 3, 4, 0, 657, 12, 22], ["+", 0,... | 5 | 84 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int mx = 0;
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++;
}
mx = max(mx, cnt);
}
cout << t.length() - m... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int mx = 0;
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++;
}
mx = max(mx, cnt);
}
cout << t.length() - ... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 120 |
#include "algorithm"
#include "cmath"
#include "cstdio"
#include "cstring"
#include "iostream"
#include "queue"
#include "stack"
using namespace std;
#define read(x) scanf("%d", &x)
#define readl(x) scanf("%lld", &x)
#define ll long long
#define ull unsigned long long
#define MAXN 3005
char s[1005], t[1005];
int ss[1... | #include "algorithm"
#include "cmath"
#include "cstdio"
#include "cstring"
#include "iostream"
#include "queue"
#include "stack"
using namespace std;
#define read(x) scanf("%d", &x)
#define readl(x) scanf("%lld", &x)
#define ll long long
#define ull unsigned long long
#define MAXN 3005
char s[1005], t[1005];
int ss[1... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 51, 16, 31, 69, 341, 342, 0, 16, 17, 72], ["+", 51, 16, 31, 69, 341, 342, 0, 16, 12, 22]] | 1 | 249 |
s = input()
t = input()
ans = 1000
for i in range(len(s)-len(t)):
temp = 0
sub = s[i:i+len(t)]
for j in range(len(t)):
if sub[j] != t[j]:
temp += 1
if temp < ans:
ans = temp
print(ans) | s = input()
t = input()
ans = 1000
for i in range(len(s)-len(t)+1):
temp = 0
sub = s[i:i+len(t)]
for j in range(len(t)):
if sub[j] != t[j]:
temp += 1
if temp < ans:
ans = temp
print(ans) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 82 |
s = gets.chomp.split('')
t = gets.chomp.split('')
s_l = s.length
t_l = t.length
max = s_l - t_ls
min_cnt = t.length
(0..max).each do |i|
cnt = 0
s[i..(i + t_l - 1)].each_with_index do |ele, i|
cnt += 1 unless ele == t[i]
end
min_cnt = cnt if cnt < min_cnt
end
puts min_cnt
| s = gets.chomp.split('')
t = gets.chomp.split('')
s_l = s.length
t_l = t.length
max = s_l - t_l
min_cnt = t.length
(0..max).each do |i|
cnt = 0
s[i..(i + t_l - 1)].each_with_index do |ele, i|
cnt += 1 unless ele == t[i]
end
min_cnt = cnt if cnt < min_cnt
end
puts min_cnt
| [["-", 36, 36, 0, 493, 0, 662, 12, 738, 12, 22], ["+", 36, 36, 0, 493, 0, 662, 12, 738, 12, 22]] | 4 | 97 |
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <vector>
#define REP(i, n) for (int(i) = 0; (i) < (int)(n); (i)++)
#define foreach(c, itr) \
for (__typeof((c).begin()) itr = (c).begin(); itr != (c).end(); itr++)
using namespace std;
int ans =... | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <vector>
#define REP(i, n) for (int(i) = 0; (i) < (int)(n); (i)++)
#define foreach(c, itr) \
for (__typeof((c).begin()) itr = (c).begin(); itr != (c).end(); itr++)
using namespace std;
int ans =... | [["+", 0, 11, 31, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 11, 31, 2, 3, 4, 0, 16, 12, 13]] | 1 | 148 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string a, b;
cin >> a >> b;
int max = 0;
for (int i = 0; i < a.size() - b.size(); i++) {
int k = 0;
for (int l = 0; l < b.size(); l++) {
if (a[i + l] == b[l])
k++;
}
if (k > max)
max = k;
}
cout << b.size() - max... | #include <bits/stdc++.h>
using namespace std;
int main() {
string a, b;
cin >> a >> b;
int max = 0;
for (int i = 0; i < a.size() - b.size() + 1; i++) {
int k = 0;
for (int l = 0; l < b.size(); l++) {
if (a[i + l] == b[l])
k++;
}
if (k > max)
max = k;
}
cout << b.size() -... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 118 |
#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 len = S.size() - T.size();
int Tlen = T.size();
int mini = 1000;
rep(i, len) {
int cnt = 0;
rep(j, Tlen) {
... | #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 len = S.size() - T.size() + 1;
int Tlen = T.size();
int mini = 2000;
rep(i, len) {
int cnt = 0;
rep(j, Tlen) {
... | [["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 72], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]] | 1 | 138 |
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <string.h>
#include <vector>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int ans = t.size();
for (int i = 0; i < s.size() - t.size(); i++) {
{
... | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <string.h>
#include <vector>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int ans = t.size();
for (int i = 0; i < s.size() - t.size() + 1; i++) {
{
... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 148 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string S, T;
cin >> S >> T;
int ans = T.size();
for (int i = 0; i < S.size() - T.size() + 1; ++i) {
int cnt = 0;
for (int k = 0, j = i; j < i + T.size(); ++j, ++k) {
cnt += S[j] != S[k];
}
ans = min(ans, cnt);
}
printf("%d\n",... | #include <bits/stdc++.h>
using namespace std;
int main() {
string S, T;
cin >> S >> T;
int ans = T.size();
for (int i = 0; i < S.size() - T.size() + 1; ++i) {
int cnt = 0;
for (int k = 0, j = i; j < i + T.size(); ++j, ++k) {
cnt += S[j] != T[k];
}
ans = min(ans, cnt);
}
printf("%d\n",... | [["-", 0, 1, 0, 11, 12, 16, 12, 69, 28, 22], ["+", 0, 1, 0, 11, 12, 16, 12, 69, 28, 22]] | 1 | 128 |
# -*- coding: utf-8 -*-
# t, s = map(str,input().split())
s = input()
t = input()
min_change = len(t)
for i in range(len(s) - len(t)):
change = 0
for j in range(len(t)):
if t[j] != s[i + j]:
change += 1
min_change = min(min_change, change)
print(min_change) | # -*- coding: utf-8 -*-
# t, s = map(str,input().split())
s = input()
t = input()
min_change = len(t)
for i in range(len(s) - (len(t) - 1)):
change = 0
for j in range(len(t)):
if t[j] != s[i + j]:
change += 1
min_change = min(min_change, change)
print(min_change) | [["+", 12, 652, 3, 4, 0, 657, 12, 23, 0, 24], ["+", 12, 23, 0, 657, 31, 652, 3, 4, 0, 25], ["+", 3, 4, 0, 657, 12, 23, 0, 657, 17, 33], ["+", 3, 4, 0, 657, 12, 23, 0, 657, 12, 612]] | 5 | 76 |
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
#define rep0(i, n) for (i = 0; i < n; i++)
#define rep(s, i, n) for (i = s; i < n; i++)
using namespace std;
string X, Y;
bool ans;
int main() {
int i, j, a = 1000000, count = 0;
cin >> X >> Y;
rep0(i, X.size() - Y... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
#define rep0(i, n) for (i = 0; i < n; i++)
#define rep(s, i, n) for (i = s; i < n; i++)
using namespace std;
string X, Y;
bool ans;
int main() {
int i, j, a = 1000000, count = 0;
cin >> X >> Y;
rep0(i, X.size() - Y... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 136 |
// /*
// power code taken from geeks for geeks
// */
// cout << setprecision (2) << fixed << 1.2;
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define pll pair<ll, ll>
const ll INF = 1e18 + 5;
const ll MAX_N = 410 + 5;
const ll MODD = 1e9 + 7;
ll max(ll a, ll b) { ret... | // /*
// power code taken from geeks for geeks
// */
// cout << setprecision (2) << fixed << 1.2;
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define pll pair<ll, ll>
const ll INF = 1e18 + 5;
const ll MAX_N = 410 + 5;
const ll MODD = 1e9 + 7;
ll max(ll a, ll b) { ret... | [["-", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 49, 22], ["-", 0, 43, 49, 50, 51, 2, 63, 118, 28, 22], ["+", 0, 43, 49, 50, 51, 2, 63, 118, 28, 22], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 415 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
const int INF = 1001001001;
using ll = long long;
using P = pair<int, int>;
using Graph = vector<string>;
Graph field;
queue<P> q;
int main() {
string s, t;
cin >> s >> t;
ll ans = 10000;
ll a, b, c;
a = s.length();... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
const int INF = 1001001001;
using ll = long long;
using P = pair<int, int>;
using Graph = vector<string>;
Graph field;
queue<P> q;
int main() {
string s, t;
cin >> s >> t;
ll ans = 10000;
ll a, b, c;
a = s.length();... | [["+", 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 | 159 |
#include <algorithm>
#include <bitset>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using ll = long long;
int main() {
string s, t;
cin >> s... | #include <algorithm>
#include <bitset>
#include <iostream>
#include <map>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using ll = long long;
int main() {
string s, t;
cin >> s... | [["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 72], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13]] | 1 | 174 |
#include <bits/stdc++.h>
using namespace std;
#define REP(i, p, n) for (ll i = p; i < ll(n); ++i)
#define rep(i, n) REP(i, 0, n)
using ll = long long;
using pll = pair<ll, ll>;
int main() {
string S, T;
cin >> S >> T;
ll ans = S.size();
const auto d = S.size() - T.size();
rep(i, d) {
ll res = 0;
... | #include <bits/stdc++.h>
using namespace std;
#define REP(i, p, n) for (ll i = p; i < ll(n); ++i)
#define rep(i, n) REP(i, 0, n)
using ll = long long;
using pll = pair<ll, ll>;
int main() {
string S, T;
cin >> S >> T;
ll ans = S.size();
const auto d = S.size() - T.size();
rep(i, d + 1) {
ll res = 0;... | [["+", 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 | 145 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using vc = vector<char>;
using vvc = vector<vc>;
using vp = vector<pair<int, int>>;
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define rep(i, n) FOR(i, 0, n)
const ll INF = 9223372036854775807;
int m... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using vc = vector<char>;
using vvc = vector<vc>;
using vp = vector<pair<int, int>>;
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define rep(i, n) FOR(i, 0, n)
const ll INF = 9223372036854775807;
int m... | [["-", 0, 9, 0, 9, 0, 57, 64, 116, 0, 117], ["+", 0, 9, 0, 9, 0, 57, 64, 126, 0, 127], ["+", 0, 9, 0, 9, 0, 57, 64, 126, 128, 129], ["+", 0, 30, 0, 14, 8, 9, 0, 97, 128, 129], ["+", 0, 30, 0, 14, 8, 9, 0, 97, 0, 102]] | 1 | 184 |
#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 = 1e9;
int ns = s.size();
int ts = t.size();
rep(i, ns - ts) {
string sub = s.substr(i, ts);
int count = 0;... | #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 = 1e9;
int ns = s.size();
int ts = t.size();
rep(i, ns - ts + 1) {
string sub = s.substr(i, ts);
int count ... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 143 |
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
long long int i, j, n, x, d, lengs = 0, lengt = 0, ans = 1000, po = 0;
char s[1001], t[1001];
memset(s, '\0', 1001);
memset(t, '\0', 1001);
scanf("%s %s", s, t);
for (i = 0; i < 1001; i++) {
if (s[i] == '\0' &... | #include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
long long int i, j, n, x, d, lengs = 0, lengt = 0, ans = 1000, po = 0;
char s[1001], t[1001];
memset(s, '\0', 1001);
memset(t, '\0', 1001);
scanf("%s %s", s, t);
for (i = 0; i < 1001; i++) {
if (s[i] == '\0' &... | [["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]] | 1 | 215 |
#include <iostream>
#include <string.h>
#include <string>
using namespace std;
int main(int argc, char *argv[]) {
string S, T;
cin >> S;
cin >> T;
char *pS = (char *)S.c_str();
char *pT = (char *)T.c_str();
if (strstr(pS, pT)) {
cout << 0 << endl;
return 0;
}
int i, j;
size_t sLen = S.size();
... | #include <iostream>
#include <string.h>
#include <string>
using namespace std;
int main(int argc, char *argv[]) {
string S, T;
cin >> S;
cin >> T;
char *pS = (char *)S.c_str();
char *pT = (char *)T.c_str();
if (strstr(pS, pT)) {
cout << 0 << endl;
return 0;
}
int i, j;
size_t sLen = S.size();
... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 192 |
#include <stdio.h>
#include <string.h>
int main(void) {
char S[1001];
char T[1001];
int sn, tn;
int i, j, tmp, max;
scanf("%s", S);
scanf("%s", T);
sn = strlen(S);
tn = strlen(T);
max = 0;
for (i = 0; i < sn - tn; ++i) {
tmp = 0;
for (j = 0; j < tn; ++j) {
if (S[i + j] == T[j]) {
... | #include <stdio.h>
#include <string.h>
int main(void) {
char S[1001];
char T[1001];
int sn, tn;
int i, j, tmp, max;
scanf("%s", S);
scanf("%s", T);
sn = strlen(S);
tn = strlen(T);
max = 0;
for (i = 0; i < sn - tn + 1; ++i) {
tmp = 0;
for (j = 0; j < tn; ++j) {
if (S[i + j] == T[j]) ... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 0 | 171 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
using namespace std;
using ll = long long;
const ll mod = (ll)1e9 + 7;
int main() {
string s, t;
cin >> s >> t;
int ans = INT_MAX;
rep(i, t.size()) {
for (int j = i; j < s.size() && t.size() - i <= s.size() - j; j++) {
if (... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
using namespace std;
using ll = long long;
const ll mod = (ll)1e9 + 7;
int main() {
string s, t;
cin >> s >> t;
int ans = t.size();
rep(i, t.size()) {
for (int j = i; j < s.size() && t.size() - i <= s.size() - j; j++) {
if ... | [["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 22], ["+", 0, 43, 49, 50, 51, 2, 63, 118, 28, 22], ["+", 0, 43, 49, 50, 51, 2, 63, 118, 17, 131], ["+", 0, 43, 49, 50, 51, 2, 63, 118, 119, 120], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 24], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 25]] | 1 | 169 |
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#include <bits/stdc++.h>
using namespace std;
int main() {
string S, T;
long long int ans = 100000000;
cin >> S;
cin >> T;
rep(i, S.size() - T.size()) {
int tmp = 0;
rep(j, T.size()) {
if (S[i + j] != T[j]) {
tmp++;
}
}
... | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
#include <bits/stdc++.h>
using namespace std;
int main() {
string S, T;
long long int ans = 100000000;
cin >> S;
cin >> T;
rep(i, S.size() - T.size() + 1) {
int tmp = 0;
rep(j, T.size()) {
if (S[i + j] != T[j]) {
tmp++;
}
... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 115 |
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
long long Acount = 0;
long long Bcount = t.length();
// int A[5]
// sort(A, A + 5);
for (long long i = 0; i < s.length() - t.length(); i++) {
for (long long j = 0; j < t.length(... | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
long long Acount = 0;
long long Bcount = t.length();
// int A[5]
// sort(A, A + 5);
for (long long i = 0; i < 1 + s.length() - t.length(); i++) {
for (long long j = 0; j < t.len... | [["+", 0, 7, 15, 16, 12, 16, 31, 16, 31, 13], ["+", 0, 7, 15, 16, 12, 16, 31, 16, 17, 72]] | 1 | 151 |
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): retur... | import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): retur... | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 228 |
#include <bits/stdc++.h>
#include <iostream>
#include <string>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
#define ll long long int
#define ld long double
#define pb push_back
#define endl "\n"
#define mp make_pair
#define sz(v) (int)(v.size())
#define len(s... | #include <bits/stdc++.h>
#include <iostream>
#include <string>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
#define ll long long int
#define ld long double
#define pb push_back
#define endl "\n"
#define mp make_pair
#define sz(v) (int)(v.size())
#define len(s... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 409 |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ff first
#define ss second
#define endl "\n"
#define loop(i, s, e) for (int i = s; i < e; i++)
#define int long long
#define vi vector<int>
#define S(v) sort(v... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ff first
#define ss second
#define endl "\n"
#define loop(i, s, e) for (int i = s; i < e; i++)
#define int long long
#define vi vector<int>
#define S(v) sort(v... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 308 |
#include <algorithm>
#include <deque>
#include <iostream>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define MOD 1000000007
long long kaizyo(int N);
long long P(int N, int M);
long long pow(int a, int n) {
long long result = 1;
for (int i = 0; i < n; i++) {
result *= a;
result =... | #include <algorithm>
#include <deque>
#include <iostream>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define MOD 1000000007
long long kaizyo(int N);
long long P(int N, int M);
long long pow(int a, int n) {
long long result = 1;
for (int i = 0; i < n; i++) {
result *= a;
result =... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 293 |
S = list(input())
T = list(input())
lt = len(T)
result = 10**5
for i in range(len(S) - len(T) + 1):
cnt = 0
for s, t in zip(S[i: (i + lt)], T):
if s != t:
cnt += 1
result = max(cnt, result)
print(result) | S = list(input())
T = list(input())
lt = len(T)
result = 10**5
for i in range(len(S) - len(T) + 1):
cnt = 0
for s, t in zip(S[i: (i + lt)], T):
if s != t:
cnt += 1
result = min(cnt, result)
print(result) | [["-", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22]] | 5 | 89 |
S = input()
T = input()
num_S = len(S)
num_T = len(T)
match = 0
for i in range(num_S - num_T):
count = 0
for j in range(num_T):
if S[i+j] == T[j]:
count += 1
if count > match:
match = count
print(num_T - match) | S = input()
T = input()
num_S = len(S)
num_T = len(T)
match = 0
for i in range(num_S - num_T + 1):
count = 0
for j in range(num_T):
if S[i+j] == T[j]:
count += 1
if count > match:
match = count
print(num_T - match) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 76 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
string t;
cin >> s;
cin >> t;
long long count = 0;
long long tempt = t.size();
long long temps = s.size();
long long ans = t.size();
for (long long i = 0; i < temps - tempt; i++) {
for (long long j = 0; j < tempt; j++) {
i... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
string t;
cin >> s;
cin >> t;
long long count = 0;
long long tempt = t.size();
long long temps = s.size();
long long ans = t.size();
for (long long i = 0; i < temps - tempt + 1; i++) {
for (long long j = 0; j < tempt; j++) {
... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 141 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main() {
string a, b;
cin >> a >> b;
int cnt = 0;
int ans = 10000000;
for (int i = 0; i < a.size() - b.size(); i++) {
for (int j = 0; j < b.size(); j++) {
if (a[i + j] != b[j]) {
cnt++;
}
}
ans = min(ans... | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main() {
string a, b;
cin >> a >> b;
int cnt = 0;
int ans = 10000000;
for (int i = 0; i <= a.size() - b.size(); i++) {
for (int j = 0; j < b.size(); j++) {
if (a[i + j] != b[j]) {
cnt++;
}
}
ans = min(an... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 118 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using Graph = vector<vector<int>>;
int main(void) {
string s, t;
ll fuitti = 0, saisyo = LONG_LONG_MAX;
cin >> s;
cin >> t;
for (int i = 0; i < s.size() - t.size(); i++) {
fuitti = 0;
for (int j = 0; j < t.si... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using Graph = vector<vector<int>>;
int main(void) {
string s, t;
ll fuitti = 0, saisyo = LONG_LONG_MAX;
cin >> s;
cin >> t;
for (int i = 0; i <= s.size() - t.size(); i++) {
fuitti = 0;
for (int j = 0; j < t.s... | [["-", 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>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define int long long
using ldb = long double;
using pa = pair<int, int>;
template <typename T>
using index_set =
tree<T, null_type, less<T>, rb_tree_tag, tree_orde... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define int long long
using ldb = long double;
using pa = pair<int, int>;
template <typename T>
using index_set =
tree<T, null_type, less<T>, rb_tree_tag, tree_orde... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 278 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string s, t;
cin >> s >> t;
int cost = 0, ans = t.size();
for (int i = 0; i < s.size() - t.size(); i++) {
cost = 0;
for (int j = 0; j < t.size(); j++)
if (t[j] !... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string s, t;
cin >> s >> t;
int cost = 0, ans = t.size();
for (int i = 0; i <= s.size() - t.size(); i++) {
cost = 0;
for (int j = 0; j < t.size(); j++)
if (t[j] ... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 140 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int m = -1, ss = s.size(), ts = t.size();
for (int i = 0; i < ss - ts; i++) {
int count = 0;
for (int j = 0; j < ts; j++) {
if (s[i + j] == t[j])
count++;
}
m = max(m, count);
}
cout << ts - ... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int m = -1, ss = s.size(), ts = t.size();
for (int i = 0; i < ss - ts + 1; i++) {
int count = 0;
for (int j = 0; j < ts; j++) {
if (s[i + j] == t[j])
count++;
}
m = max(m, count);
}
cout << t... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 120 |
#include <bits/stdc++.h>
using namespace std;
int main() {
char x[1001], y[1001];
scanf("%s%s", x, y);
int leng1 = strlen(x), leng2 = strlen(y);
int ans = 99999, q = 0, tmp = 0;
for (int i = 0; i <= leng1 - leng2; i++) {
tmp = 0;
for (int j = 0; j <= leng2 - 1; j++) {
q = i + j;
if (x[q] !... | #include <bits/stdc++.h>
using namespace std;
int main() {
char x[1001], y[1001];
scanf("%s%s", x, y);
int leng1 = strlen(x), leng2 = strlen(y);
int ans = 99999, q = 0, tmp = 0;
for (int i = 0; i <= leng1 - leng2; i++) {
tmp = 0;
for (int j = 0; j <= leng2 - 1; j++) {
q = i + j;
if (x[q] !... | [["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]] | 1 | 142 |
S=input()
T=input()
if T in S:
print(0)
exit()
def f(s1,s2):
r=0
for i,j in zip(s1,s2):
if i != j: r += 1
return r
a=len(S)
for i in range(len(S)-len(T)):
r = f(S[i:i+len(T)],T)
if a > r: a = r
print(a) | S=input()
T=input()
if T in S:
print(0)
exit()
def f(s1,s2):
r=0
for i,j in zip(s1,s2):
if i != j: r += 1
return r
a=len(S)
for i in range(len(S)-len(T)+1):
r = f(S[i:i+len(T)],T)
if a > r: a = r
print(a) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 107 |
S = input()
T = input()
if T in S:
print("0")
else:
slen = len(S)
tlen = len(T)
ansCnt = tlen
for i in range(slen-tlen):
cnt = 0
for j in range(tlen):
if T[j]!=S[i+j]:
cnt += 1
if ansCnt>cnt:
ansCnt = cnt
print(ansCnt) | S = input()
T = input()
if T in S:
print("0")
else:
slen = len(S)
tlen = len(T)
ansCnt = tlen
for i in range(slen-tlen+1):
cnt = 0
for j in range(tlen):
if T[j]!=S[i+j]:
cnt += 1
if ansCnt>cnt:
ansCnt = cnt
print(ansCnt) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 87 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define overload4(_1, _2, _3, _4, name, ...) name
#define overload3(_1, _2, _3, name, ...) name
#define rep1(n) for (ll i = 0; i < n; ++i)
#define rep2(i, n) for (ll i = 0; i < n; ++i)
#define rep... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define overload4(_1, _2, _3, _4, name, ...) name
#define overload3(_1, _2, _3, name, ...) name
#define rep1(n) for (ll i = 0; i < n; ++i)
#define rep2(i, n) for (ll i = 0; i < n; ++i)
#define rep... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 326 |
#include <bits/stdc++.h>
using namespace std;
// adio amore
const int maxi = 1e6 + 10;
#define pb push_back
#define pii pair<int, int>
int a[maxi];
string s, t;
int n;
vector<int> v[maxi];
int main() {
cin >> s;
cin >> t;
int n = s.size();
int m = t.size();
int ans = m;
for (int i = 0; i < n - m; i++)... | #include <bits/stdc++.h>
using namespace std;
// adio amore
const int maxi = 1e6 + 10;
#define pb push_back
#define pii pair<int, int>
int a[maxi];
string s, t;
int n;
vector<int> v[maxi];
int main() {
cin >> s;
cin >> t;
int n = s.size();
int m = t.size();
int ans = m;
for (int i = 0; i < n - m + 1; ... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 153 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define INF 1000000007
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int ans = 0;
rep(i, int(s.size()) - int(t.size())) {
long tmp = 0;
rep(j, int(t.size())) {
if (t[j] == s[i + j]) {
tmp++;
}
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define INF 1000000007
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int ans = 0;
rep(i, int(s.size()) - int(t.size()) + 1) {
int tmp = 0;
rep(j, int(t.size())) {
if (t[j] == s[i + j]) {
tmp++;
}
... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["-", 8, 9, 0, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 14, 8, 9, 0, 9, 0, 43, 39, 40]] | 1 | 132 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int mn, cnt;
string s, t;
cin >> s >> t;
mn = t.length();
for (int i = 0; i < s.length() - t.length(); i++) {
cnt = 0;
for (int j = 0; j < t.length(); j++) {
if (s.at(i + j) != t.at(j))
cnt++;
}
mn = min(mn, cnt);
}
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int mn, cnt;
string s, t;
cin >> s >> t;
mn = t.length();
for (int i = 0; i < s.length() - t.length() + 1; i++) {
cnt = 0;
for (int j = 0; j < t.length(); j++) {
if (s.at(i + j) != t.at(j))
cnt++;
}
mn = min(mn, cnt);
... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 122 |
import java.util.Scanner;
public class Main {
public static Scanner scan = new Scanner(System.in);
public static void main(String[] args) {
String s = next();
String t = next();
int tmpC = 0;
int maxC = 0;
for (int i = 0; i < s.length() - t.length(); i++) {
for (int j = 0; j < t.length()... | import java.util.Scanner;
public class Main {
public static Scanner scan = new Scanner(System.in);
public static void main(String[] args) {
String s = next();
String t = next();
int tmpC = 0;
int maxC = 0;
for (int i = 0; i < s.length() - t.length() + 1; i++) {
for (int j = 0; j < t.leng... | [["+", 8, 196, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 196, 0, 7, 15, 16, 12, 16, 12, 499]] | 3 | 413 |
#include <iostream>
#include <string>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int minDiff = 999999;
for (int i = 0; i < s.length() - t.length(); i++) {
int curDiff = 0;
for (int j = 0; j < t.length(); j++) {
if (s[i + j] != t[j]) {
curDiff++;
}
}
if... | #include <iostream>
#include <string>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int minDiff = 999999;
for (int i = 0; i <= s.length() - t.length(); i++) {
int curDiff = 0;
for (int j = 0; j < t.length(); j++) {
if (s[i + j] != t[j]) {
curDiff++;
}
}
i... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 121 |
S = input()
T = input()
m = 0
for i in range(len(S) - len(T)):
res = 0
for a, b in zip(T, S[i:i + len(T)]):
if a == b:
res += 1
if res > m:
m = res
print(len(T) - m)
| S = input()
T = input()
m = 0
for i in range(len(S) - len(T) + 1):
res = 0
for a, b in zip(T, S[i:i + len(T)]):
if a == b:
res += 1
if res > m:
m = res
print(len(T) - m)
| [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 79 |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define vi vector<int>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define pi 3.141592653589793238
#define eb emplace_back
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define zip(i, a, b) for (int i = a; i < b; i+... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define vi vector<int>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define pi 3.141592653589793238
#define eb emplace_back
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define zip(i, a, b) for (int i = a; i < b; i+... | [["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 72], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13], ["-", 8, 9, 0, 9, 0, 57, 64, 116, 0, 117], ["+", 8, 9, 0, 9, 0, 57, 64, 93, 0, 94]] | 1 | 662 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
#if !defined(M_PI)
#define M_E 2.71828182845904523536
#define M_LOG2E 1.44269504088896340736
#define M_LOG10E 0.434294481903251827651
#define M_LN2 0.693147180559945309417
#d... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
#if !defined(M_PI)
#define M_E 2.71828182845904523536
#define M_LOG2E 1.44269504088896340736
#define M_LOG10E 0.434294481903251827651
#define M_LN2 0.693147180559945309417
#d... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 246 |
/*Author--Vishwas Agrawal*/
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define vll vector<ll>
#define pb push_back
#define test \
ll t; \
cin >> t; ... | /*Author--Vishwas Agrawal*/
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define vll vector<ll>
#define pb push_back
#define test \
ll t; \
cin >> t; ... | [["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 51, 16, 31, 69, 341, 342, 0, 16, 17, 72], ["+", 51, 16, 31, 69, 341, 342, 0, 16, 12, 22]] | 1 | 310 |
#include <string.h>
int main() {
char s[1001], t[1001];
scanf("%s %s", s, t);
int i, j;
int tlen = strlen(t);
int ans = tlen;
int cnt;
for (i = 0; s[i + tlen] != '\0'; i++) {
cnt = 0;
for (j = 0; t[j] != '\0'; j++) {
if (s[i + j] != t[j])
cnt++;
}
if (cnt < ans)
ans = c... | #include <string.h>
int main() {
char s[1001], t[1001];
scanf("%s %s", s, t);
int i, j;
int tlen = strlen(t);
int ans = tlen;
int cnt;
for (i = 0; s[i + tlen - 1] != '\0'; i++) {
cnt = 0;
for (j = 0; t[j] != '\0'; j++) {
if (s[i + j] != t[j])
cnt++;
}
if (cnt < ans)
ans... | [["+", 0, 7, 15, 16, 31, 69, 71, 16, 17, 33], ["+", 0, 7, 15, 16, 31, 69, 71, 16, 12, 13]] | 0 | 133 |
#include <bits/stdc++.h>
using namespace std;
int main(void) {
string t, s;
cin >> s >> t;
int cnt, max = 0;
for (int i = 0; i < s.length() - t.length(); i++) {
cnt = 0;
for (int j = 0; j < t.length(); j++) {
if (s[i + j] == t[j]) {
cnt++;
}
}
if (cnt > max) {
max = cn... | #include <bits/stdc++.h>
using namespace std;
int main(void) {
string t, s;
cin >> s >> t;
int cnt, max = 0;
for (int i = 0; i <= s.length() - t.length(); i++) {
cnt = 0;
for (int j = 0; j < t.length(); j++) {
// cout << s[i + j] << ' ' << t[j] << '\n';
if (s[i + j] == t[j]) {
cnt++... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 125 |
s = input()
t = input()
ans = len(t)
for i in range(len(s)-len(t)):
si = s[i:i+len(t)]
cnt = 0
if len(si) == len(t):
for sii, ti in zip(si, t):
if sii != ti:
cnt += 1
ans = min(ans, cnt)
print(ans)
| s = input()
t = input()
ans = len(t)
for i in range(len(s)-len(t)+1):
si = s[i:i+len(t)]
cnt = 0
if len(si) == len(t):
for sii, ti in zip(si, t):
if sii != ti:
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 | 91 |
s = gets.chomp.split('')
t = gets.chomp.split('')
motosize = t.size
max = 0
def hoge(a, b)
count = 0
for i in 0...(a.size) do
count += 1 if (a[i] == b[i])
end
count
end
for i in 0...(s.size - t.size) do
tmp = hoge(s[i..(i+t.size)], t)
if (tmp > max)
max = tmp
end
end
puts motosize - max | s = gets.chomp.split('')
t = gets.chomp.split('')
motosize = t.size
max = 0
def hoge(a, b)
count = 0
for i in 0...(a.size) do
count += 1 if (a[i] == b[i])
end
count
end
for i in 0..(s.size - t.size) do
tmp = hoge(s[i...(i+t.size)], t)
if (tmp > max)
max = tmp
end
end
puts motosize - max | [["-", 0, 493, 0, 88, 51, 267, 0, 475, 17, 389], ["+", 0, 493, 0, 88, 51, 267, 0, 475, 17, 757], ["-", 12, 652, 3, 4, 0, 742, 0, 475, 17, 757], ["+", 12, 652, 3, 4, 0, 742, 0, 475, 17, 389]] | 4 | 118 |
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 count = s.length() - t.length();
int ans = Integer.MAX_VALUE;
for (int i = 0; i < count; i++) {
int tmp = 0;
... | 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 count = s.length() - t.length() + 1;
int ans = Integer.MAX_VALUE;
for (int i = 0; i < count; i++) {
int tmp = 0;
... | [["+", 8, 196, 0, 503, 49, 200, 51, 16, 17, 72], ["+", 8, 196, 0, 503, 49, 200, 51, 16, 12, 499]] | 3 | 159 |
#include <algorithm>
#include <bits/stdc++.h>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#inc... | #include <algorithm>
#include <bits/stdc++.h>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string.h>
#include <string>
#inc... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 218 |
#include <algorithm>
#include <cassert>
#include <iostream>
#include <memory>
#include <numeric>
#include <array>
#include <deque>
#include <map>
#include <set>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <chrono>
#include <cstring>
#include <ostream>
#include <random... | #include <algorithm>
#include <cassert>
#include <iostream>
#include <memory>
#include <numeric>
#include <array>
#include <deque>
#include <map>
#include <set>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <chrono>
#include <cstring>
#include <ostream>
#include <random... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 225 |
def resolve():
S = list(input())
T = list(input())
lenT = len(T)
res = lenT
for i in range(len(S)-lenT):
tmp = lenT
for j in range(lenT):
if S[i+j] == T[j]:
tmp -= 1
res = min(res, tmp)
print(res)
resolve() | def resolve():
S = list(input())
T = list(input())
lenT = len(T)
res = lenT
for i in range(len(S)-lenT+1):
tmp = lenT
for j in range(lenT):
if S[i+j] == T[j]:
tmp -= 1
res = min(res, tmp)
print(res)
resolve() | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 85 |
s = str(input())
t = str(input())
g = len(s)
h = len(t)
ans = 10000
for i in range(g-h):
k = 0
for j in range(h):
if(s[i+j]!=t[j]):
k += 1
ans = min(ans,k)
print(ans) | s = str(input())
t = str(input())
g = len(s)
h = len(t)
ans = 10000
for i in range(g-h+1):
k = 0
for j in range(h):
if(s[i+j]!=t[j]):
k += 1
ans = min(ans,k)
print(ans) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 82 |
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
#pragma warn... | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
#pragma warn... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 270 |
def resolve():
S = input()
T =input()
s_n = len(S)
t_n = len(T)
ans = 2000
for i in range(s_n - t_n):
cnt = 0
for j in range(t_n):
if S[i+j] != T[j]:
cnt += 1
ans = min(ans, cnt)
print(ans)
if __name__ == "__main__":
resolve() |
def resolve():
S = input()
T = input()
s_n = len(S)
t_n = len(T)
ans = 1 << 60
for i in range(s_n - t_n + 1):
cnt = 0
for j in range(t_n):
if S[i + j] != T[j]:
cnt += 1
ans = min(ans, cnt)
print(ans)
if __name__ == "__main__":
reso... | [["-", 0, 14, 8, 196, 0, 1, 0, 662, 12, 612], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 31, 612], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 151], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 89 |
// https://atcoder.jp/contests/abc177/tasks/abc177_b
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()
#defi... | // https://atcoder.jp/contests/abc177/tasks/abc177_b
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()
#defi... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 164 |
a = input()
b = input()
mini = len(b)
if a == b:
print(0)
exit(0)
for s in range(len(a) - len(b)):
c = 0
for i, j in zip(a[s:s + len(b)], b):
if i != j:
c += 1
mini = min([mini, c])
print(mini)
| a = input()
b = input()
mini = len(b)
if a == b:
print(0)
exit(0)
for s in range(len(a) - len(b) + 1):
c = 0
for i, j in zip(a[s:s + len(b)], b):
if i != j:
c += 1
mini = min([mini, c])
print(mini)
| [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 92 |
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define vv(T) std::vector<std::vector<T>>
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
using namespace std;
using ll = long long;
int main(void) {
string S, T;
cin >> S >> T;
int ans = 0;
for (int i = 0; i < (int)(S.size() - T.... | #include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define vv(T) std::vector<std::vector<T>>
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
using namespace std;
using ll = long long;
int main(void) {
string S, T;
cin >> S >> T;
int ans = 0;
for (int i = 0; i < (int)(S.size() - T.... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 152 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
const int maxn = 1e5 + 10;
const int mod = 1e9 + 7;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
string s;
cin >> s;
string t;
cin >> t;
int n = s.size();
int k = t.size();
int ans = 1e9;
for (int i = 0... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
const int maxn = 1e5 + 10;
const int mod = 1e9 + 7;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
string s;
cin >> s;
string t;
cin >> t;
int n = s.size();
int k = t.size();
int ans = 1e9;
for (int i = 0... | [["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]] | 1 | 176 |
""" B
https://atcoder.jp/contests/abc175/tasks/abc175_b
"""
import sys
import math
from functools import reduce
from bisect import bisect_left
def readString():
return sys.stdin.readline()
def readInteger():
return int(readString())
def readStringSet(n):
return sys.stdin.readline().split(" ")[:n]
de... | """ B
https://atcoder.jp/contests/abc175/tasks/abc175_b
"""
import sys
import math
from functools import reduce
from bisect import bisect_left
def readString():
return sys.stdin.readline()
def readInteger():
return int(readString())
def readStringSet(n):
return sys.stdin.readline().split(" ")[:n]
de... | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 222 |
function Main(input) {
input = input.split("\n");
const S = input[0].split("");
const T = input[1].split("");
var def = 0;
for (var i = 0; i < S.length - T.length; i++) {
var tmp = S.slice(i, i + T.length);
var count = 0; //一致数
for (var j = 0; j < tmp.length; j++) {
if (tmp[j] == T[j]) {
... | function Main(input) {
input = input.split("\n");
const S = input[0].split("");
const T = input[1].split("");
var def = 0;
for (var i = 0; i <= S.length - T.length; i++) {
var tmp = S.slice(i, i + T.length);
var count = 0; //一致数
for (var j = 0; j < tmp.length; j++) {
if (tmp[j] == T[j]) {... | [["-", 8, 556, 0, 7, 15, 1, 0, 16, 17, 18], ["+", 8, 556, 0, 7, 15, 1, 0, 16, 17, 19]] | 2 | 173 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int ans = t.size();
for (int i = 0; i < (int)(s.size() - t.size()); i++) {
int tmp = 0;
for (int j = 0; j < (int)t.size(); j++) {
if (s[i + j] != t[j])
tmp++;
}
if (tmp < ans)
ans = tmp;
... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int ans = t.size();
for (int i = 0; i <= (int)(s.size() - t.size()); i++) {
int tmp = 0;
for (int j = 0; j < (int)t.size(); j++) {
if (s[i + j] != t[j])
tmp++;
}
if (tmp < ans)
ans = tmp;
... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 124 |
#include <bits/stdc++.h>
#include <unistd.h>
//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including
//seg_tree_order_statistics_node_update
#include <cassert>
#include <stdio.h>
using namespace std;
// using namespace __gnu_pbds;
typedef long long lo;
typedef long ... | #include <bits/stdc++.h>
#include <unistd.h>
//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including
//seg_tree_order_statistics_node_update
#include <cassert>
#include <stdio.h>
using namespace std;
// using namespace __gnu_pbds;
typedef long long lo;
typedef long ... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 1,294 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int ans = INT_MAX;
for (int i = 0; i + t.length() < s.length(); i++) {
int c = 0;
for (int j = 0; j < t.length(); j++)
if (t[j] != s[i + j])
c++;
ans = min(ans, c);
}
cout << ans << endl;
retur... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int ans = INT_MAX;
for (int i = 0; i + t.length() <= s.length(); i++) {
int c = 0;
for (int j = 0; j < t.length(); j++)
if (t[j] != s[i + j])
c++;
ans = min(ans, c);
}
cout << ans << endl;
retu... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 112 |
S = input()
T =input()
min_e = 10000
for i in range(len(S) - len(T)+1):
tmp_e=0
for j in range(len(T)):
if S[i+j] != T[j]:
tmp_e += 1
if tmp_e < min_e:
min_e = tmp_e
print(tmp_e) | S = input()
T =input()
min_e = 10000
for i in range(len(S) - len(T)+1):
tmp_e=0
for j in range(len(T)):
if S[i+j] != T[j]:
tmp_e += 1
if tmp_e < min_e:
min_e = tmp_e
print(min_e) | [["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]] | 5 | 73 |
#include <algorithm> //辞書順=next_permutation
#include <cmath>
#include <complex>
#include <iomanip>
#include <iostream>
#include <locale>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <string> //char 小文字のほうが32大きい
#include <time.h>
#... | #include <algorithm> //辞書順=next_permutation
#include <cmath>
#include <complex>
#include <iomanip>
#include <iostream>
#include <locale>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <string> //char 小文字のほうが32大きい
#include <time.h>
#... | [["+", 0, 2, 3, 4, 0, 16, 31, 16, 17, 72], ["+", 0, 2, 3, 4, 0, 16, 31, 16, 12, 13]] | 1 | 858 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string a, b;
cin >> a >> b;
int n = a.size(), m = b.size();
int m2 = INT_MAX;
for (int i = 0; i < n - m + 1; i++) {
int p = 0;
for (int j = 0; j < m; j++) {
if (b[j] != a[i + j])
p++;
}
m2 = min(p, m);
}
if (m2 == I... | #include <bits/stdc++.h>
using namespace std;
int main() {
string a, b;
cin >> a >> b;
int n = a.size(), m = b.size();
int m2 = INT_MAX;
for (int i = 0; i < n - m + 1; i++) {
int p = 0;
for (int j = 0; j < m; j++) {
if (b[j] != a[i + j])
p++;
}
m2 = min(p, m2);
}
if (m2 == ... | [["-", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22]] | 1 | 130 |
// ABC 177
#include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
int a, b, c, d;
cin >> s >> t;
a = s.length();
b = t.length();
d = 0;
for (int i = 0; i < a - b; i++) {
c = 0;
for (int ii = 0; ii < b; ii++) {
int iii = ii + i;
if (s.at(iii) != t.at(ii)) {
c++... | // ABC 177
#include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
int a, b, c, d;
cin >> s >> t;
a = s.length();
b = t.length();
d = 0;
for (int i = 0; i < a - b + 1; i++) {
c = 0;
for (int ii = 0; ii < b; ii++) {
int iii = ii + i;
if (s.at(iii) != t.at(ii)) {
... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 147 |
S=input()
T=input()
n=len(T)
l=len(S)-n
p=0
for i in range(l):
j=0
m=S[i:i+n]
for k in range(n):
if(m[k]==T[k]):
j+=1
if(p<j):
p=j
print(n-p) | S=input()
T=input()
n=len(T)
l=len(S)-n
p=0
for i in range(l+1):
j=0
m=S[i:i+n]
for k in range(n):
if(m[k]==T[k]):
j+=1
if(p<j):
p=j
print(n-p)
| [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 88 |
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set \
tree<int, null_type, less<int>, rb_tree_tag, \
... | #include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set \
tree<int, null_type, less<int>, rb_tree_tag, \
... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 15, 16, 12, 16, 31, 2, 3, 4, 0, 25], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 0, 7, 15, 16, 12, 16, 12, 2, 63, 22], ["+", 15, 16, 12, 16, 12, 2, 3, 4, 0, 24], ["+", 15, 16, 12, 16, 12, 2, 3, 4, 0, 22]] | 1 | 678 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
int main() {
string s, t;
cin >> s >> t;
ll n = s.size();
ll m = t.size();
ll ans = 10000000;
rep(i, n - m) {
string u = s.substr(i, m);
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
int main() {
string s, t;
cin >> s >> t;
ll n = s.size();
ll m = t.size();
ll ans = 10000000;
rep(i, n - m + 1) {
string u = s.substr(i, m)... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 139 |
s = input()
t = input()
c = [0] * (len(s) - len(t))
for i in range(len(s) - len(t)):
for j in range(len(t)):
if s[i+j] == t[j]:
c[i] += 1
print(len(t)-max(c)) | s = input()
t = input()
c = [0] * (len(s) - len(t)+1)
for i in range(len(s) - len(t) +1):
for j in range(len(t)):
if s[i+j] == t[j]:
c[i] += 1
print(len(t)-max(c)) | [["+", 0, 662, 12, 657, 12, 23, 0, 657, 17, 72], ["+", 0, 662, 12, 657, 12, 23, 0, 657, 12, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 85 |
////////////////////////////////////////////////////
// //
// For her who keeps the fire kindling in me... //
// //
////////////////////////////////////////////////////
import java.awt.Point;
import java.awt.geom.*;
import ... | ////////////////////////////////////////////////////
// //
// For her who keeps the fire kindling in me... //
// //
////////////////////////////////////////////////////
import java.awt.Point;
import java.awt.geom.*;
import ... | [["-", 8, 196, 0, 7, 8, 196, 0, 57, 64, 35]] | 3 | 1,247 |
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int count_same(string str1, string str2) {
int count{0};
for (int i{0}; i < int(str1.size()); ++i) {
if (str1[i] == str2[i]) {
++count;
}
}
return count;
}
int main(void) {
string S, T;
cin >> S >> T;
int max... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int count_same(string str1, string str2) {
int count{0};
for (int i{0}; i < int(str1.size()); ++i) {
if (str1[i] == str2[i]) {
++count;
}
}
return count;
}
int main(void) {
string S, T;
cin >> S >> T;
int max... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 170 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
int main() {
string s, t;
cin >> s >> t;
int ans = 100000;
for (int i = 0; i < s.size() - t.size(); i++) {
string l = s.substr... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
int main() {
string s, t;
cin >> s >> t;
int ans = 100000;
for (int i = 0; i <= s.size() - t.size(); i++) {
string l = s.subst... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 153 |
import sys
sys.setrecursionlimit(4100000)
import math
import itertools
INF = float('inf')
from heapq import heapify, heappop, heappush
def main():
S = input()
T = input()
num = len(S) - len(T)
ans = INF
for i in range(num):
tmp = 0
for j in range(len(T)):
if S[i+j] != ... | import sys
sys.setrecursionlimit(4100000)
import math
import itertools
INF = float('inf')
from heapq import heapify, heappop, heappush
def main():
S = input()
T = input()
num = len(S) - len(T)+1
ans = len(T)
for i in range(num):
tmp = 0
for j in range(len(T)):
if S[i+j... | [["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 72], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 12, 612], ["-", 0, 14, 8, 196, 0, 1, 0, 662, 12, 22], ["+", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]] | 5 | 117 |
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define all(a) a.begin(), a.end()
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<ll, int> pli;
typedef pair<int, int> pii;
#define rep(i, a, b) for (ll i = a; i < b; i++)
#define qrep(q... | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define all(a) a.begin(), a.end()
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<ll, int> pli;
typedef pair<int, int> pii;
#define rep(i, a, b) for (ll i = a; i < b; i++)
#define qrep(q... | [["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]] | 1 | 922 |
#include <algorithm>
#include <bits/stdc++.h>
#include <iostream>
#include <vector>
using namespace std;
int main() {
string s, t;
long unsigned int i, j, change = 0, mini = INT_MAX;
cin >> s >> t;
for (i = 0; i < s.length() - t.length(); ++i) {
j = 0;
change = 0;
for (j = 0; j < t.length(); ++... | #include <algorithm>
#include <bits/stdc++.h>
#include <iostream>
#include <vector>
using namespace std;
int main() {
string s, t;
long unsigned int i, j, change = 0, mini = INT_MAX;
cin >> s >> t;
for (i = 0; i <= s.length() - t.length(); ++i) {
j = 0;
change = 0;
for (j = 0; j < t.length(); +... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 129 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.