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; template <typename T> bool chmax(T &u, const T z) { if (u < z) { u = z; return true; } else return false; } template <typename T> bool chmin(T &u, const T z) { if (u > z) { u = z; return true; } else return false; } #define rep(i, n) for (int...
#include <bits/stdc++.h> using namespace std; template <typename T> bool chmax(T &u, const T z) { if (u < z) { u = z; return true; } else return false; } template <typename T> bool chmin(T &u, const T z) { if (u > z) { u = z; return true; } else return false; } #define rep(i, n) for (int...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
184
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <forward_list> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <tuple> #include <utility> #include <vector> #define...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <forward_list> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <tuple> #include <utility> #include <vector> #define...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
190
def resolve(): s=input() t=input() ans=0 for i in range(len(s)-len(t)+1): ansh=0 for j in range(len(t)): if s[i+j]==t[j]: ansh+=1 ans=max(ansh,ans) print(len(t)-ansh) resolve()
def resolve(): s=input() t=input() ans=0 for i in range(len(s)-len(t)+1): ansh=0 for j in range(len(t)): if s[i+j]==t[j]: ansh+=1 ans=max(ansh,ans) print(len(t)-ans) resolve()
[["-", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
86
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { ll t = 1; // cin>>t; while (t--) { string s, t; cin >> s >> t; int l = 0, n = s.length(), ans = INT_MAX, m = t.length(), i, j, k, cnt = 0; for (i = 0; i < n - m; i++) { cnt = 0; l = 0; for (k = i; k <...
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { ll t = 1; // cin>>t; while (t--) { string s, t; cin >> s >> t; int l = 0, n = s.length(), ans = INT_MAX, m = t.length(), i, j, k, cnt = 0; for (i = 0; i <= n - m; i++) { cnt = 0; l = 0; for (k = i; k ...
[["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 8, 9, 0, 7, 15, 16, 31, 16, 31, 22], ["+", 8, 9, 0, 7, 15, 16, 31, 16, 17, 18], ["+", 8, 9, 0, 7, 15, 16, 31, 16, 12, 22], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 17, 98]]
1
149
#!/usr/bin/env python3 import sys def input(): return sys.stdin.readline().rstrip() def hantei(S,T): anss=0 for i in range(len(S)): if S[i]!=T[i]: anss+=1 return anss def main(): S=input() T=input() ans=10000 for i in range(len(S)-len(T)): ans=min(ans,hantei(T,S...
#!/usr/bin/env python3 import sys def input(): return sys.stdin.readline().rstrip() def hantei(S,T): anss=0 for i in range(len(S)): if S[i]!=T[i]: anss+=1 return anss def main(): S=input() T=input() ans=10000 for i in range(len(S)-len(T)+1): ans=min(ans,hantei(T...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
129
def main(): S = input() T = input() ans = 10**4 for i in range(len(S)-len(T)): count = 0 for j in range(len(T)): if S[i + j] != T[j]: count += 1 if ans > count : ans = count if ans == 10**4: print(len(T)) else: p...
def main(): S = input() T = input() ans = 10**4 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 if ans > count : ans = count if ans == 10**4: print(len(T)) else: ...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
104
#!/usr/bin/env python import os import sys from io import BytesIO, IOBase #from bisect import bisect_left as bl #c++ lowerbound bl(array,element) #from bisect import bisect_right as br #c++ upperbound br(array,element) def main(): s=input() t=input() n=len(s) m=len(t) ...
#!/usr/bin/env python import os import sys from io import BytesIO, IOBase #from bisect import bisect_left as bl #c++ lowerbound bl(array,element) #from bisect import bisect_right as br #c++ upperbound br(array,element) def main(): s=input() t=input() n=len(s) m=len(t) ...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
566
S = input() T = input() mx = 0 for i in range(len(S) - len(T)): t = 0 for j in range(len(T)): if i + j < len(S) and S[i + j] == T[j]: t += 1 mx = max(mx, t) print(len(T) - mx)
S = input() T = input() mx = 0 for i in range(len(S) - len(T) + 1): t = 0 for j in range(len(T)): if i + j < len(S) and S[i + j] == T[j]: t += 1 mx = max(mx, t) print(len(T) - mx)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
85
# coding: utf-8 S = list(input()) T = list(input()) ans=10000000 for i in range(len(S)-len(T)): tmp=0 for j in range(len(T)): if T[j]!=S[i+j]: tmp+=1 ans=min(ans,tmp) print(ans)
# coding: utf-8 S = list(input()) T = list(input()) ans=10000000 for i in range(len(S)-len(T)+1): tmp=0 for j in range(len(T)): if T[j]!=S[i+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
78
#include <bits/stdc++.h> using namespace std; #define EPS (1e-7) #define INF (1e9) #define PI (acos(-1)) #define deg_to_rad(deg) (((deg) / 360) * 2 * M_PI) #define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360) #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i < (int)(n); i++) typ...
#include <bits/stdc++.h> using namespace std; #define EPS (1e-7) #define INF (1e9) #define PI (acos(-1)) #define deg_to_rad(deg) (((deg) / 360) * 2 * M_PI) #define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360) #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i < (int)(n); i++) typ...
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72]]
1
160
#include <algorithm> #include <cfenv> #include <cmath> #include <complex> #include <cstdio> #include <deque> #include <iomanip> #include <ios> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <unordered_map...
#include <algorithm> #include <cfenv> #include <cmath> #include <complex> #include <cstdio> #include <deque> #include <iomanip> #include <ios> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <unordered_map...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
356
s = list(input()) t = list(input()) ln = len(s) lt = len(t) n = ls - lt + 1 l = [] cnt = 0 for i in range(n): for j in range(lt): if t[j] != s[i + j]: cnt += 1 l.append(cnt) cnt = 0 print(min(l))
s = list(input()) t = list(input()) ls = len(s) lt = len(t) n = ls - lt + 1 l = [] cnt = 0 for i in range(n): for j in range(lt): if t[j] != s[i + j]: cnt += 1 l.append(cnt) cnt = 0 print(min(l))
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22]]
5
90
#include <bits/stdc++.h> using namespace std; typedef long long ll; // THINK: INT vs LONG LONG? int main() { ios::sync_with_stdio(0); cin.tie(0); string s, t; cin >> s >> t; int T = t.size(); int ans = 1e9; for (int i = 0; i + T < (int)s.size(); ++i) { string cur = s.substr(i, T); int cnt = 0; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; // THINK: INT vs LONG LONG? int main() { ios::sync_with_stdio(0); cin.tie(0); string s, t; cin >> s >> t; int T = t.size(); int ans = 1e9; for (int i = 0; i + T <= (int)s.size(); ++i) { string cur = s.substr(i, T); int cnt = 0;...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
150
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> P; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) #define repto(i, n) for (int i = 0; i <= (n); i++) #define all(c) (c).begin(), (c).end() #define uniq(c) c.erase(unique(all(c)), (c).end()) #define _1 first #define _2 second #...
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> P; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) #define repto(i, n) for (int i = 0; i <= (n); i++) #define all(c) (c).begin(), (c).end() #define uniq(c) c.erase(unique(all(c)), (c).end()) #define _1 first #define _2 second #...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
212
#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 max = S.size() - T.size(); int ans = 1001; rep(i, S.size() - T.size()) { int cnt = 0; rep(j, T.size()) { ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using P = pair<int, int>; int main() { string S, T; cin >> S >> T; int ans = 1001; rep(i, S.size() - T.size() + 1) { int cnt = 0; rep(j, T.size()) { if (S.at(i + j) != T.at(j)) ...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
126
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <s...
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <s...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
338
s=input() t=input() mx_match=0 for i in range(len(s)-len(t)): mx_match=max(mx_match,sum(s[i+j]==t[j] for j in range(len(t)))) print(len(t)-mx_match)
s=input() t=input() mx_match=0 for i in range(len(s)-len(t)+1): mx_match=max(mx_match,sum(s[i+j]==t[j] for j in range(len(t)))) print(len(t)-mx_match)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
69
/* @uthor: Amit Kumar user -->GitHub: drviruses ; CodeChef: dr_virus_ ; Codeforces,AtCoder,Hackerearth,Hakerrank: dr_virus; */ #include <bits/stdc++.h> #include <chrono> using namespace std; using namespace std::chrono; //#include <boost/multiprecision/cpp_int.hpp> // namespace mp = boost::multiprecision; //...
/* @uthor: Amit Kumar user -->GitHub: drviruses ; CodeChef: dr_virus_ ; Codeforces,AtCoder,Hackerearth,Hakerrank: dr_virus; */ #include <bits/stdc++.h> #include <chrono> using namespace std; using namespace std::chrono; //#include <boost/multiprecision/cpp_int.hpp> // namespace mp = boost::multiprecision; //...
[["-", 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, 13]]
1
286
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #define ll long long #define N 100010 #define M 1010 using namespace std; char s1[M], s2[M]; map<char, int> ma; int read() { int s = 0, f = 0; char ch = getchar(); while (!isdigit(ch)) f |= (ch == '...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #define ll long long #define N 100010 #define M 1010 using namespace std; char s1[M], s2[M]; map<char, int> ma; int read() { int s = 0, f = 0; char ch = getchar(); while (!isdigit(ch)) f |= (ch == '...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
226
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int cnt_max = 0; for (int i = 0; i < s.size() - t.size(); i++) { int cnt = 0; for (int j = 0; j < t.size(); j++) { if (s.at(i + j) == t.at(j)) cnt++; } cnt_max = max(cnt, cnt_max); } cout...
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int cnt_max = 0; for (int i = 0; i < s.size() - t.size() + 1; i++) { int cnt = 0; for (int j = 0; j < t.size(); j++) { if (s.at(i + j) == t.at(j)) cnt++; } cnt_max = max(cnt, cnt_max); } ...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
124
#include <bits/stdc++.h> using namespace std; using i64 = long long; int main() { i64 ans = 1000; string s, t; cin >> s >> t; for (i64 i = 0; i < s.size() - t.size(); i++) { i64 a = 0; for (i64 j = 0; j < t.size(); j++) { if (s[i + j] != t[j]) { a++; } } ans = min(ans, a); ...
#include <bits/stdc++.h> using namespace std; using i64 = long long; int main() { i64 ans = 1000; string s, t; cin >> s >> t; for (i64 i = 0; i <= s.size() - t.size(); i++) { i64 a = 0; for (i64 j = 0; j < t.size(); j++) { if (s[i + j] != t[j]) { a++; } } ans = min(ans, a); ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
122
#include <bits/stdc++.h> using namespace std; #define ll long long #define fw(p) for (int w = 0; w < (p); w++) #define fx(p) for (int x = 0; x < (p); x++) #define fy(p) for (int y = 0; y < (p); y++) #define fz(p) for (int z = 0; z < (p); z++) #define fyg(p, g) for (int y = (g); y < (p); y++) #define fzg(p, g) for (int...
#include <bits/stdc++.h> using namespace std; #define ll long long #define fw(p) for (int w = 0; w < (p); w++) #define fx(p) for (int x = 0; x < (p); x++) #define fy(p) for (int y = 0; y < (p); y++) #define fz(p) for (int z = 0; z < (p); z++) #define fyg(p, g) for (int y = (g); y < (p); y++) #define fzg(p, g) for (int...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
266
import sys input = sys.stdin.readline S = input().strip() T = input().strip() N = len(S) M = len(T) ans = 10**10 for i in range(N-M): subS = S[i:i+M] temp = 0 for s,t in zip(subS, T): if s != t: temp += 1 ans = min(temp,ans) print(ans)
import sys input = sys.stdin.readline S = input().strip() T = input().strip() N = len(S) M = len(T) ans = 10**10 for i in range(N-M+1): subS = S[i:i+M] temp = 0 for s,t in zip(subS, T): if s != t: temp += 1 ans = min(temp,ans) 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> using namespace std; #define fastIO \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define int l...
#include <bits/stdc++.h> using namespace std; #define fastIO \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define int l...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
333
#include <algorithm> #include <iostream> #include <map> #include <numeric> #include <set> #include <string> #include <vector> using namespace std; typedef long long li; #define minimize(a, b) (a > (b) ? a = (b), 1 : 0) #define maximize(a, b) (a < (b) ? a = (b), 1 : 0) #define ceil(a, b) (((a) + (b)-1) / (b)) #define yn...
#include <algorithm> #include <iostream> #include <map> #include <numeric> #include <set> #include <string> #include <vector> using namespace std; typedef long long li; #define minimize(a, b) (a > (b) ? a = (b), 1 : 0) #define maximize(a, b) (a < (b) ? a = (b), 1 : 0) #define ceil(a, b) (((a) + (b)-1) / (b)) #define yn...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
584
#include <bits/stdc++.h> using namespace std; #define R (long long)(1e9 + 7) #define INF (long long)(1e16L + 5) #define ll long long #define grid vector<vector<ll>> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set ...
#include <bits/stdc++.h> using namespace std; #define R (long long)(1e9 + 7) #define INF (long long)(1e16L + 5) #define ll long long #define grid vector<vector<ll>> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set ...
[["-", 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
169
#include <bits/stdc++.h> using namespace std; int64_t MOD = 1000000007; double PI = 3.141592653589793; int main() { string S, T; cin >> S >> T; int ans = MOD; int SS = S.size(), TS = T.size(); for (int i = 0; i < SS - TS; i++) { int tmp = 0; for (int j = 0; j < TS; j++) { if (S[i + j] != T[j])...
#include <bits/stdc++.h> using namespace std; int64_t MOD = 1000000007; double PI = 3.141592653589793; int main() { string S, T; cin >> S >> T; int ans = MOD; int SS = S.size(), TS = T.size(); for (int i = 0; i <= SS - TS; i++) { int tmp = 0; for (int j = 0; j < TS; j++) { if (S[i + j] != T[j]...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
124
#include <bits/stdc++.h> using namespace std; #define intt long long #define FAST \ ios_base::sync_with_stdio(0); \ cin.tie(0); string s, t; int main() { FAST; cin >> s >> t; int n = s.length...
#include <bits/stdc++.h> using namespace std; #define intt long long #define FAST \ ios_base::sync_with_stdio(0); \ cin.tie(0); string s, t; int main() { FAST; cin >> s >> t; int n = s.length...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
140
// Problem : B - Substring // Contest : AtCoder - AtCoder Beginner Contest 177 // URL : https://atcoder.jp/contests/abc177/tasks/abc177_b // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) //#pragma GCC optimize "trapv"// WA to RE int!! #include <bits/std...
// Problem : B - Substring // Contest : AtCoder - AtCoder Beginner Contest 177 // URL : https://atcoder.jp/contests/abc177/tasks/abc177_b // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) //#pragma GCC optimize "trapv"// WA to RE int!! #include <bits/std...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
347
#include <bits/stdc++.h> using namespace std; using ll = long long; using Graph = vector<vector<int>>; using WGraph = vector<vector<pair<int, ll>>>; template <class T> inline bool chmax(T &a, const T &b) { if (b > a) { a = b; return true; } return false; } template <class T> inline bool chmin(T &a, cons...
#include <bits/stdc++.h> using namespace std; using ll = long long; using Graph = vector<vector<int>>; using WGraph = vector<vector<pair<int, ll>>>; template <class T> inline bool chmax(T &a, const T &b) { if (b > a) { a = b; return true; } return false; } template <class T> inline bool chmin(T &a, cons...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
332
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int ans = 100000; for (int i = 0; i < s.size() - t.size(); ++i) { int cnt = 0; for (int j = 0; j < t.size(); ++j) { if (s[i + j] != t[j]) ++cnt; } ans = min(ans, cnt); } cout << ans << endl;...
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int ans = 100000; for (int i = 0; i < s.size() - t.size() + 1; ++i) { int cnt = 0; for (int j = 0; j < t.size(); ++j) { if (s[i + j] != t[j]) ++cnt; } ans = min(ans, cnt); // DUMP(cnt); } ...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
111
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <iterator> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <vector> using namespace std; // bool cmp(long long a, long long b){ // ...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <iterator> #include <map> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <vector> using namespace std; // bool cmp(long long a, long long b){ // ...
[["+", 8, 9, 0, 7, 15, 16, 31, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 31, 16, 12, 13]]
1
288
#include <bits/stdc++.h> using namespace std; #define ff first #define ss second #define MP make_pair #define PB push_back #define ll long long #define int long long #define f(i, x, n) for (int i = x; i < n; i++) #define ld long double const int mod = 1000000007; const int INF = 1e18; int32_t main() { ios_base::sync...
#include <bits/stdc++.h> using namespace std; #define ff first #define ss second #define MP make_pair #define PB push_back #define ll long long #define int long long #define f(i, x, n) for (int i = x; i < n; i++) #define ld long double const int mod = 1000000007; const int INF = 1e18; int32_t main() { ios_base::sync...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
178
#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 DEBUG #ifdef DEBUG #define debug(...) __f(#__VA_ARGS__, __VA_ARGS__) template <typename Arg1> void __f(const char *name, Arg1 &&arg1) { cerr << name << " : " ...
#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 DEBUG #ifdef DEBUG #define debug(...) __f(#__VA_ARGS__, __VA_ARGS__) template <typename Arg1> void __f(const char *name, Arg1 &&arg1) { cerr << name << " : " ...
[["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]]
1
519
// Substring #include <bits/stdc++.h> using namespace std; using ll = long long; #define int long long #define rep(i, x, y) for (ll i = x; i < y; i++) #define nvarep(n, a) \ ll n; \ cin ...
// Substring #include <bits/stdc++.h> using namespace std; using ll = long long; #define int long long #define rep(i, x, y) for (ll i = x; i < y; i++) #define nvarep(n, a) \ ll n; \ cin ...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
211
#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define rep3(i, m, n) for (int(i) = m; (i) <= (n); (i)++) #define rep3rev(i, m, n) for (int(i) = m; (i) >= (n); (i)--) #define all(a) (a.begin()), (a.end()) #define rall(a) (a.rbegin()), (a.rend()) #define fi first #defi...
#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define rep3(i, m, n) for (int(i) = m; (i) <= (n); (i)++) #define rep3rev(i, m, n) for (int(i) = m; (i) >= (n); (i)--) #define all(a) (a.begin()), (a.end()) #define rall(a) (a.rbegin()), (a.rend()) #define fi first #defi...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
268
s = input() t = input() nt = len(t) def check(a,b): cnt = 0 for sa,sb in zip(a,b): if sa != sb: cnt += 1 return cnt ans = 1 << 50 for i in range(nt,len(s)): s_p = s[i-nt:i] # print(s_p,t) ans = min(check(s_p,t),ans) print(ans)
s = input() t = input() nt = len(t) def check(a,b): cnt = 0 for sa,sb in zip(a,b): if sa != sb: cnt += 1 return cnt ans = 1 << 50 for i in range(nt,len(s)+1): s_p = s[i-nt:i] # print(s_p,t) ans = min(check(s_p,t),ans) print(ans)
[["+", 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; using ll = long long; using ull = unsigned long long; using ld = long double; #define MOD 1000000007LL #define rep(i, n) for (ll(i) = 0LL; (i) < (ll)(n); (i)++) #define rep2(i, s, e) for (ll(i) = (ll)(s); (i) < (ll)(e); (i)++) #define repi(i, n) for (ll(i) = 0LL; (i) <= ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; #define MOD 1000000007LL #define rep(i, n) for (ll(i) = 0LL; (i) < (ll)(n); (i)++) #define rep2(i, s, e) for (ll(i) = (ll)(s); (i) < (ll)(e); (i)++) #define repi(i, n) for (ll(i) = 0LL; (i) <= ...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
493
using namespace std; #include <cstring> #include <iostream> int main() { string A, B; cin >> A >> B; int ans = 1000000; for (int i = 0; i < A.length() - B.length(); ++i) { int counter = 0; for (int j = 0; j < B.length(); ++j) { if (B[j] != A[i + j]) counter++; } ans = min(ans, co...
using namespace std; #include <cstring> #include <iostream> int main() { string A, B; cin >> A >> B; int ans = 1000000; for (int i = 0; i <= A.length() - B.length(); ++i) { int counter = 0; for (int j = 0; j < B.length(); ++j) { if (B[j] != A[i + j]) counter++; } ans = min(ans, c...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
113
def main(): from sys import setrecursionlimit, stdin, stderr from os import environ from collections import defaultdict, deque, Counter from math import ceil, floor from itertools import accumulate, combinations, combinations_with_replacement setrecursionlimit(10**6) dbg = (lambda *something...
def main(): from sys import setrecursionlimit, stdin, stderr from os import environ from collections import defaultdict, deque, Counter from math import ceil, floor from itertools import accumulate, combinations, combinations_with_replacement setrecursionlimit(10**6) dbg = (lambda *something...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
218
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define vi vector<int> #define vvi vector<vector<int>> #define pb push_back #define pii pair<ll, ll> #define tii tuple<ll, ll, ll> #define all(v) (v).begin(), (v).end() #define ll long long #define deb(x) cout << #x <...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define vi vector<int> #define vvi vector<vector<int>> #define pb push_back #define pii pair<ll, ll> #define tii tuple<ll, ll, ll> #define all(v) (v).begin(), (v).end() #define ll long long #define deb(x) cout << #x <...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
200
#include <bits/stdc++.h> typedef long long int lli; using namespace std; #pragma region DEBUG void __print(int x) { cerr << x; } void __print(long x) { cerr << x; } void __print(long long x) { cerr << x; } void __print(unsigned x) { cerr << x; } void __print(unsigned long x) { cerr << x; } void __print(unsigned long lo...
#include <bits/stdc++.h> typedef long long int lli; using namespace std; #pragma region DEBUG void __print(int x) { cerr << x; } void __print(long x) { cerr << x; } void __print(long long x) { cerr << x; } void __print(unsigned x) { cerr << x; } void __print(unsigned long x) { cerr << x; } void __print(unsigned long lo...
[["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 19]]
1
564
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; const int INF = 1e9; int main() { string s, t; cin >> s >> t; ll ans = INF; int sl = s.size(); int tl = t.size(); rep(i, sl - tl) { ll cnt = 0; rep(j, tl) if (s[i + j] != t[j]) cnt++...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; const int INF = 1e9; int main() { string s, t; cin >> s >> t; ll ans = INF; int sl = s.size(); int tl = t.size(); rep(i, sl - tl + 1) { ll cnt = 0; rep(j, tl) if (s[i + j] != t[j]) c...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
123
#include <bits/stdc++.h> using namespace std; string s, t; int ans = 100000; int main() { cin >> s >> t; for (int i = 0; i < s.size(); i++) if (i + t.size() < s.size()) { int x = 0, y = t.size(); for (int j = 0; j < t.size(); j++) if (s[i + j] == t[j]) x++; ans = min(ans, y -...
#include <bits/stdc++.h> using namespace std; string s, t; int ans = 100000; int main() { cin >> s >> t; for (int i = 0; i < s.size(); i++) if (i + t.size() <= s.size()) { int x = 0, y = t.size(); for (int j = 0; j < t.size(); j++) if (s[i + j] == t[j]) x++; ans = min(ans, y ...
[["-", 0, 7, 8, 57, 15, 339, 51, 16, 17, 18], ["+", 0, 7, 8, 57, 15, 339, 51, 16, 17, 19]]
1
132
#include <bits/stdc++.h> using namespace std; #define el '\n' #define pb push_back #define sp ' ' #define all(x) (x).begin(), (x).end() #define mset(x, y) memset(x, y, sizeof(x)) #define ff first #define ss second // clang-format off bool chmin(int& a, int b){ return b < a ? a = b, true : false; } bool chmax(int& a, ...
#include <bits/stdc++.h> using namespace std; #define el '\n' #define pb push_back #define sp ' ' #define all(x) (x).begin(), (x).end() #define mset(x, y) memset(x, y, sizeof(x)) #define ff first #define ss second // clang-format off bool chmin(int& a, int b){ return b < a ? a = b, true : false; } bool chmax(int& a, ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
1,104
#pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") //#pragma GCC //target("sse,sse2,sse3,ssse3,sse4,popcnt,fma,abm,mmx,avx,avx2,tune=native") #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 f...
#pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") //#pragma GCC //target("sse,sse2,sse3,ssse3,sse4,popcnt,fma,abm,mmx,avx,avx2,tune=native") #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 f...
[["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
1,152
#include <bits/stdc++.h> const int INF = 1e9; const int MOD = 1e9 + 7; const long long LINF = 1e18; #define dump(x) cout << 'x' << ' = ' << (x) << ` `; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) for (int i = 0; i < (n); ++i) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOREACH(x, ...
#include <bits/stdc++.h> const int INF = 1e9; const int MOD = 1e9 + 7; const long long LINF = 1e18; #define dump(x) cout << 'x' << ' = ' << (x) << ` `; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) for (int i = 0; i < (n); ++i) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOREACH(x, ...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
530
#include <bits/stdc++.h> using namespace std; #define ll long long #define inf 0x3f3f3f3f int main(void) { string s, t; cin >> s >> t; int n = s.length(), m = t.length(); int ans = inf; for (int i = 0; i < n - m; ++i) { int now = 0; for (int j = 0; j < m; ++j) now += s[i + j] == t[j] ? 0 : 1; ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define inf 0x3f3f3f3f int main(void) { string s, t; cin >> s >> t; int n = s.length(), m = t.length(); int ans = inf; for (int i = 0; i <= n - m; ++i) { int now = 0; for (int j = 0; j < m; ++j) now += s[i + j] == t[j] ? 0 : 1; ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
125
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ll long long ll gcd(int x, int y) { return (x % y) ? gcd(y, x % y) : y; } //最大公約数 ll lcm(ll x, ll y) { return x / gcd(x, y) * y; } //最小公倍数 using Graph = vector<vector<int>>; ll inf = 300000000000000000...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ll long long ll gcd(int x, int y) { return (x % y) ? gcd(y, x % y) : y; } //最大公約数 ll lcm(ll x, ll y) { return x / gcd(x, y) * y; } //最小公倍数 using Graph = vector<vector<int>>; ll inf = 300000000000000000...
[["-", 51, 16, 31, 69, 341, 342, 0, 16, 12, 13], ["+", 51, 16, 31, 69, 341, 342, 0, 16, 12, 22]]
1
191
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define pb push_back #define pf push_front #define all(t) t.begin(), t.end() #define inrange(i, a, b) (((i) >= min((a), (b))) && ((i) <= max((a), (b)))) typedef vector<ll> vi; typedef pair<ll, ll> pii; #define fi first #define se ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define pb push_back #define pf push_front #define all(t) t.begin(), t.end() #define inrange(i, a, b) (((i) >= min((a), (b))) && ((i) <= max((a), (b)))) typedef vector<ll> vi; typedef pair<ll, ll> pii; #define fi first #define se ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
531
#include <bits/stdc++.h> #define WHOLE(v) (v).begin(), (v).end() #define REV_WHOLE(v) (v).rbegin(), (v).rend() using i64 = int64_t; using namespace std; template <class F> auto recursive(F f) { return [f](auto... a) { return f(f, a...); }; } template <class T> using rev_priority_queue = priority_queue<T, vector<T>, g...
#include <bits/stdc++.h> #define WHOLE(v) (v).begin(), (v).end() #define REV_WHOLE(v) (v).rbegin(), (v).rend() using i64 = int64_t; using namespace std; template <class F> auto recursive(F f) { return [f](auto... a) { return f(f, a...); }; } template <class T> using rev_priority_queue = priority_queue<T, vector<T>, g...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
250
#pragma region kyopuro_templates #pragma GCC optimize("Ofast") #include <assert.h> #include <ctype.h> #include <math.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> typedef long long ll; typedef long double ld; #define rep(i, l, r) for (ll i = (l); i < (r); i++) #def...
#pragma region kyopuro_templates #pragma GCC optimize("Ofast") #include <assert.h> #include <ctype.h> #include <math.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> typedef long long ll; typedef long double ld; #define rep(i, l, r) for (ll i = (l); i < (r); i++) #def...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 31, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 31, 22]]
0
4,729
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; //#define ll long long template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return 1;...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; //#define ll long long template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return 1;...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
259
S = input() T = input() ans = 1<<60 for i in range(len(S)-len(T)): s_ = S[i:i+len(T)] a = 0 for s, t in zip(s_, T): a += s!=t if ans > a: ans = a print(ans)
S = input() T = input() ans = 1<<60 for i in range(len(S)-len(T)+1): s_ = S[i:i+len(T)] a = 0 for s, t in zip(s_, T): a += s!=t if ans > a: 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
76
#include <bits/stdc++.h> #define int long long #define fastio \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); using namespa...
#include <bits/stdc++.h> #define int long long #define fastio \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); using namespa...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
148
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; const int INF = 1001001001; const ll LINF = 1LL << 60; const int MOD = 1'000'000'007; template <typename T> void print(const T &v) { for (int i = 0; i < v.size(); i++) { if (i) cout << ' '; cout << v[i]; } ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; const int INF = 1001001001; const ll LINF = 1LL << 60; const int MOD = 1'000'000'007; template <typename T> void print(const T &v) { for (int i = 0; i < v.size(); i++) { if (i) cout << ' '; cout << v[i]; } ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
280
#pragma GCC optimize("O3") #include <bits/stdc++.h> #define ll long long #define rep(i, n) for (ll i = 0; i < (n); i++) #define pll pair<ll, ll> #define pii pair<int, int> #define pq priority_queue #define pb push_back #define eb emplace_back #define fi first #define se second #define endl '\n' #define ios ios_base::s...
#pragma GCC optimize("O3") #include <bits/stdc++.h> #define ll long long #define rep(i, n) for (ll i = 0; i < (n); i++) #define pll pair<ll, ll> #define pii pair<int, int> #define pq priority_queue #define pb push_back #define eb emplace_back #define fi first #define se second #define endl '\n' #define ios ios_base::s...
[["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]]
1
312
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <deque> // deque #include <iomanip> //setprecsion #include <iostream> // cout, endl, cin #include <map> // map #include <queue> // queue, priority_queue #include <set> // set #i...
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <deque> // deque #include <iomanip> //setprecsion #include <iostream> // cout, endl, cin #include <map> // map #include <queue> // queue, priority_queue #include <set> // set #i...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
426
s = input() t = input() ans = len(t) for i in range(len(s)-len(t)): same = 0 for g in range(len(t)): if s[i+g] == t[g]: same += 1 ans = min(len(t)-same, ans) print(ans)
s = input() t = input() ans = len(t) for i in range(len(s)-len(t)+1): same = 0 for g in range(len(t)): if s[i+g] == t[g]: same += 1 ans = min(len(t)-same, ans) 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 <algorithm> #include <cctype> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <regex> #include <set> #include <stack> #include <stdio.h> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) typedef int long long ll;...
#include <algorithm> #include <cctype> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <regex> #include <set> #include <stack> #include <stdio.h> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) typedef int long long ll;...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
288
#pragma GCC optimize("Ofast") #include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <complex> // complex #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include...
#pragma GCC optimize("Ofast") #include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <complex> // complex #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
352
/* #include <boost/multiprecision/cpp_dec_float.hpp> #include <boost/multiprecision/cpp_int.hpp> #include <boost/rational.hpp> */ #include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG #define rep(i, t) for (ll i = (ll)(0); i < (ll)(t); i++) #define rep2(i, s, t) for (ll i = (ll)(s); i < (ll)(t); i++) #d...
/* #include <boost/multiprecision/cpp_dec_float.hpp> #include <boost/multiprecision/cpp_int.hpp> #include <boost/rational.hpp> */ #include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG #define rep(i, t) for (ll i = (ll)(0); i < (ll)(t); i++) #define rep2(i, s, t) for (ll i = (ll)(s); i < (ll)(t); i++) #d...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
2,541
#include <bits/stdc++.h> using namespace std; #define int long long using vec_int = vector<int>; using P = pair<int, int>; using T = tuple<int, int, int>; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int charToInt(char c) { char zero_num = '0'; return (int)c - (int)zero_num; } signed...
#include <bits/stdc++.h> using namespace std; #define int long long using vec_int = vector<int>; using P = pair<int, int>; using T = tuple<int, int, int>; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int charToInt(char c) { char zero_num = '0'; return (int)c - (int)zero_num; } signed...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
200
#include <bits/stdc++.h> #define int long long using namespace std; signed main() { string a, b; cin >> a >> b; int maxv = 1000000000; for (int i = 0; i <= a.size() - b.size(); i++) { int sum = 0; for (int j = i; j < i + b.size(); j++) { if (a[j] != b[j]) { sum++; } } maxv = ...
#include <bits/stdc++.h> #define int long long using namespace std; signed main() { string a, b; cin >> a >> b; int maxv = 1000000000; for (int i = 0; i <= a.size() - b.size(); i++) { int sum = 0; for (int j = i; j < i + b.size(); j++) { if (a[j] != b[j - i]) { sum++; } } max...
[["+", 51, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["+", 51, 16, 12, 69, 341, 342, 0, 16, 12, 22]]
1
117
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define REP(i, n) for (int i = 0; i < (n); ++i) #define REPR(i, n) for (int i = n - 1; i >= 0; --i) #define FOR(i, m, n) for (int i = m; i < n; ++i) #define FORR(i, m, n) for (int i = m; i >= n; --i) #define ALL(v) (v).begin(), ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define REP(i, n) for (int i = 0; i < (n); ++i) #define REPR(i, n) for (int i = n - 1; i >= 0; --i) #define FOR(i, m, n) for (int i = m; i < n; ++i) #define FORR(i, m, n) for (int i = m; i >= n; --i) #define ALL(v) (v).begin(), ...
[["+", 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
322
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (n); i++) #define reps(i, s, n) for (int i = (s); i < (n); i++) #define rrep(i, n) for (int i = (n)-1; i >= 0; i--) #define rreps(i, s, n) for (int i = (n)-1; i >= (s); i--) #define INF ~(1 << 31) #define INFL ~(1L...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (n); i++) #define reps(i, s, n) for (int i = (s); i < (n); i++) #define rrep(i, n) for (int i = (n)-1; i >= 0; i--) #define rreps(i, s, n) for (int i = (n)-1; i >= (s); i--) #define INF ~(1 << 31) #define INFL ~(1L...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
150
#include <bits/stdc++.h> using namespace std; #define ull unsigned long long #define mp make_pair #define ll long long #define pb push_back void solve() { string s, t; cin >> s >> t; int i, j; int n = s.length(); int m = t.length(); int ans = m; for (i = 0; i < n - m; i++) { int count = 0; for (...
#include <bits/stdc++.h> using namespace std; #define ull unsigned long long #define mp make_pair #define ll long long #define pb push_back void solve() { string s, t; cin >> s >> t; int i, j; int n = s.length(); int m = t.length(); int ans = m; for (i = 0; i < n - m + 1; i++) { int count = 0; f...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
156
// Compiler optimization #pragma GCC optimize("Ofast") // include #include <bits/stdc++.h> using namespace std; // typedef typedef long long ll; typedef double db; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<string> vs; typedef vector<char> vc; typedef string S; typedef queue<int> qi; typedef pair<l...
// Compiler optimization #pragma GCC optimize("Ofast") // include #include <bits/stdc++.h> using namespace std; // typedef typedef long long ll; typedef double db; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<string> vs; typedef vector<char> vc; typedef string S; typedef queue<int> qi; typedef pair<l...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
408
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define For(i, n, k) for (int i = (n); i < (k); i++) #define ALL(a) (a).begin(), (a).end() int ans = 10000; void Main() { string s, t; cin >> s >> t; int n = s.size(), m = t.size(); For(i, 0, n - m) { int cnt = 0; For(j, 0, m) { cnt += ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define For(i, n, k) for (int i = (n); i < (k); i++) #define ALL(a) (a).begin(), (a).end() int ans = 10000; void Main() { string s, t; cin >> s >> t; int n = s.size(), m = t.size(); For(i, 0, n - m + 1) { int cnt = 0; For(j, 0, m) { cnt...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
140
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define pii pair<int, int> #define F first #define S second #define ll long long #define io \ ios_base::sync_with_stdio(0); \ cin.tie(0);...
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define pii pair<int, int> #define F first #define S second #define ll long long #define io \ ios_base::sync_with_stdio(0); \ cin.tie(0);...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
147
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using vll = vector<ll>; #define all(v) v.begin(), v.end() int main() { string S, T; cin >> S >> T; ll ans = 1e9; for (int i = 0; i < S.size() - T.size(); ++i) { ll tmp = 0; for (int ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using vll = vector<ll>; #define all(v) v.begin(), v.end() int main() { string S, T; cin >> S >> T; ll ans = 1e9; for (int i = 0; i < S.size() - T.size() + 1; ++i) { ll tmp = 0; for (...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
138
#include "bits/stdc++.h" #pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") // #pragma GCC optimization ("O3") // #pragma GCC optimization ("unroll-loops") // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> // using namespace __gnu_pbds; //#include <boost/multiprecision/cp...
#include "bits/stdc++.h" #pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") // #pragma GCC optimization ("O3") // #pragma GCC optimization ("unroll-loops") // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> // using namespace __gnu_pbds; //#include <boost/multiprecision/cp...
[["+", 0, 9, 0, 7, 15, 16, 31, 16, 17, 33], ["+", 0, 9, 0, 7, 15, 16, 31, 16, 12, 13]]
1
355
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int ans = 1000; for (int i = 0, l = s.size() - t.size(); i < l; i++) { int n = 0; for (int j = 0, k = t.size(); j < k; j++) if (t.at(j) != s.at(i + j)) n++; ans = min(ans, n); } cout << ans << e...
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int ans = 1000; for (int i = 0, l = s.size() - t.size() + 1; i < l; i++) { int n = 0; for (int j = 0, k = t.size(); j < k; j++) if (t.at(j) != s.at(i + j)) n++; ans = min(ans, n); } cout << ans ...
[["+", 0, 7, 10, 43, 49, 50, 51, 16, 17, 72], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13]]
1
124
#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 sz(x) x.size() #define printarray(arr) \ for (auto it = arr.begin(); it != arr.end(); ++it) ...
#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 sz(x) x.size() #define printarray(arr) \ for (auto it = arr.begin(); it != arr.end(); ++it) ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
425
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include ...
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include ...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
221
s = gets.chop t = gets.chop d = t.length (s.length - t.length).times do |idx| count = 0 s[idx, t.length].chars.each.with_index do |c, cidx| count += 1 if c != t[cidx] end d = [d, count].min end puts d
s = gets.chop t = gets.chop d = t.length (s.length - t.length + 1).times do |idx| count = 0 s[idx, t.length].chars.each.with_index do |c, cidx| count += 1 if c != t[cidx] end d = [d, count].min end puts d
[["+", 0, 493, 0, 652, 486, 739, 0, 738, 17, 72], ["+", 0, 493, 0, 652, 486, 739, 0, 738, 12, 612]]
4
76
// https://ei1333.github.io/luzhiled/ // http://beet-aizu.hatenablog.com/entry/2017/01/04/113233 // http://www.prefield.com/algorithm/ #include <bits/stdc++.h> constexpr char bn = '\n'; using namespace std; using ll = long long; using ld = long double; using vl = vector<ll>; using vd = vector<ld>; using vs = vector<str...
// https://ei1333.github.io/luzhiled/ // http://beet-aizu.hatenablog.com/entry/2017/01/04/113233 // http://www.prefield.com/algorithm/ #include <bits/stdc++.h> constexpr char bn = '\n'; using namespace std; using ll = long long; using ld = long double; using vl = vector<ll>; using vd = vector<ld>; using vs = vector<str...
[["+", 51, 16, 31, 69, 341, 342, 0, 16, 17, 72], ["+", 51, 16, 31, 69, 341, 342, 0, 16, 12, 22]]
1
922
S = input() T = input() s = len(S) t = len(T) ans = 10**10 for i in range(s-t-1): tmp = 0 for j in range(t): if S[i+j] != T[j]: tmp += 1 ans = min(tmp, ans) print(ans)
S = input() T = input() s = len(S) t = len(T) ans = 10**10 for i in range(s-t+1): tmp = 0 for j in range(t): if S[i+j] != T[j]: tmp += 1 ans = min(tmp, ans) print(ans)
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72]]
5
78
S = input() T = input() res = 0 for i in range(len(S)-len(T)): a = 0 for j in range(len(T)): a += S[i+j] == T[j] res = max(res,a) print(len(T)-res)
S = input() T = input() res = 0 for i in range(len(S)-len(T)+1): a = 0 for j in range(len(T)): a += S[i+j] == T[j] res = max(res,a) print(len(T)-res)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
73
/* Dont BLUNDER */ // #pragma GCC optimize("O3") // //#pragma comment(linker, "/stack:200000000") // #pragma GCC optimize("Ofast") // #pragma GCC optimization ("unroll-loops") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> using namespace std; /*#include <ext/p...
/* Dont BLUNDER */ // #pragma GCC optimize("O3") // //#pragma comment(linker, "/stack:200000000") // #pragma GCC optimize("Ofast") // #pragma GCC optimization ("unroll-loops") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> using namespace std; /*#include <ext/p...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
455
// Mayank Agarwal // IIIT Hyderabad #include <bits/stdc++.h> using namespace std; const long long int M = 1000000007; #define ll long long int #define ld double #define pb push_back #define mp make_pair ll power(ll x, ll y, ll p) { ll res = 1; x = x % p; while (y > 0) { if (y & 1) res = (res * x) % p...
// Mayank Agarwal // IIIT Hyderabad #include <bits/stdc++.h> using namespace std; const long long int M = 1000000007; #define ll long long int #define ld double #define pb push_back #define mp make_pair ll power(ll x, ll y, ll p) { ll res = 1; x = x % p; while (y > 0) { if (y & 1) res = (res * x) % p...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
347
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int minchange = t.length(); int begin = 0; while (begin + t.length() < s.length()) { int change = 0; for (int i = 0; i < t.length(); i++) { if (t[i] != s[begin + i]) change++; } minchange = min...
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int minchange = t.length() + 100; int begin = 0; while (begin + t.length() <= s.length()) { int change = 0; for (int i = 0; i < t.length(); i++) { if (t[i] != s[begin + i]) change++; } minchang...
[["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 72], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13], ["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 19]]
1
113
#include <bits/stdc++.h> using namespace std; #define IN(i, l, r) (l < i && i < r) #define LINR(i, l, r) (l <= i && i <= r) #define LIN(i, l, r) (l <= i && i < r) #define INR(i, l, r) (l < i && i <= r) #define F(i, L, R) for (int i = L; i < R; i++) #define FE(i, L, R) for (int i = L; i <= R; i++) #define FFE(i, L, R)...
#include <bits/stdc++.h> using namespace std; #define IN(i, l, r) (l < i && i < r) #define LINR(i, l, r) (l <= i && i <= r) #define LIN(i, l, r) (l <= i && i < r) #define INR(i, l, r) (l < i && i <= r) #define F(i, L, R) for (int i = L; i < R; i++) #define FE(i, L, R) for (int i = L; i <= R; i++) #define FFE(i, L, R)...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
324
S = input() T = input() ret = float('inf') for i in range(len(S) - len(T)) : c = 0 for j in range(len(T)) : if S[i + j] != T[j] : c += 1 ret = min(ret, c) print(ret)
S = input() T = input() ret = float('inf') for i in range(len(S) - len(T) + 1) : c = 0 for j in range(len(T)) : if S[i + j] != T[j] : c += 1 ret = min(ret, c) print(ret)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
76
#include <bits/stdc++.h> using namespace std; #define ll long long #define F first #define S second #define ii pair<int, int> #define ever (;;) string s1, s2; int n2, n1, ans = 1e9; int main() { cin >> s1 >> s2; n1 = s1.length(); n2 = s2.length(); for (int i = 0; i < n1; i++) { bool q = 1; int x = 0...
#include <bits/stdc++.h> using namespace std; #define ll long long #define F first #define S second #define ii pair<int, int> #define ever (;;) string s1, s2; int n2, n1, ans = 1e9; int main() { cin >> s1 >> s2; n1 = s1.length(); n2 = s2.length(); for (int i = 0; i < n1; i++) { bool q = 1; int x = 0...
[["-", 0, 7, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 17, 19]]
1
187
import sys, re from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement from operator import itemgetter, mul from copy import deepcopy from s...
import sys, re from collections import deque, defaultdict, Counter from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement from operator import itemgetter, mul from copy import deepcopy from s...
[["+", 12, 652, 3, 4, 0, 657, 31, 657, 17, 33], ["+", 12, 652, 3, 4, 0, 657, 31, 657, 12, 22], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
268
s = list(input()) t = list(input()) n = len(s) k = len(t) ans = float("Inf") for i in range(n-k): p = 0 for j in range(k): if s[i+j] != t[j]: p += 1 ans = min(ans, p) print(ans)
s = list(input()) t = list(input()) n = len(s) k = len(t) ans = float("Inf") for i in range(n-k+1): p = 0 for j in range(k): if s[i+j] != t[j]: p += 1 ans = min(ans, p) print(ans)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
85
import sys read = sys.stdin.read readline = sys.stdin.buffer.readline sys.setrecursionlimit(10 ** 8) INF = float('inf') MOD = 10 ** 9 + 7 def main(): S = input() T = input() LS = len(S) LT = len(T) ans = 0 for i in range(LS-LT): tmp = 0 for s, t in zip(S[i:i+LT],T): ...
import sys read = sys.stdin.read readline = sys.stdin.buffer.readline sys.setrecursionlimit(10 ** 8) INF = float('inf') MOD = 10 ** 9 + 7 def main(): S = input() T = input() LS = len(S) LT = len(T) ans = 0 for i in range(LS-LT+1): tmp = 0 for s, t in zip(S[i:i+LT],T): ...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
135
import time startTimeProblem=time.time() import fileinput, sys, itertools, functools from math import * from bisect import * from heapq import * from collections import * def lcm(a, b): return (a*b)/gcd(a, b) class InputHelper: def __init__(self): self.myinput = fileinput.input() def isLocal(s...
import time startTimeProblem=time.time() import fileinput, sys, itertools, functools from math import * from bisect import * from heapq import * from collections import * def lcm(a, b): return (a*b)/gcd(a, b) class InputHelper: def __init__(self): self.myinput = fileinput.input() def isLocal(s...
[["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 72], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
464
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e3 + 5, M = 2e4 + 5, inf = 0x3f3f3f3f, mod = 1e9 + 7; #define mst(a, b) memset(a, b, sizeof a) #define lx x << 1 #define rx x << 1 | 1 #define reg register #define PII pair<int, int> #define fi first #define se second #define pb push_bac...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e3 + 5, M = 2e4 + 5, inf = 0x3f3f3f3f, mod = 1e9 + 7; #define mst(a, b) memset(a, b, sizeof a) #define lx x << 1 #define rx x << 1 | 1 #define reg register #define PII pair<int, int> #define fi first #define se second #define pb push_bac...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
182
import sys import itertools tokens = itertools.chain.from_iterable(map(str.split, sys.stdin)) s = next(tokens) t = next(tokens) mn = 999999 for i in range(len(s) - len(t)): ss = s[i:i+len(t)] sm = sum(1 if a != b else 0 for a, b in zip(ss, t)) #print(ss, t, sm) mn = min(mn, sm) print(mn)
import sys import itertools tokens = itertools.chain.from_iterable(map(str.split, sys.stdin)) s = next(tokens) t = next(tokens) mn = 999999 for i in range(len(s) - len(t) + 1): ss = s[i:i+len(t)] sm = sum(1 if a != b else 0 for a, b in zip(ss, t)) #print(ss, t, sm) mn = min(mn, sm) print(mn)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
103
#define INF 10000000000 #define MOD 1000000007 #if 1 // use_templates #define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #includ...
#define INF 10000000000 #define MOD 1000000007 #if 1 // use_templates #define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #includ...
[["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22]]
1
329
from collections import Counter,defaultdict,deque from heapq import heappop,heappush from bisect import bisect_left,bisect_right import sys,math,itertools,fractions,pprint sys.setrecursionlimit(10**8) mod = 10**9+7 INF = float('inf') def inp(): return int(sys.stdin.readline()) def inpl(): return list(map(int, sys.stdi...
from collections import Counter,defaultdict,deque from heapq import heappop,heappush from bisect import bisect_left,bisect_right import sys,math,itertools,fractions,pprint sys.setrecursionlimit(10**8) mod = 10**9+7 INF = float('inf') def inp(): return int(sys.stdin.readline()) def inpl(): return list(map(int, sys.stdi...
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]]
5
180
# import sys # input = sys.stdin.readline def mp(): return map(int, input().split()) def lmp(): return list(map(int, input().split())) s = input() t = input() ans = 100000 for i in range(len(s)-len(t)): u = s[i:i+len(t)] cnt = 0 for j in range(len(t)): if u[j] != t[j]: cnt += 1 ans...
# import sys # input = sys.stdin.readline def mp(): return map(int, input().split()) def lmp(): return list(map(int, input().split())) s = input() t = input() ans = 100000 for i in range(len(s)-len(t)+1): u = s[i:i+len(t)] cnt = 0 for j in range(len(t)): if u[j] != t[j]: cnt += 1 a...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
123
#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; typedef long long int ll; typedef long double ld; #define llset \ tree<ll, null_type, less<ll>, rb...
#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; typedef long long int ll; typedef long double ld; #define llset \ tree<ll, null_type, less<ll>, rb...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
433
package main import ( "bufio" "fmt" "math" "os" "sort" "strconv" ) var sc = bufio.NewScanner(os.Stdin) var out = bufio.NewWriter(os.Stdout) func main() { /*/TODO:!!!!!!!テスト用!!!!!!!!! sc = bufio.NewScanner(strings.NewReader(` `)) //TODO:!!!!!!!テスト用!!!!!!!!!*/ buf := make([]byte, 1024*1024) sc.Bu...
package main import ( "bufio" "fmt" "math" "os" "sort" "strconv" ) var sc = bufio.NewScanner(os.Stdin) var out = bufio.NewWriter(os.Stdout) func main() { /*/TODO:!!!!!!!テスト用!!!!!!!!! sc = bufio.NewScanner(strings.NewReader(` `)) //TODO:!!!!!!!テスト用!!!!!!!!!*/ buf := make([]byte, 1024*1024) sc.Bu...
[["+", 0, 7, 0, 430, 15, 16, 12, 16, 17, 72], ["+", 0, 7, 0, 430, 15, 16, 12, 16, 12, 433]]
7
916
#include <bits/stdc++.h> #define llint long long int using namespace std; int main() { string S, T; cin >> S >> T; int min = T.length(); for (int i = 0; i < S.length() - T.length(); i++) { int count = 0; for (int j = 0; j < T.length(); j++) { if (S[i + j] != T[j]) { count++; }...
#include <bits/stdc++.h> #define llint long long int using namespace std; int main() { string S, T; cin >> S >> T; int min = T.length(); for (int i = 0; i < S.length() - T.length() + 1; i++) { int count = 0; for (int j = 0; j < T.length(); j++) { if (S[i + j] != T[j]) { count++; ...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
123
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define repp(i, n, m) for (int(i) = (n); (i) < (m); (i)++) #define repn(i, n) for (int(i) = 1; (i) <= (n); (i)++) #define repr(i, n) for (int(i) = (n - 1); (i) >= 0; (i)--) #define all(x) (x).begin(), (x).end() #define l...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define repp(i, n, m) for (int(i) = (n); (i) < (m); (i)++) #define repn(i, n) for (int(i) = 1; (i) <= (n); (i)++) #define repr(i, n) for (int(i) = (n - 1); (i) >= 0; (i)--) #define all(x) (x).begin(), (x).end() #define l...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
339
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int n(s.length()), m(t.length()); // cout << n << m << endl; int ans(m); for (int i = 0; i < n - m; ++i) { int a(0); for (int j = 0; j < m; ++j) { if (s[i + j] != t[j]) a++; } ans = min(ans,...
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int n(s.length()), m(t.length()); // cout << n << m << endl; int ans(m); for (int i = 0; i <= n - m; ++i) { int a(0); for (int j = 0; j < m; ++j) { if (s[i + j] != t[j]) a++; } ans = min(ans...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
125
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() #define ll long long #define rep(i, n) for (int i = 0; i < int(n); i++) #define vi vector<int> using namespace std; const int INF = 1001001001; const int MOD = 1e9 + 7; const int dx[] = {-1, 0, 1, 0}; const int dy[] = {0, 1, 0, -1}; template <class T> inlin...
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() #define ll long long #define rep(i, n) for (int i = 0; i < int(n); i++) #define vi vector<int> using namespace std; const int INF = 1001001001; const int MOD = 1e9 + 7; const int dx[] = {-1, 0, 1, 0}; const int dy[] = {0, 1, 0, -1}; template <class T> inlin...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
258