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, a, b) for (int i = (int)(a); i < (int)(b); ++i)
using namespace std;
using ll = long long;
int main() {
string S, T;
cin >> S >> T;
int ans = 999999;
int size = static_cast<int>(S.size() - T.size());
int t_size = static_cast<int>(T.size());
for (int i = 0; i < size;... | #include <bits/stdc++.h>
#define rep(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
using namespace std;
using ll = long long;
int main() {
string S, T;
cin >> S >> T;
int ans = 999999;
int size = static_cast<int>(S.size() - T.size());
int t_size = static_cast<int>(T.size());
for (int i = 0; i <= size... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 157 |
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
template... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
template... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 418 |
S = input()
T = input()
ans = len(T)
n1 = len(S)-len(T)
for i in range(n1):
ans2 = 0
for k in range(len(T)):
# print(S[k+1],T[k])
if S[k+i] != T[k]:
ans2 += 1
ans = min([ans,ans2])
# print(ans)
print(ans) | S = input()
T = input()
ans = len(T)
n1 = len(S)-len(T)+1
for i in range(n1):
ans2 = 0
for k in range(len(T)):
# print(S[k+i],T[k])
if S[k+i] != T[k]:
ans2 += 1
ans = min([ans,ans2])
# print(ans)
print(ans) | [["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 72], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612]] | 5 | 81 |
#include <bits/stdc++.h>
using namespace std;
#define REP(i, init, n) for (int i = (int)(init); i < (int)(n); i++)
#define vi vector<int>
#define vl vector<long>
#define vvi vector<vector<int>>
#define vvl vector<vector<long>>
#define pint pair<int, int>
#define plong pair<long, long>
int main() {
string s, t;
ci... | #include <bits/stdc++.h>
using namespace std;
#define REP(i, init, n) for (int i = (int)(init); i < (int)(n); i++)
#define vi vector<int>
#define vl vector<long>
#define vvi vector<vector<int>>
#define vvl vector<vector<long>>
#define pint pair<int, int>
#define plong pair<long, long>
int main() {
string s, t;
ci... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 143 |
#ceilevenoddformula
import math
import bisect
import copy
import time
from collections import Counter
from itertools import combinations
#map(int,input().split())
#int(x) for x in input().split()
s=input()
x=input()
if x in s:
print(0)
else:
ans=10**9
for i in range(len(s)-len(x)):
c=0
for j in range(len(x)):
... | #ceilevenoddformula
import math
import bisect
import copy
import time
from collections import Counter
from itertools import combinations
#map(int,input().split())
#int(x) for x in input().split()
s=input()
x=input()
if x in s:
print(0)
else:
ans=10**9
for i in range(len(s)-len(x)+1):
c=0
for j in range(len(x)):
... | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 103 |
S = input()
T = input()
ans = 1000
for i in range(len(S)-len(T)):
s = S[i:i+len(T)]
con = 0
for j in range(len(T)):
if s[j] != T[j]:
con += 1
if con <= ans:
ans = con
print(ans) | S = input()
T = input()
ans = 10000
for i in range(len(S)-len(T)+1):
s = S[i:i+len(T)]
con = 0
for j in range(len(T)):
if s[j] != T[j]:
con += 1
if con <= ans:
ans = con
print(ans) | [["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 82 |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
typedef pair<int, int> pii;
const int mod = (int)1000000007;
const int inf = (int)2e18;
int cost(string &s, string &t) {
int n = t.size(), c = 0;
for (int i = 0; i < n; i++)
... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
typedef pair<int, int> pii;
const int mod = (int)1000000007;
const int inf = (int)2e18;
int cost(string &s, string &t) {
int n = t.size(), c = 0;
for (int i = 0; i < n; i++)
... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 243 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repd(i, n) for (int i = n - 1; i > -1; i--)
#define repran(i, a, b) for (int i = a; i < b; i++)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> P;
int main() {
string s, t;
cin >> s... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repd(i, n) for (int i = n - 1; i > -1; i--)
#define repran(i, a, b) for (int i = a; i < b; i++)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> P;
int main() {
string s, t;
cin >> s... | [["+", 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 | 145 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int n = s.size();
int m = t.size();
int ans = INT_MAX;
for (int i = 0; i < n; i++) {
string st = s.substr(i, m);
int k = 0;
for (int j = 0; j < m; j++) {
if (st[j] != t[j])
k++;
}
if (k ... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int n = s.size();
int m = t.size();
int ans = INT_MAX;
for (int i = 0; i <= n - m; i++) {
string st = s.substr(i, m);
int k = 0;
for (int j = 0; j < m; j++) {
if (st[j] != t[j])
k++;
}
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 | 126 |
def resolve():
s = input()
t = input()
ls = len(s)
lt = len(t)
c = []
for i in range(ls - lt):
count = 0
for j in range(lt):
if s[i+j] == t[j]:
count += 1
c.append(count)
print(lt - max(c))
resolve() | def resolve():
s = input()
t = input()
ls = len(s)
lt = len(t)
c = []
for i in range(ls - lt + 1):
count = 0
for j in range(lt):
if s[i+j] == t[j]:
count += 1
c.append(count)
print(lt - max(c))
resolve() | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 86 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve(std::string S, std::string T) {
int cnt = 1e9;
for (int i = 0; i < S.size() - T.size(); i++) {
int current = 0;
for (int j = 0; j < T.size(); j++) {
if (S[i + j] != T[j])
current++;
}
cnt = min(current, cn... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve(std::string S, std::string T) {
int cnt = 1e9;
for (int i = 0; i < (S.size() - T.size()) + 1; i++) {
int current = 0;
for (int j = 0; j < T.size(); j++) {
if (S[i + j] != T[j])
current++;
}
cnt = min(curre... | [["+", 0, 7, 15, 16, 12, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 2, 3, 4, 0, 25], ["+", 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>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
#define ll long long
#define ld long double
#define MOD 1000000007
#define nl cout << bl
#define rt ll Q[100005] = {0}
#define mp make_pair
#define test() \... | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
#define ll long long
#define ld long double
#define MOD 1000000007
#define nl cout << bl
#define rt ll Q[100005] = {0}
#define mp make_pair
#define test() \... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 669 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
int main() {
string s, t;
cin >> s >> t;
int dif = 0, ans = 1001;
rep(i, s.length() - t.length()) {
rep(j, t.length()) if (s[i + j] != t[j]) dif++;
ans = min(ans, dif);
dif = 0;
}
cout << ans << endl;
... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
int main() {
string s, t;
cin >> s >> t;
int dif = 0, ans = 1001;
rep(i, s.length() - t.length() + 1) {
rep(j, t.length()) if (s[i + j] != t[j]) dif++;
ans = min(ans, dif);
dif = 0;
}
cout << ans << en... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 109 |
import java.io.IOException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
String s = sc.next();
String t = sc.next();
int m = t.length();
for (int i = 0; i < s.length() - t.length() + 1; i++) {
... |
import java.io.IOException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
String s = sc.next();
String t = sc.next();
int m = t.length();
for (int i = 0; i < s.length() - t.length() + 1; i++) {
... | [["+", 0, 16, 31, 492, 3, 4, 0, 16, 17, 72], ["+", 0, 16, 31, 492, 3, 4, 0, 16, 12, 22]] | 3 | 166 |
import numpy as np
S = list(input())
T = list(input())
s_len = len(S)
t_len = len(T)
max_same = 0
for i in range(s_len-t_len):
tmp_s = S[i:i+t_len]
count_same = 0
for j in range(t_len):
if T[j] == tmp_s[j]:
count_same += 1
if count_same > max_same:
max_same = count_same
pr... | import numpy as np
S = list(input())
T = list(input())
s_len = len(S)
t_len = len(T)
max_same = 0
for i in range(s_len-t_len+1):
tmp_s = S[i:i+t_len]
count_same = 0
for j in range(t_len):
if T[j] == tmp_s[j]:
count_same += 1
if count_same > max_same:
max_same = count_same
... | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 94 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long INF = 1LL << 60;
bool vector_finder(std::vector<ll> vec, ll number) {
auto itr = std::find(vec.begin(), vec.end(), number);
size_t index = std::distance(vec.begin(), itr);
if (index != vec.size()) {
return true;
} else {
... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long INF = 1LL << 60;
bool vector_finder(std::vector<ll> vec, ll number) {
auto itr = std::find(vec.begin(), vec.end(), number);
size_t index = std::distance(vec.begin(), itr);
if (index != vec.size()) {
return true;
} else {
... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 402 |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
char[] S = sc.next().toCharArray();
char[] T = sc.next().toCharArray();
int c, max = 0;
for (int i = 0; i < S.length - T.length; i++) {
c = 0;
for (int j = 0; j < T.le... | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
char[] S = sc.next().toCharArray();
char[] T = sc.next().toCharArray();
int c, max = 0;
for (int i = 0; i < S.length - T.length + 1; i++) {
c = 0;
for (int j = 0; j < ... | [["+", 8, 196, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 196, 0, 7, 15, 16, 12, 16, 12, 499]] | 3 | 155 |
S = input()
T = input()
a = 0
ans = len(T)
c = len(T)
for i in range(len(S)-len(T)):
b = 0
c = len(T)
for j in T:
if S[i+b] == j:
c -= 1
b += 1
else:
if ans > c:
ans = c
print(ans)
| S = input()
T = input()
a = 0
ans = len(T)
c = len(T)
for i in range(len(S)-len(T)+1):
b = 0
c = len(T)
for j in T:
if S[i+b] == j:
c -= 1
b += 1
else:
if ans > c:
ans = c
print(ans)
| [["+", 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;
typedef pair<int, int> P;
struct edge {
int to, id;
};
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define mod 1000000007
using graph = vector<vector<ll>>;
int main() {
string s, t;
cin >> s;
cin >> t;
int ans = t.length();
for ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
typedef pair<int, int> P;
struct edge {
int to, id;
};
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define mod 1000000007
using graph = vector<vector<ll>>;
int main() {
string s, t;
cin >> s;
cin >> t;
int ans = t.length();
for ... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 166 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
#define VL vector<ll>
#define VS vector<string>
ll INF = 1e18 + 5;
int main() {
string S, T;
cin >> S >> T;
ll ans = INF;
rep(i, 0, S.size() - T.size()) {
ll tmp... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
#define VL vector<ll>
#define VS vector<string>
ll INF = 1e18 + 5;
int main() {
string S, T;
cin >> S >> T;
ll ans = INF;
rep(i, 0, S.size() - T.size() + 1) {
ll... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 143 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define PI acos(-1)
#define fast_io \
ios_base::sync_with_stdio(false); ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define PI acos(-1)
#define fast_io \
ios_base::sync_with_stdio(false); ... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 180 |
s = str(input())
t = str(input())
ls = len(s)
lt = len(t)
a = 0
for i in range(ls):
if i >= lt:
break
if s[i] != t[i]:
a += 1
b = 0
for i in range(1, ls-lt+1):
for j in range(i, ls):
if j - i >= lt:
break
if s[j] != t[j-i]:
b += 1
if b < a:
... | s = str(input())
t = str(input())
ls = len(s)
lt = len(t)
a = 0
for i in range(ls):
if i >= lt:
break
if s[i] != t[i]:
a += 1
for i in range(1, ls-lt+1):
b = 0
for j in range(i, ls):
if j - i >= lt:
break
if s[j] != t[j-i]:
b += 1
if b < a:
... | [["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["-", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 12, 612]] | 5 | 122 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep1n(i, n) for (int i = 1; i <= (n); ++i)
#define repxn(i, x, n) for (int i = x; i <= (n); ++i)
#define sort_u(x) sort((x).begin(), (x).end())
#define sort_d(x) sort((x).begin(), (x).end(), greater<int>())
#define pb push_back
#define INF... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep1n(i, n) for (int i = 1; i <= (n); ++i)
#define repxn(i, x, n) for (int i = x; i <= (n); ++i)
#define sort_u(x) sort((x).begin(), (x).end())
#define sort_d(x) sort((x).begin(), (x).end(), greater<int>())
#define pb push_back
#define INF... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 192 |
#include <iostream>
#include <string>
int main() {
std::string S, T;
std::cin >> S >> T;
int max = 0;
int buf;
for (int i = 0; i < S.size() - T.size(); ++i) {
buf = 0;
for (int j = 0; j < T.size(); ++j) {
if (S[i + j] == T[j]) {
buf++;
}
}
if (buf > max) {
max = buf;... | #include <iostream>
#include <string>
int main() {
std::string S, T;
std::cin >> S >> T;
int max = 0;
int buf;
for (int i = 0; i <= S.size() - T.size(); ++i) {
buf = 0;
for (int j = 0; j < T.size(); ++j) {
if (S[i + j] == T[j]) {
buf++;
}
}
if (buf > max) {
max = buf... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 130 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<vector<int>> Graph;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
#define pi 3.14159265359
#define inf 2147483647
#define INF 9223372036854775807
#define mod 1000000007
#define mod2 998244353
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<vector<int>> Graph;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
#define pi 3.14159265359
#define inf 2147483647
#define INF 9223372036854775807
#define mod 1000000007
#define mod2 998244353
... | [["+", 51, 16, 31, 69, 341, 342, 0, 16, 17, 72], ["+", 51, 16, 31, 69, 341, 342, 0, 16, 12, 22]] | 1 | 186 |
#include <stdio.h>
#include <string.h>
int main() {
int a, b, c, i;
int ans = 99999;
int tmp = 0;
char s[9999];
char t[9999];
int sl, tl;
scanf("%s", s);
scanf("%s", t);
sl = strlen(s);
tl = strlen(t);
for (i = 0; i < sl - tl + 1; i++) {
b = 0;
for (a = 0; a < tl; a++) {
if (s[i] ... | #include <stdio.h>
#include <string.h>
int main() {
int a, b, c, i;
int ans = 99999;
int tmp = 0;
char s[9999];
char t[9999];
int sl, tl;
scanf("%s", s);
scanf("%s", t);
sl = strlen(s);
tl = strlen(t);
for (i = 0; i < sl - tl + 1; i++) {
b = 0;
for (a = 0; a < tl; a++) {
if (s[i +... | [["+", 15, 23, 0, 16, 31, 69, 71, 16, 17, 72], ["+", 15, 23, 0, 16, 31, 69, 71, 16, 12, 22]] | 0 | 157 |
#include <climits>
#include <iostream>
#include <string>
using namespace std;
int main() {
string s, t;
cin >> s;
cin >> t;
int tsize = t.size();
int ssize = s.size();
int dif_min = INT_MAX;
for (int i = 0; i + tsize <= ssize; i++) {
string hoge = s.substr(i, i + tsize - 1);
int counter = 0;
f... | #include <climits>
#include <iostream>
#include <string>
using namespace std;
int main() {
string s, t;
cin >> s;
cin >> t;
int tsize = t.size();
int ssize = s.size();
int dif_min = INT_MAX;
for (int i = 0; i + tsize <= ssize; i++) {
string hoge = s.substr(i, tsize);
int counter = 0;
for (int ... | [["-", 51, 2, 3, 4, 0, 16, 31, 16, 31, 22], ["-", 51, 2, 3, 4, 0, 16, 31, 16, 17, 72], ["-", 49, 50, 51, 2, 3, 4, 0, 16, 17, 33], ["-", 49, 50, 51, 2, 3, 4, 0, 16, 12, 13]] | 1 | 143 |
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
std::size_t count(const std::string &s, const std::string &t) {
std::size_t result = 0;
for (std::size_t i = 0; i < t.size(); ++i) {
if (s[i] != t[i])
++result;
}
return result;
}
std::size_t solve(const ... | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
std::size_t count(const std::string &s, const std::string &t) {
std::size_t result = 0;
for (std::size_t i = 0; i < t.size(); ++i) {
if (s[i] != t[i])
++result;
}
return result;
}
std::size_t solve(const ... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 219 |
#include <iostream>
using namespace std;
int main() {
int ans = 10000;
string s, t;
cin >> s >> t;
for (int i = 0; i < (s.size() - t.size()); i++) {
int tmp = 0;
for (int j = 0; j < t.size(); j++) {
if (s.at(j + i) != t.at(j)) {
tmp++;
}
}
if (tmp < ans)
ans = tmp;
}... | #include <iostream>
using namespace std;
int main() {
int ans = 100000;
string s, t;
cin >> s >> t;
for (int i = 0; i < (s.size() - t.size() + 1); i++) {
int tmp = 0;
for (int j = 0; j < t.size(); j++) {
if (s.at(j + i) != t.at(j)) {
tmp++;
}
}
if (tmp < ans)
ans = tmp... | [["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 7, 15, 16, 12, 23, 0, 16, 17, 72], ["+", 0, 7, 15, 16, 12, 23, 0, 16, 12, 13]] | 1 | 123 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int ns = s.size();
int nt = t.size();
vector<int> match(ns - nt);
match[0] = nt;
for (int i = 0; i < ns - nt + 1; i++) {
int mat = nt;
for (int j = 0; j < nt; j++) {
if (t[j] == s[i + j]) {
mat-... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int ns = s.size();
int nt = t.size();
vector<int> match(ns - nt + 2);
match[0] = nt;
for (int i = 0; i < ns - nt + 1; i++) {
int mat = nt;
for (int j = 0; j < nt; j++) {
if (t[j] == s[i + j]) {
... | [["+", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13], ["-", 31, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["+", 31, 16, 12, 69, 341, 342, 0, 16, 17, 72]] | 1 | 149 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, N) for (int i = 0; i < (int)(N); i++)
// chmax, chmin
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a =... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, N) for (int i = 0; i < (int)(N); i++)
// chmax, chmin
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a =... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 210 |
// *
// *
// * Created By :hozaifa wahid
// * "mai maut ko takia aur kafan ko chadar banakar sota hu"
// *------------------------------------
// * OS : Ubuntu 16.04
// * Language : CPP14
// * Editor : Sublime Text 3
// * C++ compiler : g++
// *https://www.geeksforgeeks.org/space-and-time-efficient-binomial-coeffi... | // *
// *
// * Created By :hozaifa wahid
// * "mai maut ko takia aur kafan ko chadar banakar sota hu"
// *------------------------------------
// * OS : Ubuntu 16.04
// * Language : CPP14
// * Editor : Sublime Text 3
// * C++ compiler : g++
// *https://www.geeksforgeeks.org/space-and-time-efficient-binomial-coeffi... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 977 |
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
char s[1010];
char t[1010];
int szS;
int szT;
int main() {
scanf("%s\n", s);
scanf("%s\n", t);
... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
char s[1010];
char t[1010];
int szS;
int szT;
int main() {
scanf("%s\n", s);
scanf("%s\n", t);
... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 178 |
s = input()
t = input()
b = len(s)
a = len(t)
min_cnt = 100000000
for i in range(b - a + 1):
cnt = 0
for j in range(a):
if s[j+i] != t[j]:
cnt += 1
if min_cnt > cnt:
min_cnt = cnt
print(cnt)
| s = input()
t = input()
b = len(s)
a = len(t)
min_cnt = 100000000
for i in range(b - a + 1):
cnt = 0
for j in range(a):
if s[j+i] != t[j]:
cnt += 1
if min_cnt > cnt:
min_cnt = cnt
print(min_cnt)
| [["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]] | 5 | 76 |
S,T=input(),input()
res=n=len(T)
m=len(S)
for i in range(m-n):
c = 0
for k in range(n):
if S[i+k]!=T[k]:
c+=1
res=min(res,c)
print(res) | S,T=input(),input()
res=n=len(T)
m=len(S)
for i in range(m-n+1):
c = 0
for k in range(n):
if S[i+k]!=T[k]:
c+=1
res=min(res,c)
print(res) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 74 |
s = input()
t = input()
cost = 10**9+7
for i in range(len(s) - len(t)):
c = 0
sub_s = s[i:i+len(t)]
for j in range(len(t)):
if sub_s[j] != t[j]:
c += 1
cost = min(c, cost)
print(cost) | s = input()
t = input()
cost = 10**9+7
for i in range(len(s) - len(t)+1):
c = 0
sub_s = s[i:i+len(t)]
for j in range(len(t)):
if sub_s[j] != t[j]:
c += 1
cost = min(c, cost)
print(cost) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 86 |
S=str(input())
T=str(input())
min_count=len(T)
for i in range(len(S)-len(T)):
count=0
for j in range(len(T)):
if S[i+j]!=T[j]:
count+=1
min_count=min(count,min_count)
print(min_count)
| S=str(input())
T=str(input())
min_count=len(T)
for i in range((len(S)-len(T))+1):
count=0
for j in range(len(T)):
if S[i+j]!=T[j]:
count+=1
min_count=min(count,min_count)
print(min_count)
| [["+", 12, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 31, 23, 0, 657, 12, 652, 3, 4, 0, 25], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 80 |
def main():
s = input()
t = input()
# sがtの長さにおいて一致している最大の文字数を特定
max_counter = 0
for i in range(len(s)-len(t)):
counter = 0
for j in range(len(t)):
if s[i+j] == t[j]:
counter += 1
if counter > max_counter:
max_counter = counter
an... | def main():
s = input()
t = input()
# sがtの長さにおいて一致している最大の文字数を特定
max_counter = 0
for i in range(len(s)-len(t)+1):
counter = 0
for j in range(len(t)):
if s[i+j] == t[j]:
counter += 1
if counter > max_counter:
max_counter = counter
... | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 95 |
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define BUF 1002
int main(void) {
char s[BUF], t[BUF];
scanf("%s %s", s, t);
int min = strlen(t);
for (int i = 0; i < strlen(s) - strlen(t); i++) {
int count = 0;
for (int j = 0; j < strlen(t); j++) {
if (s[i + j] != t... | #include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define BUF 1002
int main(void) {
char s[BUF], t[BUF];
scanf("%s %s", s, t);
int min = strlen(t);
for (int i = 0; i < strlen(s) - strlen(t) + 1; i++) {
int count = 0;
for (int j = 0; j < strlen(t); j++) {
if (s[i + j] ... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 0 | 140 |
s = input()
t = input()
count = 0
reg = 0
for i in range(len(s)-len(t)):
for j in range(len(t)):
if s[i+j] == t[j]:
count = count + 1
if count > reg:
reg = count
count = 0
reg = len(t) - reg
print(reg)
| s = input()
t = input()
count = 0
reg = 0
for i in range(len(s)-len(t)+1):
for j in range(len(t)):
if s[i+j] == t[j]:
count = count + 1
if count > reg:
reg = count
count = 0
reg = len(t) - reg
print(reg)
| [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 84 |
//(bool) ? (if true) : (if false)
// 63LL - __builtin_clzll(n)
//(x&-x)
#include <bits/stdc++.h>
#define fastio \
ios_base::sync_with_stdio(0); \
cin.tie(0)
#define fst first
#define snd second
#define all... | //(bool) ? (if true) : (if false)
// 63LL - __builtin_clzll(n)
//(x&-x)
#include <bits/stdc++.h>
#define fastio \
ios_base::sync_with_stdio(0); \
cin.tie(0)
#define fst first
#define snd second
#define all... | [["-", 0, 1, 0, 2, 3, 4, 0, 118, 28, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 31, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 2, 3, 4, 0, 16, 12, 118, 28, 22]] | 1 | 237 |
s = input()
t= input()
len_t = len(t)
len_s = len(s)
ans = len_t
for i in range(len_s - len_t):
s_sub = s[i:len_t + i]
ans = min(ans, len([... for i in range(len_t) if t[i] != s_sub[i]]))
print(ans) | s = input()
t= input()
len_t = len(t)
len_s = len(s)
ans = len_t
for i in range(len_s - len_t+1):
s_sub = s[i:len_t + i]
ans = min(ans, len([... for i in range(len_t) if t[i] != s_sub[i]]))
print(ans) | [["+", 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>
#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 n = s.size();
int m = t.size();
int ans = 1e9;
for (int i = 0; i < n - m; i++) {
int tmp = 0;
for (int j = 0; j... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
string s, t;
cin >> s >> t;
int n = s.size();
int m = t.size();
int ans = 1e9;
for (int i = 0; i <= n - m; i++) {
int tmp = 0;
for (int j = 0; ... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 148 |
/*
* Coder: @SumitRaut
*/
#include <bits/stdc++.h>
using namespace std;
inline void solve() {
string s, t;
cin >> s >> t;
int ns = s.length(), nt = t.length();
int ans = INT_MAX;
for (int i = 0; i < ns; ++i) {
int cnt = 0;
for (int j = 0, k = i; j < nt; ++j, ++k) {
if (s[k] != t[j])
+... | /*
* Coder: @SumitRaut
*/
#include <bits/stdc++.h>
using namespace std;
inline void solve() {
string s, t;
cin >> s >> t;
int ns = s.length(), nt = t.length();
int ans = INT_MAX;
for (int i = 0; i <= ns - nt; ++i) {
int cnt = 0;
for (int j = 0, k = i; j < nt; ++j, ++k) {
if (s[k] != 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 | 152 |
#define _CRT_SECURE_NO_WARNINGS
#include <ctype.h>
#include <inttypes.h>
#include <limits.h>
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wchar.h>
#define N_MAX (100)
#define P_MAX (100)
#define DP_ARRAY_SIZE (N_MAX * P_MAX / 32 + 1)
... | #define _CRT_SECURE_NO_WARNINGS
#include <ctype.h>
#include <inttypes.h>
#include <limits.h>
#include <math.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wchar.h>
#define N_MAX (100)
#define P_MAX (100)
#define DP_ARRAY_SIZE (N_MAX * P_MAX / 32 + 1)
... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 0 | 3,340 |
// https://atcoder.jp/contests/abc177/tasks/abc177_b
#include "algorithm"
#include "bitset"
#include "cmath"
#include "functional"
#include "iomanip"
#include "iostream"
#include "map"
#include "numeric"
#include "queue"
#include "set"
#include "string"
#include "vector"
#define rep(i, to) for (ll i = 0; i < (to); ++i... | // https://atcoder.jp/contests/abc177/tasks/abc177_b
#include "algorithm"
#include "bitset"
#include "cmath"
#include "functional"
#include "iomanip"
#include "iostream"
#include "map"
#include "numeric"
#include "queue"
#include "set"
#include "string"
#include "vector"
#define rep(i, to) for (ll i = 0; i < (to); ++i... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 529 |
def diff(s,t):
assert len(s) == len(t)
c = 0
for i,j in zip(s,t):
if i != j:
c+=1
else:
pass
return c
s=input()
t=input()
n=len(s)
m=len(t)
min_=10**5
for i in range(n-m):
min_=min(min_,diff(s[i:m+i],t))
print(min_) | def diff(s,t):
assert len(s) == len(t)
#print(s,t)
c = 0
for i,j in zip(s,t):
if i != j:
c+=1
else:
pass
return c
s=input()
t=input()
n=len(s)
m=len(t)
min_=10**5
for i in range(n-m+1):
min_=min(min_,diff(s[i:m+i],t))
print(min_) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 107 |
// header {{{
// header {{{
using namespace std;
#include <bits/stdc++.h>
#define CPP_STR(x) CPP_STR_I(x)
#define CPP_CAT(x, y) CPP_CAT_I(x, y)
#define CPP_STR_I(args...) #args
#define CPP_CAT_I(x, y) x##y
#define ASSERT(expr...) assert((expr))
using i8 = int8_t;
using u8 = uint8_t;
using i16 = int16_t;
using u16 = ... | // header {{{
// header {{{
using namespace std;
#include <bits/stdc++.h>
#define CPP_STR(x) CPP_STR_I(x)
#define CPP_CAT(x, y) CPP_CAT_I(x, y)
#define CPP_STR_I(args...) #args
#define CPP_CAT_I(x, y) x##y
#define ASSERT(expr...) assert((expr))
using i8 = int8_t;
using u8 = uint8_t;
using i16 = int16_t;
using u16 = ... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 736 |
#include <bits/stdc++.h>
using namespace std;
#define stop exit(0)
#define pb push_back
#define skip continue
#define ll long long
int a, b, c, d = 0, e = 0, i, f = 0, g = 0, j, k = 0, l = 0, r, m, h, p[101],
df[51];
string t, x, q, s;
double w;
vector<ll> dv[101], v, z;
vector<string> u;
map<string, ll> n... | #include <bits/stdc++.h>
using namespace std;
#define stop exit(0)
#define pb push_back
#define skip continue
#define ll long long
int a, b, c, d = 0, e = 0, i, f = 0, g = 0, j, k = 0, l = 0, r, m, h, p[101],
df[51];
string t, x, q, s;
double w;
vector<ll> dv[101], v, z;
vector<string> u;
map<string, ll> n... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 288 |
s=input()
l=input()
len_s=len(s)
len_l=len(l)
a=len_s-len_l
ans=1001
for i in range(len_s-len_l):
cnt=0
for j in range(len_l):
if l[j]!=s[i+j]:
cnt+=1
ans=min(ans,cnt)
print(ans) | s=input()
l=input()
len_s=len(s)
len_l=len(l)
a=len_s-len_l
ans=1001
for i in range(len_s-len_l+1):
cnt=0
for j in range(len_l):
if l[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 | 79 |
#include <bits/stdc++.h>
using namespace std;
long long int
modPow(long long int a,
long long int n) { //繰り返し自乗法(a^n mod p)。計算量 O(logN)
long long int p = pow(10, 9) + 7; //任意のp(素数) modのやつで使える
if (n == 0) {
return 1;
}
if (n == 1) {
return a % p;
}
if (n % 2 == 1) {
return (a * modPow(a, ... | #include <bits/stdc++.h>
using namespace std;
long long int
modPow(long long int a,
long long int n) { //繰り返し自乗法(a^n mod p)。計算量 O(logN)
long long int p = pow(10, 9) + 7; //任意のp(素数) modのやつで使える
if (n == 0) {
return 1;
}
if (n == 1) {
return a % p;
}
if (n % 2 == 1) {
return (a * modPow(a, ... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 239 |
s = list(input())
t = list(input())
m = len(s)
l = len(t)
ans = m
for i in range(m-l):
defe = 0
for j in range(l):
if t[j] != s[i+j]:
defe += 1
ans = min(defe, ans)
print(ans) | s = list(input())
t = list(input())
m = len(s)
l = len(t)
ans = m
for i in range(m-l+1):
defe = 0
for j in range(l):
if t[j] != s[i+j]:
defe += 1
ans = min(defe, ans)
print(ans) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 80 |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long double ld;
typedef long long ll;
typedef pair<int, int> ii;
typedef tree<ii, null_type, less<ii>, rb_tree_tag,
tree_order_statistics_node_update>
indexed_set;
// *st.find_by_... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long double ld;
typedef long long ll;
typedef pair<int, int> ii;
typedef tree<ii, null_type, less<ii>, rb_tree_tag,
tree_order_statistics_node_update>
indexed_set;
// *st.find_by_... | [["+", 51, 16, 31, 69, 341, 342, 0, 16, 17, 72], ["+", 51, 16, 31, 69, 341, 342, 0, 16, 12, 22], ["-", 51, 16, 12, 69, 341, 342, 0, 16, 31, 22], ["-", 51, 16, 12, 69, 341, 342, 0, 16, 17, 72]] | 1 | 184 |
#define _LIBCPP_DEBUG 0
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const long long INF = 1LL << 60;
ll MOD = 1e9 + 7;
int main() {
string S, T;
cin >> S >> T;
int mini = 1002;
for (int i = 0; i < (S.size() - T.size()); ++i) {
int au = 0;
for (int j = 0; j < T.size(); ++j)... | #define _LIBCPP_DEBUG 0
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const long long INF = 1LL << 60;
ll MOD = 1e9 + 7;
int main() {
string S, T;
cin >> S >> T;
int mini = 1000;
for (int i = 0; i < (S.size() - T.size()) + 1; ++i) {
int au = 0;
for (int j = 0; j < T.size(); ... | [["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 148 |
/*==============================================*\
ID: shahidul_brur
Name: Md. Shahidul Islam
Study: CSE, BRUR
Address: Rangpur, Bangladesh
mail: shahidul.cse.brur@gmail.com
FB : fb.com/shahidul.brur
Blog: shahidul-brur.blogspot.com(in Bengali),
shahidul-brur-en.blogspot.com(in English)
... | /*==============================================*\
ID: shahidul_brur
Name: Md. Shahidul Islam
Study: CSE, BRUR
Address: Rangpur, Bangladesh
mail: shahidul.cse.brur@gmail.com
FB : fb.com/shahidul.brur
Blog: shahidul-brur.blogspot.com(in Bengali),
shahidul-brur-en.blogspot.com(in English)
... | [["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]] | 1 | 405 |
S = input()
T = input()
min_count = 1000
for idx in range(0, len(S) - len(T)):
s = S[idx:idx+len(T)]
count = sum([1 if tc!=sc else 0 for tc, sc in zip(T, s)])
min_count = min(min_count, count)
print(min_count) | S = input()
T = input()
min_count = 1000
for idx in range(len(S) - len(T) + 1):
s = S[idx:idx+len(T)]
count = sum([1 if tc!=sc else 0 for tc, sc in zip(T, s)])
min_count = min(min_count, count)
print(min_count) | [["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 81 |
#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e15;
#include <math.h>
#define PI 3.14159265358979323846264338327950L
const int mxN = 2e2;
int main() {
string s, t;
cin >> s >> t;
int mn = 10000000;
for (int i = 0; i < (int)s.length() && i + (int)t.length() ... | #include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e15;
#include <math.h>
#define PI 3.14159265358979323846264338327950L
const int mxN = 2e2;
int main() {
string s, t;
cin >> s >> t;
int mn = 10000000;
for (int i = 0;
i < (int)s.length() && i + (int)t.le... | [["+", 0, 7, 15, 16, 12, 16, 12, 16, 17, 72], ["+", 0, 7, 15, 16, 12, 16, 12, 16, 12, 13]] | 1 | 164 |
/*jai_ganeshdeva*/
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define pu push // adds the value to the last of the queue
#define lld long long int
#define ins insert /// used in set to insert the values
#define adv advance /// used to increment the iterator
#define mp make_pair
#define fi fir... | /*jai_ganeshdeva*/
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define pu push // adds the value to the last of the queue
#define lld long long int
#define ins insert /// used in set to insert the values
#define adv advance /// used to increment the iterator
#define mp make_pair
#define fi fir... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 8, 9, 0, 7, 15, 16, 12, 23, 0, 24], ["+", 8, 9, 0, 7, 15, 16, 12, 23, 0, 25]] | 1 | 510 |
package main
import (
"fmt"
)
func main() {
var s, t string
fmt.Scan(&s, &t)
var maxSubstrCount int
for i := 0; i < len(s)-len(t); i++ {
var substrCount int
for j := 0; j < len(t); j++ {
if s[i+j] == t[j] {
substrCount++
}
}
if substrCount > maxSubstrCount {
maxSubstrCount = substrCount
}... | package main
import (
"fmt"
)
func main() {
var s, t string
fmt.Scan(&s, &t)
var maxSubstrCount int
for i := 0; i < len(s)-len(t)+1; i++ {
var substrCount int
for j := 0; j < len(t); j++ {
if s[i+j] == t[j] {
substrCount++
}
}
if substrCount > maxSubstrCount {
maxSubstrCount = substrCount
... | [["+", 0, 7, 0, 430, 15, 16, 12, 16, 17, 72], ["+", 0, 7, 0, 430, 15, 16, 12, 16, 12, 433]] | 7 | 123 |
S = list(input())
T = list(input())
ans = 0
for i in range(len(S)-len(T)):
ans_pre = 0
for j in range(len(T)):
if T[j] == S[i+j]:
ans_pre += 1
ans = max(ans, ans_pre)
print(len(T) - ans) | S = list(input())
T = list(input())
ans = 0
for i in range(len(S)-len(T)+1):
ans_pre = 0
for j in range(len(T)):
if T[j] == S[i+j]:
ans_pre += 1
ans = max(ans, ans_pre)
print(len(T) - ans) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 82 |
import sys
stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))
def main():
s = ns()
t = ns()
ans = len(t)
for i in range(len(s) - len... | import sys
stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))
def main():
s = ns()
t = ns()
ans = len(t)
for i in range(len(s) - len... | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 177 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int n = s.size();
int m = t.size();
int ans = 1e9;
for (int i = 0; i < n - m; ++i) {
string tmp = s.substr(i, m);
int cnt = 0;
for (int j = 0; j < m; ++j) {
if (tmp[j] != t[j])
cnt++;
}
... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
cin >> s >> t;
int n = s.size();
int m = t.size();
int ans = 1e9;
for (int i = 0; i < n - m + 1; ++i) {
string tmp = s.substr(i, m);
int cnt = 0;
for (int j = 0; j < m; ++j) {
if (tmp[j] != t[j])
cnt++;
}... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 132 |
#include <iostream>
#include <string>
using namespace std;
int main() {
string s, t;
cin >> s;
cin >> t;
int min, count;
min = 1000000;
count = 0;
int c = (int)(s.length() - t.length());
for (int i = 0; i < c; i++) {
count = 0;
for (int j = 0; j < (int)(t.length()); j++) {
if (s[i + j] !=... | #include <iostream>
#include <string>
using namespace std;
int main() {
string s, t;
cin >> s;
cin >> t;
int min, count;
min = 1000000;
count = 0;
int c = (int)(s.length() - t.length()) + 1;
for (int i = 0; i < c; i++) {
count = 0;
for (int j = 0; j < (int)(t.length()); j++) {
if (s[i + j... | [["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 72], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13]] | 1 | 143 |
#include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
#define ll long long int
int main() {
string s, t;
cin >> s >> t;
ll count, ans = 1000;
ll len_s = (ll)(s.length());
ll len_t = (l... | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
#define ll long long int
int main() {
string s, t;
cin >> s >> t;
ll count, ans = 1000;
ll len_s = (ll)(s.length());
ll len_t = (l... | [["+", 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 | 137 |
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define clr(a) memset(a, 0, sizeof(a))
#define deb(x) cout << #x << "=" << x << endl
#define si(x) scanf("%d", &x)
#define sl(x) scanf("%lld", &x)
#define ss(s) scanf("%s", &s)
#define pi(x) printf("%d\n", x)
#define p... | #include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define clr(a) memset(a, 0, sizeof(a))
#define deb(x) cout << #x << "=" << x << endl
#define si(x) scanf("%d", &x)
#define sl(x) scanf("%lld", &x)
#define ss(s) scanf("%s", &s)
#define pi(x) printf("%d\n", x)
#define p... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 470 |
#include <bits/stdc++.h>
#define fi first
#define se second
#define ll long long
#define db double
#define pb push_back
#define wrln cout << '\n';
#define pii pair<int, int>
using namespace std;
const int H = 1e9;
const int N = 1e5 + 100;
string s, t;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout... | #include <bits/stdc++.h>
#define fi first
#define se second
#define ll long long
#define db double
#define pb push_back
#define wrln cout << '\n';
#define pii pair<int, int>
using namespace std;
const int H = 1e9;
const int N = 1e5 + 100;
string s, t;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 165 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define bit(n) (1 << (n))
using namespace std;
typedef long long ll;
typede... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define bit(n) (1 << (n))
using namespace std;
typedef long long ll;
typede... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 335 |
#include <bits/stdc++.h>
using namespace std;
#define FAST \
ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
#define MAXX 5... | #include <bits/stdc++.h>
using namespace std;
#define FAST \
ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
#define MAXX 5... | [["+", 51, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["+", 51, 16, 12, 69, 341, 342, 0, 16, 12, 22]] | 1 | 158 |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int n, m, ans = 987654321;
char a[1010], b[1010];
int main() {
scanf("%s%s", a, b);
n = strlen(a);
m = strlen(b);
for (int i = 0; i < n - m; i++) {
int tem = 0;
for (int j = 0; j < m; j++) {
if (a[i + j] != b[j]) {
tem++;
... | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int n, m, ans = 987654321;
char a[1010], b[1010];
int main() {
scanf("%s%s", a, b);
n = strlen(a);
m = strlen(b);
for (int i = 0; i <= n - m; i++) {
int tem = 0;
for (int j = 0; j < m; j++) {
if (a[i + j] != b[j]) {
tem++;
... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 136 |
def resolve():
s = input()
t = input()
ans = 10**18
for i in range(len(s) - len(t)):
a = 0
for j in range(len(t)):
if s[i + j] != t[j]:
a += 1
if ans > a:
ans = a
print(ans)
resolve() | def resolve():
s = input()
t = input()
ans = 10**18
for i in range(len(s) - len(t) + 1):
a = 0
for j in range(len(t)):
if s[i + j] != t[j]:
a += 1
if ans > a:
ans = a
print(ans)
resolve() | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 81 |
s,t=open(0).read().split()
res=1001
for i in range(len(s)-len(t)):
cnt=0
for j in range(len(t)):
if s[i+j]==t[j]:
cnt+=1
res=min(len(t)-cnt,res)
print(res) | s,t=open(0).read().split()
res=len(t)
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
res=min(len(t)-cnt,res)
print(res) | [["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 0, 656, 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], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 82 |
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using vb = vector<bool>;
using vvb = vector<vb>;
using pii = pair<int, int>;
using vpii = vector<pii>;
int main() {
string S, T;
cin >> S >> T;
int ans = 1000000;
for (int i = 0; i < S.length() - T.length(); i++) {
... | #include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using vb = vector<bool>;
using vvb = vector<vb>;
using pii = pair<int, int>;
using vpii = vector<pii>;
int main() {
string S, T;
cin >> S >> T;
int ans = 1000000;
for (int i = 0; i < S.length() - T.length() + 1; i++) ... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 166 |
#include <bits/stdc++.h>
using namespace std;
const int N = 1e9 + 7;
typedef long long ll;
int cmp(string a, string b) {
int cnt = 0;
for (int i = 0; i < a.size(); i++) {
if (a[i] == b[i])
cnt++;
}
return cnt;
}
int main() {
string s, t;
cin >> s >> t;
string s2;
int maxn = 0;
for (int i = 0... | #include <bits/stdc++.h>
using namespace std;
const int N = 1e9 + 7;
typedef long long ll;
int cmp(string a, string b) {
int cnt = 0;
for (int i = 0; i < a.size(); i++) {
if (a[i] == b[i])
cnt++;
}
return cnt;
}
int main() {
string s, t;
cin >> s >> t;
string s2;
int maxn = 0;
for (int i = 0... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["-", 0, 11, 12, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13]] | 1 | 167 |
s = input()
t = input()
times = len(s) - len(t)
ans = len(t)
if t in s:
ans = 0
else:
for i in range(times):
ans_tmp = 0
for j in range(len(t)):
if t[j] != s[i+j]:
ans_tmp += 1
if ans_tmp <= ans:
ans = ans_tmp
print(ans) | s = input()
t = input()
times = len(s) - len(t) + 1
ans = len(t)
if t in s:
ans = 0
else:
for i in range(times):
ans_tmp = 0
for j in range(len(t)):
if t[j] != s[i+j]:
ans_tmp += 1
if ans_tmp <= ans:
ans = ans_tmp
print(ans) | [["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 72], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612]] | 5 | 87 |
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define ll long long
#define mod 100000... | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define ll long long
#define mod 100000... | [["+", 0, 7, 15, 16, 12, 74, 51, 23, 0, 24], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 25], ["+", 15, 16, 12, 74, 51, 23, 0, 16, 17, 72], ["+", 15, 16, 12, 74, 51, 23, 0, 16, 12, 13]] | 1 | 254 |
S = input()
T = input()
if T in S:
print(0)
else:
matched = 0
for i in range(len(S)-len(T)):
matched_work = 0
for j in range(len(T)):
if T[j] == S[i+j]:
matched_work += 1
if matched_work > matched:
matched = matched_work
print(len(T)-match... | S = input()
T = input()
if T in S:
print(0)
else:
matched = 0
for i in range(len(S)-len(T)+1):
matched_work = 0
for j in range(len(T)):
if T[j] == S[i+j]:
matched_work += 1
if matched_work > matched:
matched = matched_work
print(len(T)-mat... | [["+", 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;
int main() {
string s, t;
int ans = 1e9;
cin >> s >> t;
for (int start = 0; start < s.size() - t.size(); ++start) {
int now = 0;
for (int j = 0; j < t.size(); ++j) {
if (t[j] != s[start + j])
++now;
}
ans = min(ans, now);
}
cout <<... | #include <bits/stdc++.h>
using namespace std;
int main() {
string s, t;
int ans = 1e9;
cin >> s >> t;
for (int start = 0; start <= s.size() - t.size(); ++start) {
int now = 0;
for (int j = 0; j < t.size(); ++j) {
if (t[j] != s[start + j])
++now;
}
ans = min(ans, now);
}
cout <... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 112 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string S, T;
cin >> S >> T;
int lens, lent;
int ans = 100000;
int tmp;
lens = S.size();
lent = T.size();
for (int i = 0; i < lens - lent; i++) {
tmp = 0;
for (int j = 0; j < lent; j++) {
if (S.at(i + j) != T.at(j)) {
tmp++... | #include <bits/stdc++.h>
using namespace std;
int main() {
string S, T;
cin >> S >> T;
int lens, lent;
int ans = 100000;
int tmp;
lens = S.size();
lent = T.size();
for (int i = 0; i < lens - lent + 1; i++) {
tmp = 0;
for (int j = 0; j < lent; j++) {
if (S.at(i + j) != T.at(j)) {
t... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 129 |
#include <algorithm>
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define all(obj) (obj).begin(), (obj).end()
using namespace std;
typedef long long ll;
long long GCD(long long x, long long y) { return y ? GCD(y, x % y) : x; }
int main() {
string S, T;
cin >> S >> T;
ll sl = S.length();
... | #include <algorithm>
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define all(obj) (obj).begin(), (obj).end()
using namespace std;
typedef long long ll;
long long GCD(long long x, long long y) { return y ? GCD(y, x % y) : x; }
int main() {
string S, T;
cin >> S >> T;
ll sl = S.length();
... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 171 |
#include <algorithm>
#include <cstddef>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <string>
#include <vector>
using namespace std;
int main() {
int ans = 10101, cnt = 0;
string s, t;
cin >> s >> t;
for (int i = 0; i < s.size() - t.size(); ++i) {
for (i... | #include <algorithm>
#include <cstddef>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <string>
#include <vector>
using namespace std;
int main() {
int ans = 10101, cnt = 0;
string s, t;
cin >> s >> t;
for (int i = 0; i < s.size() - t.size() + 1; ++i) {
fo... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 137 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define IN(type, n) \
type n; \
cin >> n
int main() {
IN(string,... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define IN(type, n) \
type n; \
cin >> n
int main() {
IN(string,... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 157 |
#include <bits/stdc++.h>
using namespace std;
#define all(n) begin(n), end(n)
const long long INF = numeric_limits<long long>::max();
typedef long long ll;
typedef vector<int> vint;
typedef vector<vector<int>> vvint;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef unsigned long long ull;
template <clas... | #include <bits/stdc++.h>
using namespace std;
#define all(n) begin(n), end(n)
const long long INF = numeric_limits<long long>::max();
typedef long long ll;
typedef vector<int> vint;
typedef vector<vector<int>> vvint;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef unsigned long long ull;
template <clas... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 418 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
#define s(x, n) memset(x, n, sizeof(x));
#define pb(x) push_back(x)
int main() {
#ifdef WIN32
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
#ifndef WIN32
ios_base::sync_with_stdio(0);
cin.t... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
#define s(x, n) memset(x, n, sizeof(x));
#define pb(x) push_back(x)
int main() {
#ifdef WIN32
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
#ifndef WIN32
ios_base::sync_with_stdio(0);
cin.t... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 193 |
#include <algorithm>
#include <climits>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
int main() {
string s, t;
cin >> s >> t... | #include <algorithm>
#include <climits>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
int main() {
string s, t;
cin >> s >> t... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 151 |
#include <bits/stdc++.h>
#pragma GCC optimize 03
#pragma GCC optimize("unroll-loops")
#define int long long
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
using namespace std;
const int N = 3e5 + 2e5;
const int inf = 2e9;
const int MOD = 998244353;
const int LogN = 30;
vo... | #include <bits/stdc++.h>
#pragma GCC optimize 03
#pragma GCC optimize("unroll-loops")
#define int long long
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
using namespace std;
const int N = 3e5 + 2e5;
const int inf = 2e9;
const int MOD = 998244353;
const int LogN = 30;
vo... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 202 |
import sys
readline = sys.stdin.readline
S = readline().strip()
T = readline().strip()
s = len(S)
t = len(T)
ans = t
for i in range(0, s-t):
n = t
for j in range(t):
if S[i+j] == T[j]:
n -= 1
if n < ans:
ans = n
if ans == 0:
break
print(ans)
| import sys
readline = sys.stdin.readline
S = readline().strip()
T = readline().strip()
s = len(S)
t = len(T)
ans = t
for i in range(0, s-t+1):
n = t
for j in range(t):
if S[i+j] == T[j]:
n -= 1
if n < ans:
ans = n
if ans == 0:
break
print(ans)
| [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 99 |
#pragma GCC optimize(2)
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
const int MAX = 1e4 + 7;
const int mod = 1e9 + 7;
const int inf = 0x3f3f3f3f;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
string s, t;
cin >> s >> t;
ll ans = inf, l1 = s.size(), l2 = t.siz... | #pragma GCC optimize(2)
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
const int MAX = 1e4 + 7;
const int mod = 1e9 + 7;
const int inf = 0x3f3f3f3f;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
string s, t;
cin >> s >> t;
ll ans = inf, l1 = s.size(), l2 = t.siz... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 162 |
/* |\ | | ||\ \ /(_~ |~)|_~|\/||_~|\/||~)|_~|~)
|~\|_|/\||~\ | ,_) |~\|__| ||__| ||_)|__|~\
\ //~\| | |\ |~)|_~ | ||\ ||/~\| ||_~
| \_/\_/ |~\|~\|__ \_/| \||\_X\_/|__
(J U S T L I K E E V E R Y O N E E L S ... | /* |\ | | ||\ \ /(_~ |~)|_~|\/||_~|\/||~)|_~|~)
|~\|_|/\||~\ | ,_) |~\|__| ||__| ||_)|__|~\
\ //~\| | |\ |~)|_~ | ||\ ||/~\| ||_~
| \_/\_/ |~\|~\|__ \_/| \||\_X\_/|__
(J U S T L I K E E V E R Y O N E E L S ... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 208 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
int main() {
string s, t;
cin >> s >> t;
int cnt = 0;
int maxmatch = 0;
rep(i, s.size() - t.size()) {
rep(j, t.size()) {
if (s.at(i + j) =... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
int main() {
string s, t;
cin >> s >> t;
int cnt = 0;
int maxmatch = 0;
rep(i, s.size() - t.size() + 1) {
rep(j, t.size()) {
if (s.at(i + ... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 132 |
#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 fio \
ios_base::sync_with_stdio(false); \
cin.... | #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 fio \
ios_base::sync_with_stdio(false); \
cin.... | [["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 1,254 |
#include <stdio.h>
int main(void) {
char s[2000], t[2000];
int i, ii, iii, l, ll, tmp, ans = 100000;
scanf("%s%s", s, t);
i = 0;
ii = 0;
while (s[i])
i++;
while (t[ii])
ii++;
l = i;
ll = ii;
ans = ll;
for (i = 0; i < l - ll; i++) {
tmp = 0;
for (ii = 0; ii < ll; ii++)
if (s[... | #include <stdio.h>
int main(void) {
char s[2000], t[2000];
int i, ii, iii, l, ll, tmp, ans = 100000;
scanf("%s%s", s, t);
i = 0;
ii = 0;
while (s[i])
i++;
while (t[ii])
ii++;
l = i;
ll = ii;
ans = ll;
for (i = 0; i <= l - ll; i++) {
tmp = 0;
for (ii = 0; ii < ll; ii++)
if (s... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 0 | 158 |
#include <algorithm>
#include <cfenv>
#include <climits>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string.h>
#include <string>
#include <tup... | #include <algorithm>
#include <cfenv>
#include <climits>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string.h>
#include <string>
#include <tup... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 2,624 |
#include <algorithm>
#include <climits>
#include <cmath>
#include <iostream>
#include <map>
#include <set>
#include <vector>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
#define MOD 1000000007LL
string s, t;
int main() {
int mlen = 0;
cin >> s >> t;
for (size_t i = 0; i... | #include <algorithm>
#include <climits>
#include <cmath>
#include <iostream>
#include <map>
#include <set>
#include <vector>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
#define MOD 1000000007LL
string s, t;
int main() {
int mlen = 0;
cin >> s >> t;
for (size_t i = 0; i... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 151 |
s = input()
t = input()
c = 0
for i in range(len(s)-len(t)):
cc = 0
for j in range(len(t)):
if t[j] == s[i+j]:
cc += 1
if cc >= c:
c = cc
cc = 0
print(len(t)-c) | s = input()
t = input()
c = 0
for i in range(len(s)-len(t)+1):
cc = 0
for j in range(len(t)):
if t[j] == s[i+j]:
cc += 1
if cc >= c:
c = cc
cc = 0
print(len(t)-c) | [["+", 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>
#define ll long long
#define vi vector<int>
#define vll vector<long long>
#define all(x) (x.begin(), x.end())
#define rep(i, a, b) for (int i = a; i < b; i++)
#define F first
#define S second
#define endl "\n"
#define FAST \
io... | #include <bits/stdc++.h>
#define ll long long
#define vi vector<int>
#define vll vector<long long>
#define all(x) (x.begin(), x.end())
#define rep(i, a, b) for (int i = a; i < b; i++)
#define F first
#define S second
#define endl "\n"
#define FAST \
io... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 196 |
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
#ifdef lOCAL_EXEC
#else
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#endif // lOCAL_EXEC
string s, t;
cin >> s >> t;
long long int i, j, x, ans = 0;
for (i = 0; i < s.size() - t.size(); i++) {
x = 0;
for (j = i; j ... | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
#ifdef lOCAL_EXEC
#else
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#endif // lOCAL_EXEC
string s, t;
cin >> s >> t;
long long int i, j, x, ans = 0;
for (i = 0; i < s.size() - t.size() + 1; i++) {
x = 0;
// cout<<i... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 148 |
def main():
S=list(input())
T=list(input())
res=len(T)
for i in range(len(S)-len(T)):
res_=0
for j in range(len(T)):
if T[j]!=S[j+i]:
res_+=1
if res_<=res:
res=res_
print(res)
if __name__=="__main__":
main() | def main():
S=list(input())
T=list(input())
res=len(T)
for i in range(len(S)-len(T)+1):
res_=0
for j in range(len(T)):
if T[j]!=S[j+i]:
res_+=1
if res_<=res:
res=res_
print(res)
if __name__=="__main__":
main() | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 95 |
#include <bits/stdc++.h>
using namespace std;
#define M 108
#define MAXX 999999999999999
#define PI 3.14159265358979323846
#define ep emplace_back
#define mk make_pair
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
typedef long long int lli;
typedef unsigned long long int ulli;
typedef... | #include <bits/stdc++.h>
using namespace std;
#define M 108
#define MAXX 999999999999999
#define PI 3.14159265358979323846
#define ep emplace_back
#define mk make_pair
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
typedef long long int lli;
typedef unsigned long long int ulli;
typedef... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 224 |
s=str(input())
t=str(input())
lens=len(s)
lent=len(t)
cnt=1000
for i in range(lens-lent):
temp=0
for j in range(lent):
if t[j]!=s[i+j]:
temp+=1
if temp<cnt:
cnt=temp
print(cnt) | s=str(input())
t=str(input())
lens=len(s)
lent=len(t)
cnt=1000
for i in range(lens-lent+1):
temp=0
for j in range(lent):
if t[j]!=s[i+j]:
temp+=1
if temp<cnt:
cnt=temp
print(cnt) | [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 80 |
S = input()
T = input()
L,l = len(S),len(T)
ans = 1000
for i in range(l,L):
s = S[i-l:i]
cnt = 0
for j in range(l):
if s[j] != T[j]:
cnt += 1
if ans > cnt:
ans = cnt
print(ans) | S = input()
T = input()
L,l = len(S),len(T)
ans = 1000
for i in range(l,L+1):
s = S[i-l:i]
cnt = 0
for j in range(l):
if s[j] != T[j]:
cnt += 1
if ans > cnt:
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 | 83 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.