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>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define sync std::ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define loopi(n) for (int i = 0; i < n; i++)
#define loopj(n) for (int j ... | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define sync std::ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define loopi(n) for (int i = 0; i < n; i++)
#define loopj(n) for (int j ... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 291 |
#include <bits/stdc++.h>
using namespace std;
//定数
const long long MOD1 = 1000000007;
const long long MOD2 = 998244353;
const long double PI = 3.1415926535897932;
const long long MAXLL = 9223372036854775807;
const long long INF = 2305843009213693951;
const long long dx[] = {0, 1, 0, -1, 1, -1, 1, -1};
const long long ... | #include <bits/stdc++.h>
using namespace std;
//定数
const long long MOD1 = 1000000007;
const long long MOD2 = 998244353;
const long double PI = 3.1415926535897932;
const long long MAXLL = 9223372036854775807;
const long long INF = 2305843009213693951;
const long long dx[] = {0, 1, 0, -1, 1, -1, 1, -1};
const long long ... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]] | 1 | 772 |
def main():
S = str(input())
T = str(input())
max = 0
for i in range(len(S)-len(T)):
count = 0
for n in range(len(T)):
if S[i+n] == T[n]:
count += 1
if count > max:
max = count
print(len(T) - max)
main()
| def main():
S = str(input())
T = str(input())
max = 0
for i in range(len(S)-len(T)+1):
count = 0
for n in range(len(T)):
if S[i+n] == T[n]:
count += 1
if count > max:
max = count
print(len(T) - max)
main()
| [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 90 |
s = list(input())
t = list(input())
ans = len(t)
for i in range(0, len(s) - len(t)):
tmp = len(t)
tmp1 = s[i:i + len(t)]
for j in range(len(t)):
if tmp1[j] == t[j]:
tmp -= 1
ans = min(ans, tmp)
print(ans)
| s = list(input())
t = list(input())
ans = len(t)
for i in range(0, len(s) - len(t) + 1):
tmp = len(t)
tmp1 = s[i:i + len(t)]
for j in range(len(t)):
if tmp1[j] == t[j]:
tmp -= 1
ans = min(ans, tmp)
print(ans)
| [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 96 |
/* � Ashiq Uddin Pranto
Department of Computer Science and Engineering
BATCH 27
University Of Rajshahi,Bangladesh
*/
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define FOR(x, y) for (ll i = x; i <= y; i++)
#define pb(x) push_back(x)
#define mp make_pair
#define pii pair<int, int>
#de... | /* � Ashiq Uddin Pranto
Department of Computer Science and Engineering
BATCH 27
University Of Rajshahi,Bangladesh
*/
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define FOR(x, y) for (ll i = x; i <= y; i++)
#define pb(x) push_back(x)
#define mp make_pair
#define pii pair<int, int>
#de... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 684 |
package main
import "fmt"
func main() {
var S, T string
fmt.Scanf("%s %s", &S, &T)
var maxLen = 0
for i := 0; i <= len(S) - len(T); i++ {
var cnt = 0
for j := 0; j < len(T); j++ {
if S[i + j] == T[j] {
cnt++
}
}
if cnt > maxLen {
maxLen = cnt
}
}
fmt.... | package main
import "fmt"
func main() {
var S, T string
fmt.Scanf("%s\n%s", &S, &T)
var maxLen = 0
for i := 0; i <= len(S) - len(T); i++ {
var cnt = 0
for j := 0; j < len(T); j++ {
if S[i + j] == T[j] {
cnt++
}
}
if cnt > maxLen {
maxLen = cnt
}
}
fmt... | [["+", 8, 196, 0, 1, 0, 2, 3, 4, 0, 429], ["+", 0, 1, 0, 2, 3, 4, 0, 429, 0, 44]] | 7 | 125 |
s = input()
t = input()
ans = float("INF")
for i in range(len(s)-len(t)):
x = 0
for j in range(len(t)):
x += (s[i+j] != t[j])
ans = min(ans,x)
print(ans) | s = input()
t = input()
ans = float("INF")
for i in range(len(s)-len(t)+1):
x = 0
for j in range(len(t)):
x += (s[i+j] != t[j])
ans = min(ans,x)
print(ans) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 75 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
void pk() {
string s, t;
cin >> s >> t;
ll n = s.size();
ll m = t.size();
ll mi = INT64_MAX;
for (ll i = 0; i <= n - m + 1; i++) {
string temp;
for (ll j = i; j < i + m; j++) {
temp += s[j];
}
ll cn = 0;
for (ll h =... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
void pk() {
string s, t;
cin >> s >> t;
ll n = s.size();
ll m = t.size();
ll mi = INT64_MAX;
for (ll i = 0; i < n - m + 1; i++) {
string temp;
for (ll j = i; j < i + m; j++) {
temp += s[j];
}
ll cn = 0;
for (ll h = ... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18]] | 1 | 191 |
S = list(input())
N = len(S)
T = list(input())
n = len(T)
ans = n
for i in range(N - n):
s = S[i:i + n]
a = 0
for j in range(n):
if T[j] != s[j]:
a += 1
if a < ans:
ans = a
print(ans) | S = list(input())
N = len(S)
T = list(input())
n = len(T)
ans = n
for i in range(N - n + 1):
s = S[i:i + n]
a = 0
for j in range(n):
if T[j] != s[j]:
a += 1
if a < ans:
ans = a
print(ans)
| [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 88 |
s = input()
t = input()
min_cor = len(t)
for i in range(len(s) - len(t)):
cor = 0
for j in range(len(t)):
if t[j] != s[i + j]:
cor = cor + 1
if min_cor > cor:
min_cor = cor
print(min_cor) | s = input()
t = input()
min_cor = len(t)
for i in range(len(s) - len(t) + 1):
cor = 0
for j in range(len(t)):
if t[j] != s[i + j]:
cor = cor + 1
if min_cor > cor:
min_cor = cor
print(min_cor) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 76 |
#include <math.h>
#include <algorithm>
#include <array>
#include <bitset>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <sstream>
#include <vector>
using namespace std;
using Graph = vector<vector<int>>;
using ll = long long;
typedef pair<ll, ll> P_ll;
typedef pair<int, int> P;
con... | #include <math.h>
#include <algorithm>
#include <array>
#include <bitset>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <sstream>
#include <vector>
using namespace std;
using Graph = vector<vector<int>>;
using ll = long long;
typedef pair<ll, ll> P_ll;
typedef pair<int, int> P;
con... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 197 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string S, T;
cin >> S >> T;
int ans = S.size();
for (int i = 0; i < (S.size() - T.size()); i++) {
int temp = 0;
for (int j = 0; j < T.size(); j++) {
if (T[j] != S[j + i]) {
temp++;
}
}
if (temp <= ans)
ans = tem... | #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 temp = 0;
for (int j = 0; j < T.size(); j++) {
if (T[j] != S[j + i]) {
temp++;
}
}
if (temp <= ans)
ans =... | [["-", 0, 43, 49, 50, 51, 2, 63, 118, 28, 22], ["+", 0, 43, 49, 50, 51, 2, 63, 118, 28, 22], ["+", 0, 7, 15, 16, 12, 23, 0, 16, 17, 72], ["+", 0, 7, 15, 16, 12, 23, 0, 16, 12, 13]] | 1 | 120 |
s = input()
t = input()
d = len(s) - len(t)
min_c = int(1e4)
for i in range(d):
st = s[i:i+len(t)]
c = 0
for j in range(len(t)):
if st[j] != t[j]:
c += 1
if c > min_c:
break
min_c = min(c, min_c)
print(min_c)
| s = input()
t = input()
d = len(s) - len(t)
min_c = int(1e4)
for i in range(d+1):
st = s[i:i+len(t)]
c = 0
for j in range(len(t)):
if st[j] != t[j]:
c += 1
if c > min_c:
break
min_c = min(c, min_c)
print(min_c)
| [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 94 |
s=input()
t=input()
ans=9999
for i in range(len(s)-len(t)-1):
temp=s[i:i+len(t)]
cnt=0
for j in range(len(t)):
if temp[j]!=t[j]:
cnt+=1
ans=min(ans,cnt)
print(ans) | s=input()
t=input()
ans=9999
for i in range(len(s)-len(t)+1):
temp=s[i:i+len(t)]
cnt=0
for j in range(len(t)):
if temp[j]!=t[j]:
cnt+=1
ans=min(ans,cnt)
print(ans) | [["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72]] | 5 | 84 |
#include <bits/stdc++.h>
#define rep(i, e, n) for (int i = e; i < (n); ++i)
using namespace std;
typedef long long ll;
using P = pair<int, int>;
int main() {
string s, t;
cin >> s >> t;
int n = s.size() - t.size();
int ans = 0;
// cout << n << endl;
rep(i, 0, n) {
int cnt = 0;
rep(j, 0, t.size()) ... | #include <bits/stdc++.h>
#define rep(i, e, n) for (int i = e; i < (n); ++i)
using namespace std;
typedef long long ll;
using P = pair<int, int>;
int main() {
string s, t;
cin >> s >> t;
int n = s.size() - t.size() + 1;
int ans = 0;
// cout << n << endl;
rep(i, 0, n) {
int cnt = 0;
rep(j, 0, t.size... | [["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 72], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13]] | 1 | 139 |
#include <algorithm>
#include <cmath>
#include <cstring>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
in... | #include <algorithm>
#include <cmath>
#include <cstring>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
in... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 146 |
s=input()
t = input()
maxi = 0
for i in range(len(s)-len(t)+1):
count = 0
for j in range(len(t)):
#print(t[j], s[i+j])
if t[j] == s[i + j]:
count += 1
#print(count)
maxi = max(maxi, count)
print(len(t)-count) | s=input()
t = input()
maxi = 0
for i in range(len(s)-len(t)+1):
count = 0
for j in range(len(t)):
#print(t[j], s[i+j])
if t[j] == s[i + j]:
count += 1
#print(count)
maxi = max(maxi, count)
#print(maxi)
print(len(t)-maxi) | [["-", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]] | 5 | 80 |
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define FORD(i, a, b) for (int i = a; i >= b; i--)
#define REP(i, n) FOR(i, 0, n)
#define pb push_back
#define en "\n"
#define LL long long
#define ITER(i, a) for (typeof(a.begin()) i = a.begin(); i != a.end(); i++)
#define m... | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define FORD(i, a, b) for (int i = a; i >= b; i--)
#define REP(i, n) FOR(i, 0, n)
#define pb push_back
#define en "\n"
#define LL long long
#define ITER(i, a) for (typeof(a.begin()) i = a.begin(); i != a.end(); i++)
#define m... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 250 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, j, n) for (int i = j; i < (int)(n); i++)
#define brep(i, n) for (int i = n; i > 0; i--)
#define BREP(i, j, n) for (int i = n; i > j; i--)
#define TEST cout << "PASS" << endl
#define all(x) (x).begin(), (x).... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, j, n) for (int i = j; i < (int)(n); i++)
#define brep(i, n) for (int i = n; i > 0; i--)
#define BREP(i, j, n) for (int i = n; i > j; i--)
#define TEST cout << "PASS" << endl
#define all(x) (x).begin(), (x).... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 214 |
#include <bits/stdc++.h>
#define ll long long
#define foi(n) for (ll i = 0; i < n; i++)
using namespace std;
int main() {
string s, t;
cin >> s >> t;
ll n = s.length();
ll n2 = t.length();
ll ans = INT_MAX;
for (ll i = 0; i < n - n2; i++) {
ll cnt = 0;
for (int j = i; j < i + n2; j++) {
if (... | #include <bits/stdc++.h>
#define ll long long
#define foi(n) for (ll i = 0; i < n; i++)
using namespace std;
int main() {
string s, t;
cin >> s >> t;
ll n = s.length();
ll n2 = t.length();
ll ans = INT_MAX;
for (ll i = 0; i < n - n2 + 1; i++) {
ll cnt = 0;
for (int j = i; j < i + n2; j++) {
... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 128 |
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>; // グラフ型
typedef long long ll;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (n); ++i)
int main() {
string S, T;
cin >> S >> T;
// vector<ll> a(N);
// vector<vector<int>> data(3, vector<int>(4));
ll t_length = T.si... | #include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>; // グラフ型
typedef long long ll;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (n); ++i)
int main() {
string S, T;
cin >> S >> T;
// vector<ll> a(N);
// vector<vector<int>> data(3, vector<int>(4));
ll t_length = T.si... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 162 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define mo 1000000007
#define inf 1e18
#define rep(i, s, n) for (ll i = s; i < n; i = i + 1)
#define rrep(i, s, n) for (ll i = s; i >= n; i--)
ll mod(ll n) { return (n % (ll)mo + (ll)mo) % (ll)mo; }
int ma... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define mo 1000000007
#define inf 1e18
#define rep(i, s, n) for (ll i = s; i < n; i = i + 1)
#define rrep(i, s, n) for (ll i = s; i >= n; i--)
ll mod(ll n) { return (n % (ll)mo + (ll)mo) % (ll)mo; }
int ma... | [["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 186 |
#include <bits/stdc++.h>
#define fo(i, a, b) for (int i = (a); i < (b); i++)
#define qi queue<int>
#define vi vector<int>
#define ll long long
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define pii pair<int, int>
#define mp make_pair
#define all(a) (a).begin(), (a).end()
#define fi first
#define... | #include <bits/stdc++.h>
#define fo(i, a, b) for (int i = (a); i < (b); i++)
#define qi queue<int>
#define vi vector<int>
#define ll long long
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define pii pair<int, int>
#define mp make_pair
#define all(a) (a).begin(), (a).end()
#define fi first
#define... | [["-", 15, 339, 51, 16, 12, 69, 341, 342, 0, 22], ["+", 15, 339, 51, 16, 12, 69, 341, 342, 0, 22]] | 1 | 284 |
S = input()
T = input()
len_s = len(S)
len_t = len(T)
max_count = 0
for x in range(len_s - len_t):
count = 0 #初期化
for y in range(len_t):
# print(S[y+x], T[y])
if S[y+x] == T[y]:
count += 1
else:
pass
# print(count)
if max_count < count:
... | S = input()
T = input()
len_s = len(S)
len_t = len(T)
max_count = 0
for x in range(len_s - len_t + 1):
count = 0 #初期化
for y in range(len_t):
# print(S[y+x], T[y])
if S[y+x] == T[y]:
count += 1
else:
pass
# print(count)
if max_count < count:
ma... | [["+", 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()
n = len(S)
m = len(T)
ans = 0
for i in range(n-m):
tmp = 0
for j in range(m):
if S[i+j] == T[j]:
tmp += 1
ans = max(ans,tmp)
print(m-ans)
| S = input()
T = input()
n = len(S)
m = len(T)
ans = 0
for i in range(n-m+1):
tmp = 0
for j in range(m):
if S[i+j] == T[j]:
tmp += 1
ans = max(ans,tmp)
print(m-ans)
| [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 76 |
S = input()
T = input()
s = len(S)
t = len(T)
min_count = t
for i in range(s - t):
count = 0
for j, tt in enumerate(T):
if S[i: i + t][j] == tt:
count += 1
change = t - count
if change < min_count:
min_count = change
print(min_count)
| S = input()
T = input()
s = len(S)
t = len(T)
min_count = t
for i in range(s - t + 1):
count = 0
for j, tt in enumerate(T):
if S[i: i + t][j] == tt:
count += 1
change = t - count
if change < min_count:
min_count = change
print(min_count)
| [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 83 |
#include <bits/stdc++.h>
#include <deque>
#include <math.h>
#define ll long long int
#define l long double
#define pi 3.14159265358979323846
#define mod 1000000007
using namespace std;
int main() {
string s, t;
cin >> s >> t;
ll l1 = s.length();
ll l2 = t.length();
ll i = 0, k = 0, res = 1000000;
while (i <... | #include <bits/stdc++.h>
#include <deque>
#include <math.h>
#define ll long long int
#define l long double
#define pi 3.14159265358979323846
#define mod 1000000007
using namespace std;
int main() {
string s, t;
cin >> s >> t;
ll l1 = s.length();
ll l2 = t.length();
ll i = 0, k = 0, res = 1000000;
while (i <... | [["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 19]] | 1 | 152 |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
string s, t;
cin >> s >> t;
int slen = s.size();
int tlen = t.size();
int max_v = 0;
for (int i = 0; i < slen - tlen; i++) {
string k = s.substr(i, tlen);
int cnt =... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
string s, t;
cin >> s >> t;
int slen = s.size();
int tlen = t.size();
int max_v = 0;
for (int i = 0; i < slen - tlen + 1; i++) {
string k = s.substr(i, tlen);
int c... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 149 |
#include <bits/stdc++.h>
using namespace std;
#define IOS \
ios::sync_with_stdio(false); \
cin.tie(0);
#define FOR(i, s, n) for (int i = (s); i < (n); i++)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i... | #include <bits/stdc++.h>
using namespace std;
#define IOS \
ios::sync_with_stdio(false); \
cin.tie(0);
#define FOR(i, s, n) for (int i = (s); i < (n); i++)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 208 |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string s, t;
cin >> s >> t;
int n = s.size();
int m = t.size();
int ans = INT_MAX;
for (int i = 0; i + m < n; i++) {
int count = 0;
for (int j = 0; j < m; j++) {
if (s[i + j] != t... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string s, t;
cin >> s >> t;
int n = s.size();
int m = t.size();
int ans = INT_MAX;
for (int i = 0; i + m - 1 < n; i++) {
int count = 0;
for (int j = 0; j < m; j++) {
if (s[i + j] ... | [["+", 8, 9, 0, 7, 15, 16, 31, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 31, 16, 12, 13]] | 1 | 136 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<bool> vb;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define INT(str) stoi((str), 0)
#define INTB(str) stoi((str), 0, 2) // 2進数の文字列を int に
// cout << fixed << setprecision(15);
int main() {
string s, t;... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<bool> vb;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define INT(str) stoi((str), 0)
#define INTB(str) stoi((str), 0, 2) // 2進数の文字列を int に
// cout << fixed << setprecision(15);
int main() {
string s, t;... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 139 |
s = list(map(str,input()))
t = list(map(str,input()))
same = 0
for i in range(0,len(s)-len(t)):
s2 = s[i:i+len(t)]
count = 0
for j in range(len(t)):
if s2[j]==t[j]:
count += 1
same = max([same,count])
print(max(0,len(t) - same)) | s = list(map(str,input()))
t = list(map(str,input()))
same = 0
for i in range(0,len(s)-len(t)+1):
s2 = s[i:i+len(t)]
count = 0
for j in range(len(t)):
if s2[j]==t[j]:
count += 1
same = max([same,count])
print(max(0,len(t) - same))
| [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 112 |
#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<pairs, null_type, greater<pairs>, 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<pairs, null_type, greater<pairs>, rb_tree_tag, \
... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 276 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) \
; \
for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
int main() {
... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) \
; \
for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
int main() {
... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 125 |
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <string>
using namespace std;
void Main() {
// input
string S, T;
cin >> S;
cin >> T;
// process
int l = 0;
for (u_int16_t i = 0; i <= S.length() - T.length(); i++) {
int tmp = 1001;
for (u_int64_t j = 0; j < T.length(); j++) ... |
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <string>
using namespace std;
void Main() {
// input
string S, T;
cin >> S;
cin >> T;
// process
int l = 1001;
for (u_int16_t i = 0; i <= S.length() - T.length(); i++) {
int tmp = 0;
for (u_int64_t j = 0; j < T.length(); j++) ... | [["-", 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, 43, 49, 50, 51, 13], ["+", 0, 7, 8, 9, 0, 43, 49, 50, 51, 13]] | 1 | 152 |
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define pll pair<ll, ll>
#define vi vector<int>
#define pii pair<int, int>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define s(x) scanf("%d", &x)
#define sll(x) scanf("%lld", ... | #include <bits/stdc++.h>
using namespace std;
#define int long long int
#define pll pair<ll, ll>
#define vi vector<int>
#define pii pair<int, int>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define s(x) scanf("%d", &x)
#define sll(x) scanf("%lld", ... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 699 |
#include <bits/stdc++.h>
using namespace std;
int main(void) {
char s[2000];
char t[2000];
cin >> s;
cin >> t;
int len = strlen(s);
int lent = strlen(t);
int ans = lent;
int w = 0;
for (int i = 0; i < len - lent; i++) {
w = 0;
for (int j = 0; j < lent; j++) {
if (s[i + j] != t[j])
... | #include <bits/stdc++.h>
using namespace std;
int main(void) {
char s[2000];
char t[2000];
cin >> s;
cin >> t;
int len = strlen(s);
int lent = strlen(t);
int ans = lent;
int w = 0;
for (int i = 0; i < len - lent + 1; i++) {
w = 0;
for (int j = 0; j < lent; 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]] | 1 | 130 |
#include <iostream>
#include <string>
#include <vector>
using ll = long long;
using namespace std;
int main() {
string S, T;
cin >> S >> T;
int ss = S.size();
int ts = T.size();
vector<int> len(ss);
int cnt = 0;
for (int i = 0; i < ss; i++) {
cnt = 0;
for (int j = 0; j < ts; j++) {
if (i +... | #include <iostream>
#include <string>
#include <vector>
using ll = long long;
using namespace std;
int main() {
string S, T;
cin >> S >> T;
int ss = S.size();
int ts = T.size();
vector<int> len(ss);
int cnt = 0;
for (int i = 0; i < ss; i++) {
cnt = 0;
for (int j = 0; j < ts; j++) {
if (i +... | [["+", 75, 76, 0, 9, 0, 1, 0, 11, 31, 22], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 17, 32], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35]] | 1 | 196 |
# -*- coding: utf-8 -*-
S =input()
T =input()
match_list = [0]*len(S)
for i in range(len(S)-len(T)):
for j in range(len(T)):
if S[i+j] == T[j]:
match_list[i] += 1
print(len(T) - max(match_list)) | # -*- coding: utf-8 -*-
S =input()
T =input()
match_list = [0]*len(S)
for i in range(len(S)-len(T)+1):
for j in range(len(T)):
if S[i+j] == T[j]:
match_list[i] += 1
print(len(T) - max(match_list)) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 79 |
S,T = $<.read.split
m = N = T.size
(S.size-m).times {|i|
n = 0
N.times {|j| n+=1 if S[i+j]!=T[j]; break if n>=m }
m > n && m = n
}
p m | S,T = $<.read.split
m = N = T.size
(S.size-m+1).times {|i|
n = 0
N.times {|j| n+=1 if S[i+j]!=T[j]; break if n>=m }
m > n && m = n
}
p m | [["+", 0, 493, 0, 652, 486, 739, 0, 738, 17, 72], ["+", 0, 493, 0, 652, 486, 739, 0, 738, 12, 612]] | 4 | 71 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
int count = 0, max = 0;
cin >> s >> t;
for (int i = 0; i < 1 + s.size() - t.size(); i++) {
count = 0;
for (int j = 0; j < t.size(); j++) {
if (s.at(i + j) == t.at(j))
count++;
}
if (max < count)
max = co... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
int count = 0, max = 0;
cin >> s >> t;
for (int i = 0; i < 1 + s.size() - t.size(); i++) {
count = 0;
for (int j = 0; j < t.size(); j++) {
if (s.at(i + j) == t.at(j))
count++;
}
if (max < count)
max = co... | [["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]] | 1 | 127 |
/*Author: S7a2a7d */
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
#define pb push_back
#define ll long long
#define rep(i, n) for (ll i = 0; i < n; i++)
#define repi(i, n) for (ll i = 1; i <= n; i++)
#define mem(arr, x) memset(arr, x, sizeof(arr))
#define mp make_pair
#define f first
#d... | /*Author: S7a2a7d */
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
#define pb push_back
#define ll long long
#define rep(i, n) for (ll i = 0; i < n; i++)
#define repi(i, n) for (ll i = 1; i <= n; i++)
#define mem(arr, x) memset(arr, x, sizeof(arr))
#define mp make_pair
#define f first
#d... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 261 |
s=input()
t=input()
num=len(s)-len(t)
res=[]
for n1 in range(0,num+1):
count=0
for n2 in range(0,len(t)):
if(t[n2]!=s[n1+n2]):
count+=1
print(count)
res.append(count)
print(min(res)) | s=input()
t=input()
num=len(s)-len(t)
res=[]
for n1 in range(0,num+1):
count=0
for n2 in range(0,len(t)):
if(t[n2]!=s[n1+n2]):
count+=1
res.append(count)
print(min(res)) | [["-", 0, 7, 8, 196, 0, 1, 0, 652, 63, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]] | 5 | 88 |
#include <bits/stdc++.h>
#define endl '\n'
#define ll long long
#define ld long double
#define ull unsigned long long
using namespace std;
struct _IO {
_IO() {
ios::sync_with_stdio(0);
cin.tie(0);
}
} _io;
int main() {
string a, b;
int maxn = 0;
cin >> a >> b;
for (int i = 0; i < a.size() - b.size(... | #include <bits/stdc++.h>
#define endl '\n'
#define ll long long
#define ld long double
#define ull unsigned long long
using namespace std;
struct _IO {
_IO() {
ios::sync_with_stdio(0);
cin.tie(0);
}
} _io;
int main() {
string a, b;
int maxn = -100;
cin >> a >> b;
for (int i = 0; i <= a.size() - b.s... | [["-", 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], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46], ["-", 0, 7, 8, 9, 0, 7, 8, 9, 0, 46]] | 1 | 158 |
#include <bits/stdc++.h>
#define int long long int
using namespace std;
main() {
string s, t;
cin >> s >> t;
int test = INT_MAX;
for (int i = 0; i + t.size() < s.size(); i++) {
int cou = 0;
for (int j = 0; j < t.size(); j++) {
if (s[i + j] != t[j]) {
cou++;
// cout<<cou<<" "<<i<<" ... | #include <bits/stdc++.h>
#define int long long int
using namespace std;
main() {
string s, t;
cin >> s >> t;
int test = INT_MAX;
for (int i = 0; i + t.size() <= s.size(); i++) {
int cou = 0;
for (int j = 0; j < t.size(); j++) {
if (s[i + j] != t[j]) {
cou++;
// cout<<cou<<" "<<i<<"... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 116 |
package main
import "fmt"
func main() {
var s, t string
fmt.Scan(&s)
fmt.Scan(&t)
m := 0
for i := 0; i < len(s)-len(t); i++ {
n := substringMatchCount(s, t, i)
if n > m {
m = n
}
}
fmt.Println(len(t) - m)
}
func substringMatchCount(s string, t string, idx int) int {
c := 0
for i := 0; i < len(t)... | package main
import "fmt"
func main() {
var s, t string
fmt.Scan(&s)
fmt.Scan(&t)
m := 0
for i := 0; i < len(s)-len(t)+1; i++ {
n := substringMatchCount(s, t, i)
if n > m {
m = n
}
}
fmt.Println(len(t) - m)
}
func substringMatchCount(s string, t string, idx int) int {
c := 0
for i := 0; i < len(... | [["+", 0, 7, 0, 430, 15, 16, 12, 16, 17, 72], ["+", 0, 7, 0, 430, 15, 16, 12, 16, 12, 433]] | 7 | 155 |
#include <bits/stdc++.h>
using namespace std;
#define Pi 2 * acos(0.0)
#define LINF 1LL << 63
#define ll long long
#define ull unsigned long long
#define pb push_back
#define mp make_pair
#define MAX 500006
#define MAX1 10000008
#define mem(a, v) memset(a, v, sizeof(a))
#define all(x) x.begin(), x.end()
#define lcm(a,... | #include <bits/stdc++.h>
using namespace std;
#define Pi 2 * acos(0.0)
#define LINF 1LL << 63
#define ll long long
#define ull unsigned long long
#define pb push_back
#define mp make_pair
#define MAX 500006
#define MAX1 10000008
#define mem(a, v) memset(a, v, sizeof(a))
#define all(x) x.begin(), x.end()
#define lcm(a,... | [["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 505 |
s = input()
t = input()
ns = len(s)
nt = len(t)
ret = ns + 1
for i in range(ns - nt):
tmp = 0
for j in range(nt):
if s[i + j] != t[j]:
tmp += 1
if ret > tmp:
ret = tmp
print(ret) | s = input()
t = input()
ns = len(s)
nt = len(t)
ret = ns + 1
for i in range(ns - nt+ 1):
tmp = 0
for j in range(nt):
if s[i + j] != t[j]:
tmp += 1
if ret > tmp:
ret = tmp
print(ret) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 76 |
/***** author : C0d1ngPhenomena *****/
#include <bits/stdc++.h>
#define endl "\n"
#define ll long long int
#define TestCases \
int T; \
cin >> T; ... | /***** author : C0d1ngPhenomena *****/
#include <bits/stdc++.h>
#define endl "\n"
#define ll long long int
#define TestCases \
int T; \
cin >> T; ... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 279 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ar array
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
string s, t;
cin >> s >> t;
int n = s.size(), m = t.size();
int ans = 1e9;
for (int i = 0; i < n - m; ++i) {
int c = 0;
for (int j = i; j < i + m; ++j) {
c... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ar array
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
string s, t;
cin >> s >> t;
int n = s.size(), m = t.size();
int ans = 1e9;
for (int i = 0; i < n - m + 1; ++i) {
int c = 0;
for (int j = i; j < i + m; ++j) {
... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 152 |
/*
* Created on: 29 / 8 / 2020
* Author: Eslam Waheed
*/
#define _CRT_SECURE_NO_WARNINGS
//#define __USE_MINGW_ANSI_STDIO
#include <bits/stdc++.h>
//#include <bits/BIGINT.h>
//#include <bits/Int128.h>
using namespace std;
#define Eslam__Waheed \
ios... | /*
* Created on: 29 / 8 / 2020
* Author: Eslam Waheed
*/
#define _CRT_SECURE_NO_WARNINGS
//#define __USE_MINGW_ANSI_STDIO
#include <bits/stdc++.h>
//#include <bits/BIGINT.h>
//#include <bits/Int128.h>
using namespace std;
#define Eslam__Waheed \
ios... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 167 |
# coding: utf-8
from functools import reduce
from queue import Queue
from collections import deque
s = input()
t = input()
saisho_kyori = 1001
for i in range(len(s) - len(t)):
kyori = 0
for j in range(len(t)):
if s[i + j] != t[j]:
kyori += 1
saisho_kyori = min(kyori, saisho_kyori)
pri... | # coding: utf-8
from functools import reduce
from queue import Queue
from collections import deque
s = input()
t = input()
saisho_kyori = 1001
for i in range(len(s) - len(t)+1):
kyori = 0
for j in range(len(t)):
if s[i + j] != t[j]:
kyori += 1
saisho_kyori = min(kyori, saisho_kyori)
p... | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 84 |
import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
char[] s = sc.next().toCharArray();
char[] t = sc.next().toCharArray();
int n = s.length;
int m = t.length;
int min = m;
for (int i = 0; i + m < n; i++... | import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
char[] s = sc.next().toCharArray();
char[] t = sc.next().toCharArray();
int n = s.length;
int m = t.length;
int min = m;
for (int i = 0; i + m - 1 < n;... | [["+", 8, 196, 0, 7, 15, 16, 31, 16, 17, 33], ["+", 8, 196, 0, 7, 15, 16, 31, 16, 12, 499]] | 3 | 164 |
s = input()
t = input()
s = list(s)
s.append("0")
t = list(t)
roop = len(s)-len(t)
cc = []
for i in range(roop):
c = 0
tmp = []
tmp = s[i:len(t)+1+i]
for i in range(len(t)):
if tmp[i] == t[i]:
c += 1
cc.append(c)
ma = max(cc)
a = cc.index(ma)
tmp = s[a:1+len(t)]
ans = 0
for i in range(len(t)):
i... | s = input()
t = input()
s = list(s)
s.append("0")
t = list(t)
roop = len(s)-len(t)
cc = []
for i in range(roop):
c = 0
tmp = []
tmp = s[i:len(t)+1+i]
for i in range(len(t)):
if tmp[i] == t[i]:
c += 1
cc.append(c)
ma = max(cc)
a = cc.index(ma)
tmp = s[a:a+1+len(t)]
ans = 0
for i in range(len(t)):
... | [["+", 12, 206, 206, 663, 0, 657, 31, 657, 31, 22], ["+", 12, 206, 206, 663, 0, 657, 31, 657, 17, 72]] | 5 | 165 |
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ull unsigned long long int
#define db double
#define ld long double
#define MOD 1000000007
#define inf (1LL << 62)
#define pi acos(-1.0)
#define si(a) scanf("%lld", &a)
#define sd(n) scanf("%lf", &n)
#define for1(i, sto... | #include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ull unsigned long long int
#define db double
#define ld long double
#define MOD 1000000007
#define inf (1LL << 62)
#define pi acos(-1.0)
#define si(a) scanf("%lld", &a)
#define sd(n) scanf("%lf", &n)
#define for1(i, sto... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 255 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int inf = 1e9 + 7;
const ll longinf = 5LL << 60;
const ll mod = 1e9 + 7;
int main() {
string S, T;
cin >> S >> T;
int length = 0;
for (int i = 0; i < S.size() - T.size(); i++) {
int tmp = 0;
for (int j = 0; j < T.size(); j++) {
... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int inf = 1e9 + 7;
const ll longinf = 5LL << 60;
const ll mod = 1e9 + 7;
int main() {
string S, T;
cin >> S >> T;
int length = 0;
for (int i = 0; i <= S.size() - T.size(); i++) {
int tmp = 0;
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 | 148 |
S = str(input())
T = str(input())
ans = 10**9
for i in range(0,len(S)-len(T)):
cnt = 0
for j in range(len(T)):
if T[j] != S[i+j]:
cnt += 1
ans = min(ans,cnt)
print(ans)
| S = str(input())
T = str(input())
ans = 10**9
for i in range(0,len(S)-len(T)+1):
cnt = 0
for j in range(len(T)):
if T[j] != S[i+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 | 81 |
s=input()
t=input()
ans=1000
for i in range(len(s)-len(t)):
cnt=0
for j in range(len(t)):
if s[i+j]!=t[j]:
cnt+=1
ans=min(ans,cnt)
print(ans) | s=input()
t=input()
ans=1000
for i in range(len(s)-len(t)+1):
cnt=0
for j in range(len(t)):
if s[i+j]!=t[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 | 71 |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define fo(i, n) for (i = 0; i < n; i++)
#define fo1(i, n) for (i = 1; i <= n; i++)
#define foab(i, a, b) for (i = a; i <= b; i++)
#define of(i, n) for... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define fo(i, n) for (i = 0; i < n; i++)
#define fo1(i, n) for (i = 1; i <= n; i++)
#define foab(i, a, b) for (i = a; i <= b; i++)
#define of(i, n) for... | [["+", 0, 2, 3, 4, 0, 16, 31, 16, 17, 33], ["+", 0, 2, 3, 4, 0, 16, 31, 16, 12, 22], ["+", 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 | 877 |
#include <bits/stdc++.h>
#define FOR0(i, n) for (int i = 0; i < n; i++)
#define FOR(i, j, n) for (int i = j; i < n; i++)
// bool isEven(ll n) {return (n%2!=0)?false:true;};
#define INF 1000000000 // 1 billion, safer than 2B for Floyd Warshall’s
#define f(i, a, b) for (i = a; i < b; i++)
#define rep(i, n) f(i, 0, n)
#... | #include <bits/stdc++.h>
#define FOR0(i, n) for (int i = 0; i < n; i++)
#define FOR(i, j, n) for (int i = j; i < n; i++)
// bool isEven(ll n) {return (n%2!=0)?false:true;};
#define INF 1000000000 // 1 billion, safer than 2B for Floyd Warshall’s
#define f(i, a, b) for (i = a; i < b; i++)
#define rep(i, n) f(i, 0, n)
#... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 269 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(v) v.begin(), v.end()
#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))
using ll = long long;
using PAIR = pair<int, int>;
using PAIRLL = pair<ll, ll>;
using vi = vector<int>;
using vvi = vec... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(v) v.begin(), v.end()
#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))
using ll = long long;
using PAIR = pair<int, int>;
using PAIRLL = pair<ll, ll>;
using vi = vector<int>;
using vvi = vec... | [["-", 0, 1, 0, 11, 12, 2, 63, 118, 28, 22], ["+", 0, 1, 0, 11, 12, 2, 63, 118, 28, 22], ["-", 0, 2, 3, 4, 0, 2, 63, 118, 28, 22], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 28, 22], ["-", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["-", 0, 57, 15, 339, 51, 16, 12, 69, 28, 22], ["+", ... | 1 | 182 |
import sys
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
from math import floor, sqrt, factorial, hypot, log # log2ないyp
from heapq import heappop, heappush, heappushpop
from collections import Counter, defaultdict, deque
from itertools import accumulate, permutations, combinations, product, combinations_w... | import sys
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
from math import floor, sqrt, factorial, hypot, log # log2ないyp
from heapq import heappop, heappush, heappushpop
from collections import Counter, defaultdict, deque
from itertools import accumulate, permutations, combinations, product, combinations_w... | [["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 471 |
package main
import (
"bufio"
"fmt"
"math"
"os"
"sort"
"strconv"
)
var sc = bufio.NewScanner(os.Stdin)
type st struct {
ind int
min int64
}
func main() {
var T string
var S string
fmt.Scan(&S)
fmt.Scan(&T)
min := math.MaxInt32
for i := 0; i < len(S)-len(T); i++ {
tmp := S[i : i+len(T)]
ct := 0
f... | package main
import (
"bufio"
"fmt"
"math"
"os"
"sort"
"strconv"
)
var sc = bufio.NewScanner(os.Stdin)
type st struct {
ind int
min int64
}
func main() {
var T string
var S string
fmt.Scan(&S)
fmt.Scan(&T)
min := math.MaxInt32
for i := 0; i < len(S)-len(T)+1; i++ {
tmp := S[i : i+len(T)]
ct := 0
... | [["+", 0, 7, 0, 430, 15, 16, 12, 16, 17, 72], ["+", 0, 7, 0, 430, 15, 16, 12, 16, 12, 433]] | 7 | 1,170 |
s= input()
t= input()
len_diff= len(s)- len(t)
top=0
for i in range(len_diff):
test= s[i:]
count=0
for j in range(len(t)):
if test[j]==t[j]:
count+=1
if count>top:
top= count
print(len(t)-top)
| s= input()
t= input()
len_diff= len(s)- len(t)
top=0
for i in range(len_diff+1):
test= s[i:]
count=0
for j in range(len(t)):
if test[j]==t[j]:
count+=1
if count>top:
top= count
print(len(t)-top) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 84 |
#include <bits/stdc++.h>
// using namespace std;
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define rep(i, j, n) for (ll i = (ll)(j); i < (ll)(n); i++)
#define REP(i, j, n) for (ll i = (ll)(j); i... | #include <bits/stdc++.h>
// using namespace std;
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define rep(i, j, n) for (ll i = (ll)(j); i < (ll)(n); i++)
#define REP(i, j, n) for (ll i = (ll)(j); i... | [["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22]] | 1 | 2,423 |
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
MyScanner sc = new MyScanner();
out = new PrintWriter(new BufferedOutputStream(System.out));
/**/
String s = sc.next();
String t = sc.next();
int counter = 0;
int min = t.length();
... | import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
MyScanner sc = new MyScanner();
out = new PrintWriter(new BufferedOutputStream(System.out));
/**/
String s = sc.next();
String t = sc.next();
int counter = 0;
int min = t.length();
... | [["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]] | 3 | 369 |
#pragma GCC optimize("O3") //コンパイラ最適化用
#define _GLIBCXX_DEBUG //配列に[]でアクセス時のエラー表示
#include <algorithm> //sort,二分探索,など
#include <bitset> //固定長bit集合
#include <cassert> //assert(p)で,not pのときにエラー
#include <cctype>
#include <chrono> //実行時間計測
#include <cmath> //pow,logなど
#include <complex> //複素数
#include <cst... |
#pragma GCC optimize("O3") //コンパイラ最適化用
#define _GLIBCXX_DEBUG //配列に[]でアクセス時のエラー表示
#include <algorithm> //sort,二分探索,など
#include <bitset> //固定長bit集合
#include <cassert> //assert(p)で,not pのときにエラー
#include <cctype>
#include <chrono> //実行時間計測
#include <cmath> //pow,logなど
#include <complex> //複素数
#include <cst... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 964 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using grid = vector<vector<char>>;
int dx[] = {0, 1, -1, 0, 1, -1, 1, -1}; // i<4:4way i<8:8way
int dy[] = {1, 0, 0, -1, 1, -1, -1, 1};
constexpr ll MOD = 1000000007;
// constexpr ll MOD = 998244353;
constexpr ll INF = 1050000000;
constexpr ll LONGI... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using grid = vector<vector<char>>;
int dx[] = {0, 1, -1, 0, 1, -1, 1, -1}; // i<4:4way i<8:8way
int dy[] = {1, 0, 0, -1, 1, -1, -1, 1};
constexpr ll MOD = 1000000007;
// constexpr ll MOD = 998244353;
constexpr ll INF = 1050000000;
constexpr ll LONGI... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 12,105 |
#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define forn(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define ll long long
int main() {
ios::sync_with_stdio(false);
cin.tie(nullpt... | #include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define forn(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define ll long long
int main() {
ios::sync_with_stdio(false);
cin.tie(nullpt... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 175 |
/* --------------------
| LOSER |
| ~NOOBOSS~ |
--------------------
*/
#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 inl(x) scanf("%lld", &x)
#define in(x) scanf("%d", ... | /* --------------------
| LOSER |
| ~NOOBOSS~ |
--------------------
*/
#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 inl(x) scanf("%lld", &x)
#define in(x) scanf("%d", ... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 1,364 |
def cin(): return list(map(int,input().split()))
S = input()
T = input()
ans = 10 ** 9 + 7
l1 = len(S)
l2 = len(T)
for i in range(l1 - l2):
cnt = 0
for j in range(l2):
if S[i + j] != T[j]: cnt += 1
ans = min(ans, cnt)
print(ans) | def cin(): return list(map(int,input().split()))
S = input()
T = input()
ans = 10 ** 9 + 7
l1 = len(S)
l2 = len(T)
for i in range(l1 - l2 + 1):
cnt = 0
for j in range(l2):
if S[i + j] != T[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 | 99 |
#include <bits/stdc++.h>
#define rep(i, n) for (long long i = 0; i < (int)(n); i++)
#define sum(a) accumulate(a.begin(), a.end(), 0LL)
#define put(i) cout << fixed << i << endl
using namespace std;
using ll = long long;
int main() {
string s, t;
cin >> s >> t;
ll ans = 0;
for (long long i = 0; i < s.size() - ... | #include <bits/stdc++.h>
#define rep(i, n) for (long long i = 0; i < (int)(n); i++)
#define sum(a) accumulate(a.begin(), a.end(), 0LL)
#define put(i) cout << fixed << i << endl
using namespace std;
using ll = long long;
int main() {
string s, t;
cin >> s >> t;
ll ans = 0;
for (long long i = 0; i < s.size() - ... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 158 |
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define Boost \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); ... | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define Boost \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); ... | [["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 22], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22]] | 1 | 162 |
S = list(str(input()))
T = list(str(input()))
l = len(S) - len(T)
f = len(T)
for i in range(l):
temp = 0
for j in range(len(T)):
if S[i+j] != T[j]:
temp += 1
if f > temp:
f = temp
print(f) | S = list(str(input()))
T = list(str(input()))
l = len(S) - len(T)
f = len(T)
for i in range(l+1):
temp = 0
for j in range(len(T)):
if S[i+j] != T[j]:
temp += 1
if f > temp:
f = temp
print(f) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 89 |
#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 sint int32_t
#define int long long int
#define all(v) v.begin(), v.end()
#define vii vector<int>
#define pb push_back
#define pii pair<int, int>
#define F fi... | #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 sint int32_t
#define int long long int
#define all(v) v.begin(), v.end()
#define vii vector<int>
#define pb push_back
#define pii pair<int, int>
#define F fi... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]] | 1 | 193 |
#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;
typedef tree<pair<int, int>, null_type, less<pair<int, int>>, rb_tree_tag,
tree_order_statistics_node_update>
oset;
#define sim template <class c
#defi... | #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;
typedef tree<pair<int, int>, null_type, less<pair<int, int>>, rb_tree_tag,
tree_order_statistics_node_update>
oset;
#define sim template <class c
#defi... | [["+", 36, 36, 36, 36, 36, 36, 0, 42, 0, 72], ["+", 36, 36, 36, 36, 0, 42, 0, 42, 0, 13]] | 1 | 493 |
S=input()
T=input()
ls=len(S)
lt=len(T)
cnt2=lt
for i in range(0,ls-lt):
cnt=0
for ss,tt in zip(S[i:],T):
if ss!=tt:
cnt+=1
if cnt<cnt2:
cnt2=cnt
print(cnt2)
| S=input()
T=input()
ls=len(S)
lt=len(T)
cnt2=lt
for i in range(0,ls-lt+1):
cnt=0
for ss,tt in zip(S[i:],T):
if ss!=tt:
cnt+=1
if cnt<cnt2:
cnt2=cnt
print(cnt2)
| [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 76 |
S=input()
T=input()
nS=len(S)
nT=len(T)
N=nS-nT+1
dfmin=1000
for i in range(N):
df=0
for j in range(nT):
if S[i+j]!=T[j]:
df+=1
if df < dfmin:
dfmin=df
print(df) | S=input()
T=input()
nS=len(S)
nT=len(T)
N=nS-nT+1
dfmin=1000
for i in range(N):
df=0
for j in range(nT):
if S[i+j]!=T[j]:
df+=1
if df < dfmin:
dfmin=df
print(dfmin) | [["-", 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;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins in... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins in... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]] | 1 | 214 |
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define ill long long
#define fcout cout << fixed << setprecision(10)
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int mn = 1001,... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define ill long long
#define fcout cout << fixed << setprecision(10)
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int mn = 1001, ... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 162 |
/* winners never quit and quitters never win.
#swap */
#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;
#pragma GCC optimize("-O3")
using ll = long long;
using ld = long double;
... | /* winners never quit and quitters never win.
#swap */
#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;
#pragma GCC optimize("-O3")
using ll = long long;
using ld = long double;
... | [["-", 51, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["+", 51, 16, 12, 69, 341, 342, 0, 16, 17, 72]] | 1 | 545 |
import java.util.*;
public class Main {
static Scanner scan = new Scanner(System.in);
public static void main(String[] args) {
String s = scan.next();
String t = scan.next();
int ans = t.length();
for (int i = 0; i < s.length() - t.length(); i++) {
int now_ans = t.length();
for (int j... | import java.util.*;
public class Main {
static Scanner scan = new Scanner(System.in);
public static void main(String[] args) {
String s = scan.next();
String t = scan.next();
int ans = t.length();
for (int i = 0; i <= s.length() - t.length(); i++) {
int now_ans = t.length();
for (int ... | [["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]] | 3 | 200 |
S = input()
T = input()
c = len(S) - len(T)
m = 10000
for i in range(c):
count = 0
for s, t in zip(S[i:], T):
if s != t:
count += 1
m = min(m, count)
print(m) | S = input()
T = input()
c = len(S) - len(T)
m = 10000
for i in range(c + 1):
count = 0
for s, t in zip(S[i:], T):
if s != t:
count += 1
m = min(m, count)
print(m) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 71 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int mindiff = t.size();
int tsize = t.size();
int maxloop = s.size() - t.size();
for (int i = 0; i < maxloop; ++i) {
int diff = 0;
for (int j = 0; j < tsize; ++j) {
if (s[i + j] != t[j]) {
++diff;
... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int mindiff = t.size();
int tsize = t.size();
int maxloop = s.size() - t.size();
// fprintf(stderr,"%d\n",maxloop);
for (int i = 0; i <= maxloop; ++i) {
int diff = 0;
for (int j = 0; j < tsize; ++j) {
if... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 127 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n - 1); i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
const int INF = 1e9;
const ll MOD = 1e9 + 7;
const ll LINF = 1e18;
templat... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n - 1); i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
const int INF = 1e9;
const ll MOD = 1e9 + 7;
const ll LINF = 1e18;
templat... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 8, 9, 0, 1, 0, 11, 12, 23, 0, 24], ["+", 8, 9, 0, 1, 0, 11, 12, 23, 0, 25]] | 1 | 421 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int ans = s.size();
for (int i = 0; i < s.size() - t.size(); i++) {
string subStr = s.substr(i, t.size());
int cnt = 0;
for (int j = 0; j < t.size(); j++) {
if (subStr[j] != t[j])
cnt++;
}
an... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int ans = s.size();
for (int i = 0; i <= s.size() - t.size(); i++) {
string subStr = s.substr(i, t.size());
int cnt = 0;
for (int j = 0; j < t.size(); j++) {
if (subStr[j] != t[j])
cnt++;
}
a... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 127 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int mod = 1000000007;
const double PI = acos(-1);
int main() {
string s, t;
cin >> s >> t;
int maxv = 0;
for (int i = 0; i < s.size() - t.size(); i++) {
int count = 0;
for (int j = 0; j < t.size(); j++) {
if (s[i + j] == t[... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int mod = 1000000007;
const double PI = acos(-1);
int main() {
string s, t;
cin >> s >> t;
int maxv = 0;
for (int i = 0; i <= s.size() - t.size(); i++) {
int count = 0;
for (int j = 0; j < t.size(); j++) {
if (s[i + j] == t... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 138 |
#include <algorithm>
#include <assert.h>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
#define int long long
#define double long double
#define rep(i, n) for (int i = 0; i < n; i++)
#define... | #include <algorithm>
#include <assert.h>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
#define int long long
#define double long double
#define rep(i, n) for (int i = 0; i < n; i++)
#define... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 1,217 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, n) for (int i = 1; i <= (int)(n); i++)
int main() {
string S, T;
cin >> S >> T;
int min = 9999999;
for (int i = 0; i < S.size() - T.size(); i++) {
int cnt = 0;
for (int j = 0; j < T.size(... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, n) for (int i = 1; i <= (int)(n); i++)
int main() {
string S, T;
cin >> S >> T;
int min = 9999999;
for (int i = 0; i < S.size() - T.size() + 1; i++) {
int cnt = 0;
for (int j = 0; j < T.s... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 135 |
#include <bits/stdc++.h>
#include <iostream>
#include <string>
using namespace std;
int main() {
long long i, j, l, r, q, t, m, n, d, p, h, x;
long long k, z, y, p1, h1;
string st = "", s1 = "", s2 = "";
q = 1;
for (l = 0; l < q; l++) {
std::cin >> st >> s1;
n = st.length();
m = s1.length();
... | #include <bits/stdc++.h>
#include <iostream>
#include <string>
using namespace std;
int main() {
long long i, j, l, r, q, t, m, n, d, p, h, x;
long long k, z, y, p1, h1;
string st = "", s1 = "", s2 = "";
q = 1;
for (l = 0; l < q; l++) {
std::cin >> st >> s1;
n = st.length();
m = s1.length();
... | [["-", 0, 7, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 7, 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 | 195 |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string s, t;
cin >> s >> t;
int n = s.size();
int m = t.size();
int min_count = INT_MAX;
for (int i = 0; i < n - m; i++) {
int count = 0;
for (int j = 0, k = i; j < m; j++, k++) {
if... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string s, t;
cin >> s >> t;
int n = s.size();
int m = t.size();
int min_count = INT_MAX;
for (int i = 0; i <= n - m; i++) {
int count = 0;
for (int j = 0, k = i; j < m; j++, k++) {
i... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 141 |
S = input()
T = input()
max_cnt = 0
for i in range(len(S)-len(T)+1):
print(i)
cnt = 0
for j in range(len(T)):
if S[i+j] == T[j]:
cnt += 1
max_cnt = max(max_cnt, cnt)
print(len(T) - max_cnt) | S = input()
T = input()
max_cnt = 0
for i in range(len(S)-len(T)+1):
cnt = 0
for j in range(len(T)):
if S[i+j] == T[j]:
cnt += 1
max_cnt = max(max_cnt, cnt)
print(len(T) - max_cnt) | [["-", 0, 7, 8, 196, 0, 1, 0, 652, 63, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]] | 5 | 82 |
#include <cmath>
#include <deque>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
// #define FOR(i, start, end) for(ll i = (start); i < (end); i++)
// #define rep(i, n) FOR(i, 0, n)
// #define all(x) (x).begin(),(x).end()
// #define ctoi(c) c - '0'
// #define tos(s) to_string(s)
typedef ... | #include <cmath>
#include <deque>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
// #define FOR(i, start, end) for(ll i = (start); i < (end); i++)
// #define rep(i, n) FOR(i, 0, n)
// #define all(x) (x).begin(),(x).end()
// #define ctoi(c) c - '0'
// #define tos(s) to_string(s)
typedef ... | [["+", 0, 7, 15, 16, 12, 23, 0, 16, 17, 72], ["+", 0, 7, 15, 16, 12, 23, 0, 16, 12, 13]] | 1 | 144 |
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define maxn 400010
#define LL long long
#define inf 10000000000
#define mod 100000000
#define pi 3.14159265359
using namespace std;
int dx[24... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define maxn 400010
#define LL long long
#define inf 10000000000
#define mod 100000000
#define pi 3.14159265359
using namespace std;
int dx[24... | [["-", 0, 7, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 460 |
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#def... | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#def... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 199 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define F first
#define S second
#define endl '\n'
#define all(v) (v).begin(), (v).end()
template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) {
os << '{';
string sep;
for (const auto &x : v)
os << sep... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define F first
#define S second
#define endl '\n'
#define all(v) (v).begin(), (v).end()
template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) {
os << '{';
string sep;
for (const auto &x : v)
os << sep... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 460 |
#[int(i) for i in input().split()]
def diff(x,y):
ret = 0
for i in range(len(x)):
if x[i]!=y[i]:
ret+=1
return ret
s=input()
t=input()
l = len(t)
ans = float('inf')
for i in range(len(s)):
if i+l<len(s):
tmp = diff(s[i:i+l], t)
ans = min(ans, tmp)
print(ans)
| #[int(i) for i in input().split()]
def diff(x,y):
ret = 0
for i in range(len(x)):
if x[i]!=y[i]:
ret+=1
return ret
s=input()
t=input()
l = len(t)
ans = float('inf')
for i in range(len(s)):
if i+l<len(s)+1:
tmp = diff(s[i:i+l], t)
ans = min(ans, tmp)
print(ans)
| [["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 72], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 12, 612]] | 5 | 111 |
#include <bits/stdc++.h>
using namespace std;
string s, t;
int a, b, ans = 1111, res;
int main() {
cin >> s >> t;
a = s.length();
b = t.length();
for (int i = 0; i < a; i++) {
res = 0;
for (int j = 0; j < b; j++)
if (s[i + j] != t[j])
res++;
ans = min(ans, res);
}
cout << ans << en... | #include <bits/stdc++.h>
using namespace std;
string s, t;
int a, b, ans = 1111, res;
int main() {
cin >> s >> t;
a = s.length();
b = t.length();
for (int i = 0; i < a - b + 1; i++) {
res = 0;
for (int j = 0; j < b; j++)
if (s[i + j] != t[j])
res++;
ans = min(ans, res);
}
cout << a... | [["+", 0, 7, 15, 16, 12, 16, 31, 16, 17, 33], ["+", 0, 7, 15, 16, 12, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 119 |
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
using i64 = int64_t;
using P = p... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
using i64 = int64_t;
using P = p... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 185 |
S = input()
T = input()
def count_common(a,b):
cnt = 0
for i in range(len(a)):
if a[i] == b[i]:
cnt += 1
return cnt
cnt = 0
for i in range(len(S) - len(T) - 1):
cnt = max(cnt, count_common(S[i:i+len(T)],T))
print(len(T)-cnt) | S = input()
T = input()
def count_common(a,b):
cnt = 0
for i in range(len(a)):
if a[i] == b[i]:
cnt += 1
return cnt
cnt = 0
for i in range(len(S) - len(T) + 1):
cnt = max(cnt, count_common(S[i:i+len(T)],T))
print(len(T)-cnt) | [["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72]] | 5 | 101 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.