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
// Vivek Rai // Blazer_007 #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC target("sse2") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/detail/standard_policies.hpp> #include <ext/pb_ds/tree_policy.hpp> #define fastio ...
// Vivek Rai // Blazer_007 #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC target("sse2") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/detail/standard_policies.hpp> #include <ext/pb_ds/tree_policy.hpp> #define fastio ...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
541
// 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/coder3101/cp-editor) // $%U%$ // Mere bas ka nahi hai // still i'm trying // apna time...
// 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/coder3101/cp-editor) // $%U%$ // Mere bas ka nahi hai // still i'm trying // apna time...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
370
#include <bits/stdc++.h> using namespace std; // int main() { string S, T; cin >> S >> T; int maxMat = 0; for (int i = 0; i < S.size() - T.size(); i++) { int match = 0; for (int j = 0; j < T.size(); j++) { if (S[i + j] == T[j]) { match++; } } maxMat = max(match, maxMat); ...
#include <bits/stdc++.h> using namespace std; // int main() { string S, T; cin >> S >> T; int maxMat = 0; for (int i = 0; i <= S.size() - T.size(); i++) { int match = 0; for (int j = 0; j < T.size(); j++) { if (S[i + j] == T[j]) { match++; } } maxMat = max(match, maxMat); ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
118
#include <algorithm> #include <cstdio> #include <iostream> #include <vector> using namespace std; int main(void) { string S, T; cin >> S >> T; int ans = S.length(); for (int i = 0; i < S.length() - T.length(); i++) { int cnt = 0; for (int j = 0; j < T.length(); j++) { if (S[i + j] != T[j]) ...
#include <algorithm> #include <cstdio> #include <iostream> #include <vector> using namespace std; int main(void) { string S, T; cin >> S >> T; int ans = S.length(); for (int i = 0; i < S.length() - T.length() + 1; i++) { int cnt = 0; for (int j = 0; j < T.length(); j++) { if (S[i + j] != T[j]) ...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
129
#include <bits/stdc++.h> using namespace std; const int N = 100010; int main() { string a, b; cin >> a >> b; int res = b.size(); int lena = a.size(), lenb = b.size(); for (int i = 0; i < lena; ++i) { int t = 0; for (int j = 0; j < lenb; ++j) { if (a[i + j] != b[j]) ++t; } res ...
#include <bits/stdc++.h> using namespace std; const int N = 100010; int main() { string a, b; cin >> a >> b; int res = b.size(); int lena = a.size(), lenb = b.size(); for (int i = 0; i + lenb - 1 < lena; ++i) { int t = 0; for (int j = 0; j < lenb; ++j) { if (a[i + j] != b[j]) ++t; ...
[["+", 0, 7, 15, 16, 31, 16, 31, 16, 17, 72], ["+", 0, 7, 15, 16, 31, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 7, 15, 16, 31, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 31, 16, 12, 13]]
1
129
// Mon Aug 24 16:24:09 IST 2020 #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define forn(ii, a, b) for (int ii = (int)a; ii < (int)b; ii++) #define scan(any) \ for (auto &i : any) ...
// Mon Aug 24 16:24:09 IST 2020 #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define forn(ii, a, b) for (int ii = (int)a; ii < (int)b; ii++) #define scan(any) \ for (auto &i : any) ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
337
#!/usr/bin/python3 # -*- coding: utf-8 -*- s = input() t = input() min_count = 1000 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) if min_count == 0: break print(min_count)
#!/usr/bin/python3 # -*- coding: utf-8 -*- s = input() t = input() min_count = 1000 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) if min_count == 0: break print(min_count)
[["+", 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 <atomic> #include <bitset> #include <chrono> #include <condition_variable> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <list> #include <map> #include <math.h> #include <me...
#include <algorithm> #include <atomic> #include <bitset> #include <chrono> #include <condition_variable> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <list> #include <map> #include <math.h> #include <me...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
475
import sys input = sys.stdin.readline def main(): S = input().rstrip() T = input().rstrip() ans = 0 for i in range(len(S)-len(T)): CNT = 0 for j in range(len(T)): if S[i+j] == T[j]: CNT += 1 ans = max(ans, CNT) print(len(T) - ans) if __name__ == '...
import sys input = sys.stdin.readline def main(): S = input().rstrip() T = input().rstrip() ans = 0 for i in range(len(S)-len(T)+1): CNT = 0 for j in range(len(T)): if S[i+j] == T[j]: CNT += 1 ans = max(ans, CNT) print(len(T) - ans) if __name__ ==...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
108
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(0); string s, t; cin >> s >> t; int n = (int)s.size(); int k = (int)t.size(); int ans = 10000; rep(i, n - k) { string ss = s.subst...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(0); string s, t; cin >> s >> t; int n = (int)s.size(); int k = (int)t.size(); int ans = 10000; rep(i, n - k + 1) { string ss = s.s...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
147
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define PI 3.14159265358979323846 #define int long long constexpr long long INF = numeric_limits<long long>::max() / 2; constexpr int MOD = 1000000007; using Graph = vector<vector<int>>; signed main() { cin.tie(nullptr...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define PI 3.14159265358979323846 #define int long long constexpr long long INF = numeric_limits<long long>::max() / 2; constexpr int MOD = 1000000007; using Graph = vector<vector<int>>; signed main() { cin.tie(nullptr...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
159
s = input() t = input() ans = 10000 if t in s: print(0) exit() for i in range(len(s)-len(t)): cut = s[i:i+len(t)] cnt = 0 for k, j in zip(cut, t): if k != j: cnt += 1 ans = min(ans, cnt) print(ans)
s = input() t = input() ans = 10000 if t in s: print(0) exit() for i in range(len(s)-len(t)+1): cut = s[i:i+len(t)] cnt = 0 for k, j in zip(cut, t): if k != 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
89
#include <algorithm> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; using ll = long long; int main() { string S, T; cin >> S; cin >> T; int outp...
#include <algorithm> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; using ll = long long; int main() { string S, T; cin >> S; cin >> T; int outp...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
151
# -*- coding: utf-8 -*- S=input() T=input() ls=len(S) lt=len(T) ans=lt for i in range(ls-lt): ss=S[i:i+lt] c=0 for j in range(lt): if ss[j]!=T[j]: c+=1 if c<ans: ans=c print(ans)
# -*- coding: utf-8 -*- S=input() T=input() ls=len(S) lt=len(T) ans=lt for i in range(ls-lt+1): ss=S[i:i+lt] c=0 for j in range(lt): if ss[j]!=T[j]: c+=1 if c<ans: 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
83
import sys readline = sys.stdin.buffer.readline def even(n): return 1 if n%2==0 else 0 s = readline().rstrip().decode('utf-8') t = readline().rstrip().decode('utf-8') ls = len(s) lt = len(t) ans = 10**18 for i in range(ls-lt): res = 0 for j in range(lt): if s[i+j] != t[j]: res += 1 ans ...
import sys readline = sys.stdin.buffer.readline def even(n): return 1 if n%2==0 else 0 s = readline().rstrip().decode('utf-8') t = readline().rstrip().decode('utf-8') ls = len(s) lt = len(t) ans = 10**18 for i in range(ls-lt+1): res = 0 for j in range(lt): if s[i+j] != t[j]: res += 1 an...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
125
S = input() T = input() for i in range(len(S)-len(T)+1): ans = 10000 count = 0 for elts, eltt in zip(S[i:i+len(T)], T): if elts != eltt: count += 1 ans = min(ans, count) print(ans)
S = input() T = input() ans = 10000 for i in range(len(S)-len(T)+1): count = 0 for elts, eltt in zip(S[i:i+len(T)], T): if elts != eltt: count += 1 ans = min(ans, count) print(ans)
[["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["-", 0, 7, 8, 196, 0, 1, 0, 662, 31, 22], ["-", 0, 7, 8, 196, 0, 1, 0, 662, 0, 32], ["-", 0, 7, 8, 196, 0, 1, 0, 662, 12, 612]]
5
76
#include <bits/stdc++.h> #include <iostream> #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) #define ll long long #define li long ll #define pp pair<ll, ll> #define lb lower_bound #define ub...
#include <bits/stdc++.h> #include <iostream> #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) #define ll long long #define li long ll #define pp pair<ll, ll> #define lb lower_bound #define ub...
[["-", 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], ["+", 51, 16, 31, 69, 341, 342, 0, 16, 17, 72], ["+", 51, 16, 31, 69, 341, 342, 0, 16, 12, 22]]
1
168
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define loop(i, a, n) for (int i = (a); i < (n); i++) using namespace std; using ll = int64_t; int main() { string s, t; cin >> s >> t; int ss = s.size(), ts = t.size(); int ans = 10000, tmp = 0; rep(i, ss - ts) { tmp = 0; rep(...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define loop(i, a, n) for (int i = (a); i < (n); i++) using namespace std; using ll = int64_t; int main() { string s, t; cin >> s >> t; int ss = s.size(), ts = t.size(); int ans = 10000, tmp = 0; rep(i, ss - ts + 1) { tmp = 0; ...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
131
S = input() T = input() s = len(S) t = len(T) ans = 0 for i in range(s - t + 1): c = 0 for j in range(t): if S[i + j] == T[j]: c += 1 ans = max(ans, c) print(t - c)
S = input() T = input() s = len(S) t = len(T) ans = 0 for i in range(s - t + 1): c = 0 for j in range(t): if S[i + j] == T[j]: c += 1 ans = max(ans, c) print(t - ans)
[["-", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
78
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <climits> #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <functional> #incl...
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <climits> #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <functional> #incl...
[["-", 8, 9, 0, 9, 0, 1, 0, 16, 31, 22], ["-", 8, 9, 0, 9, 0, 1, 0, 16, 17, 151], ["-", 8, 9, 0, 9, 0, 1, 0, 16, 12, 22], ["-", 0, 14, 8, 9, 0, 9, 0, 1, 0, 35]]
1
278
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { string s, t; cin >> s >> t; int ls = s.length(), lt = t.length(), m = 0; for (int i = 0; i + lt < ls; i++) { int maxn = 0; for (int j = 0; j < lt; j++) { if (s[i + j] == t[j]) maxn++; } m = max(m, max...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { string s, t; cin >> s >> t; int ls = s.length(), lt = t.length(), m = 0; for (int i = 0; i + lt <= ls; i++) { int maxn = 0; for (int j = 0; j < lt; j++) { if (s[i + j] == t[j]) maxn++; } m = max(m, ma...
[["-", 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> #include <iostream> #include <iterator> #include <map> #include <math.h> #include <set> #include <string> #include <vector> #define ll long long int #define ull unsigned long long int #define pb push_back #define dd double #define mp make_pair #include <algorithm> #include <cmath> using namespa...
#include <bits/stdc++.h> #include <iostream> #include <iterator> #include <map> #include <math.h> #include <set> #include <string> #include <vector> #define ll long long int #define ull unsigned long long int #define pb push_back #define dd double #define mp make_pair #include <algorithm> #include <cmath> using namespa...
[["-", 0, 14, 8, 9, 0, 7, 26, 11, 17, 107], ["-", 0, 7, 26, 11, 12, 2, 63, 118, 28, 22], ["-", 0, 7, 26, 11, 12, 2, 63, 118, 17, 131], ["-", 0, 7, 26, 11, 12, 2, 63, 118, 119, 120], ["-", 0, 7, 26, 11, 12, 2, 3, 4, 0, 24], ["-", 0, 7, 26, 11, 12, 2, 3, 4, 0, 25], ["+", 0, 14, 8, 9, 0, 7, 26, 27, 17, 29]]
1
165
#include <iostream> #include <string> using namespace std; int main() { string s, t; int s_l, t_l; int ans = 10000; cin >> s >> t; s_l = s.length(); t_l = t.length(); for (int i = 0; i < s_l - t_l; i++) { int diff = 0; for (int j = 0; j < t_l; j++) { if (s[i + j] != t[j]) { dif...
#include <iostream> #include <string> using namespace std; int main() { string s, t; int s_l, t_l; int ans = 10000; cin >> s >> t; s_l = s.length(); t_l = t.length(); for (int i = 0; i <= s_l - t_l; i++) { int diff = 0; for (int j = 0; j < t_l; j++) { if (s[i + j] != t[j]) { di...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
130
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> using namespace std; typedef long long ll; int main() { ios::sync_with_stdio(false); cin.tie(0); cout << setprecision(10) << fixed; string s, t; cin >> s >> t; int ans = 10000; fo...
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> using namespace std; typedef long long ll; int main() { ios::sync_with_stdio(false); cin.tie(0); cout << setprecision(10) << fixed; string s, t; cin >> s >> t; int ans = 10000; fo...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
151
s=input() t=input() ans=0 for i in range(len(s)-len(t)): cnt=0 for j in range(len(t)): if t[j]==s[j+i]: cnt+=1 ans=max(ans,cnt) print(len(t)-ans)
s=input() t=input() ans=0 for i in range(len(s)-len(t)+1): cnt=0 for j in range(len(t)): if t[j]==s[j+i]: cnt+=1 ans=max(ans,cnt) 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
76
import math import itertools import sys s = input() t = input() cnt = len(t) for i in range(len(s)-len(t)): tmp = s[i:len(t)+i] tcnt = 0 for j in range(len(tmp)): if(tmp[j] != t[j]): tcnt += 1 cnt = min(cnt, tcnt) print(cnt)
import math import itertools import sys s = input() t = input() cnt = len(t) for i in range(len(s)-len(t)+1): tmp = s[i:len(t)+i] tcnt = 0 for j in range(len(tmp)): if(tmp[j] != t[j]): tcnt += 1 cnt = min(cnt, tcnt) print(cnt)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
93
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <math.h> #include <numeric> #include <queue> #include <set> #include <string> #include <unordered_set> using namespace std; #define ll long long #define rep(i, n) for (int i = 0; i < n; i++) #define FOR(i, n, m) for (int i = n; i < m;...
#include <algorithm> #include <bitset> #include <cmath> #include <iostream> #include <math.h> #include <numeric> #include <queue> #include <set> #include <string> #include <unordered_set> using namespace std; #define ll long long #define rep(i, n) for (int i = 0; i < n; i++) #define FOR(i, n, m) for (int i = n; i < m;...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
301
package main import ( "bufio" "fmt" "log" "math" "os" "strconv" ) var sc = bufio.NewScanner(os.Stdin) var buff []byte func nextString() string { sc.Scan() return sc.Text() } func nextFloat64() float64 { sc.Scan() f, err := strconv.ParseFloat(sc.Text(), 64) if err != nil { panic(err) } return f } fun...
package main import ( "bufio" "fmt" "log" "math" "os" "strconv" ) var sc = bufio.NewScanner(os.Stdin) var buff []byte func nextString() string { sc.Scan() return sc.Text() } func nextFloat64() float64 { sc.Scan() f, err := strconv.ParseFloat(sc.Text(), 64) if err != nil { panic(err) } return f } fun...
[["-", 8, 196, 0, 7, 0, 430, 15, 16, 17, 18], ["+", 8, 196, 0, 7, 0, 430, 15, 16, 17, 19]]
7
694
import sys, math from collections import defaultdict, deque, Counter from bisect import bisect_left, bisect_right from itertools import combinations, permutations, product from heapq import heappush, heappop from functools import lru_cache input = sys.stdin.readline rs = lambda: input().strip() ri = lambda: int(input()...
import sys, math from collections import defaultdict, deque, Counter from bisect import bisect_left, bisect_right from itertools import combinations, permutations, product from heapq import heappush, heappop from functools import lru_cache input = sys.stdin.readline rs = lambda: input().strip() ri = lambda: int(input()...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
217
#include <bits/stdc++.h> using namespace std; using ll = long long; const int MOD = 1e9 + 7; int main() { string s, t; cin >> s >> t; int ans = t.size(); for (int i = 0; i < s.size() - t.size(); i++) { int a{}; for (int j = 0; j < t.size(); j++) { if (t.at(j) != s.at(i + j)) a++; } ...
#include <bits/stdc++.h> using namespace std; using ll = long long; const int MOD = 1e9 + 7; int main() { string s, t; cin >> s >> t; int ans = t.size(); for (int i = 0; i <= s.size() - t.size(); i++) { int a{}; for (int j = 0; j < t.size(); j++) { if (t.at(j) != s.at(i + j)) a++; } ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
133
/* vrrtll==???>;::::~~~~~~......`.`````````````````````...-?777!_.._?7u,~~~::::;>>??=lllttrrzu rtll==??>>;::::~~~~......`.`````````````````` ..J77!`````````...`..._T,~~~~:::;;>??==lttrrv tll=??>>;:::~~~~......``````````````````..J7^ ` `` ` `` .,```````...._4,.~~~::;;>>?===lttr l=???>;;::~~~......`````HTSu,.`` `..J7! ...
/* vrrtll==???>;::::~~~~~~......`.`````````````````````...-?777!_.._?7u,~~~::::;>>??=lllttrrzu rtll==??>>;::::~~~~......`.`````````````````` ..J77!`````````...`..._T,~~~~:::;;>??==lttrrv tll=??>>;:::~~~~......``````````````````..J7^ ` `` ` `` .,```````...._4,.~~~::;;>>?===lttr l=???>;;::~~~......`````HTSu,.`` `..J7! ...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
874
#include <algorithm> #include <array> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <limits> #include <queue> #include <set> #include <stack> #include <string> #include <utility> using namespace std; typedef long long ll; int main() { string s, t; cin >> s >> t; int min_cnt...
#include <algorithm> #include <array> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <limits> #include <queue> #include <set> #include <stack> #include <string> #include <utility> using namespace std; typedef long long ll; int main() { string s, t; cin >> s >> t; int min_cnt...
[["-", 0, 43, 49, 50, 51, 2, 63, 118, 28, 22], ["+", 0, 43, 49, 50, 51, 2, 63, 118, 28, 22], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
150
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdint> #include <cstdio> #include <deque> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <unordered_map> #include <unordered_set> #inc...
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdint> #include <cstdio> #include <deque> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <unordered_map> #include <unordered_set> #inc...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
245
//(UNCOMMENT WHEN SUBMITTING) //#pragma GCC optimize("O3") //(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS) // #pragma comment(linker, "/stack:200000000") //(UNCOMMENT WHEN NEEDED) // #pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,...
//(UNCOMMENT WHEN SUBMITTING) //#pragma GCC optimize("O3") //(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS) // #pragma comment(linker, "/stack:200000000") //(UNCOMMENT WHEN NEEDED) // #pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
192
#include <bits/stdc++.h> typedef long long ll; using namespace std; const ll maxn = 2e5 + 100; string s, t; int main() { ios::sync_with_stdio(0), cout.tie(0), cin.tie(0); // freopen("in.txt","r",stdin); cin >> s >> t; ll ans = 0x3f3f3f3f; for (int i = 0; i + t.size() < s.size(); i++) { ll temp = 0; fo...
#include <bits/stdc++.h> typedef long long ll; using namespace std; const ll maxn = 2e5 + 100; string s, t; int main() { ios::sync_with_stdio(0), cout.tie(0), cin.tie(0); // freopen("in.txt","r",stdin); cin >> s >> t; ll ans = 0x3f3f3f3f; for (int i = 0; i + t.size() - 1 < s.size(); i++) { ll temp = 0; ...
[["+", 8, 9, 0, 7, 15, 16, 31, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 31, 16, 12, 13]]
1
149
// ABHISHEK AGRAWAL,BIT mesra// // Newbie......You have to be odd to be no. ONE :)// #include <bits/stdc++.h> using namespace std; #define ll long long int #define ld long double #define fl float #define lcm(a, b) (a * (b / __gcd(a, b))) #define vs vector<string> #define vc vector<char> #define vii vector<int> #define ...
// ABHISHEK AGRAWAL,BIT mesra// // Newbie......You have to be odd to be no. ONE :)// #include <bits/stdc++.h> using namespace std; #define ll long long int #define ld long double #define fl float #define lcm(a, b) (a * (b / __gcd(a, b))) #define vs vector<string> #define vc vector<char> #define vii vector<int> #define ...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["-", 8, 9, 0, 9, 0, 7, 15, 16, 17, 19], ["+", 8, 9, 0, 9, 0, 7, 15, 16, 17, 18]]
1
1,205
#include <algorithm> #include <bits/stdc++.h> #include <bitset> #include <cmath> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <regex> #include <set> #include <stack> #include <st...
#include <algorithm> #include <bits/stdc++.h> #include <bitset> #include <cmath> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <regex> #include <set> #include <stack> #include <st...
[["+", 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
310
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define sz(x) int(x.size()) using namespace std; typedef long long ll; const int inf = 1001001001; int main() { string s, t; cin >> s >> t; int ns = sz(s); int nt = sz(t); int ans = inf; rep(i, ns) { int cnt = 0; rep(j, nt)...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define sz(x) int(x.size()) using namespace std; typedef long long ll; const int inf = 1001001001; int main() { string s, t; cin >> s >> t; int ns = sz(s); int nt = sz(t); int ans = inf; rep(i, ns - nt + 1) { int cnt = 0; r...
[["+", 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
122
// #include <chutiya_mistakes_avoid.h> // implementation bekar hai tera #include <bits/stdc++.h> #include <string.h> #define int long long #define MAX (int)(1e7 + 5) #define MAX2D (int)(1e3 + 5) #define itn int #define inf 5e18 #define MOD (int)(1e9 + 7) #define pb push_back #define mk make_pair #define all(x) x.begin(...
// #include <chutiya_mistakes_avoid.h> // implementation bekar hai tera #include <bits/stdc++.h> #include <string.h> #define int long long #define MAX (int)(1e7 + 5) #define MAX2D (int)(1e3 + 5) #define itn int #define inf 5e18 #define MOD (int)(1e9 + 7) #define pb push_back #define mk make_pair #define all(x) x.begin(...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
728
#include <bits/stdc++.h> using namespace std; char s[1005], t[1005]; int main() { scanf(" %s", s); scanf(" %s", t); int lens = strlen(s); int lent = strlen(t); int maxSame = 0; for (int i = 0; i < lens - lent; i++) { int sameCnt = lent; for (int j = 0; j < lent; j++) { if (s[i + j] != t[j]) ...
#include <bits/stdc++.h> using namespace std; char s[1005], t[1005]; int main() { scanf(" %s", s); scanf(" %s", t); int lens = strlen(s); int lent = strlen(t); int maxSame = 0; for (int i = 0; i <= lens - lent; i++) { int sameCnt = lent; for (int j = 0; j < lent; 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
142
import sys import math from collections import deque sys.setrecursionlimit(1000000) MOD = 10 ** 9 + 7 input = lambda: sys.stdin.readline().strip() NI = lambda: int(input()) NMI = lambda: map(int, input().split()) NLI = lambda: list(NMI()) SI = lambda: input() def make_grid(h, w, num): return [[int(num)] * w for _ in...
import sys import math from collections import deque sys.setrecursionlimit(1000000) MOD = 10 ** 9 + 7 input = lambda: sys.stdin.readline().strip() NI = lambda: int(input()) NMI = lambda: map(int, input().split()) NLI = lambda: list(NMI()) SI = lambda: input() def make_grid(h, w, num): return [[int(num)] * w for _ in...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
203
S = input() T = input() size = len(T) n = len(S) ans = size for i in range(n-size): t = S[i:i+size] v = sum([k!=j for k, j in zip(T, t)]) ans = min(v, ans) print(ans)
S = input() T = input() size = len(T) n = len(S) ans = size for i in range(n-size+1): t = S[i:i+size] v = sum([k!=j for k, j in zip(T, t)]) ans = min(v, ans) 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" #define rep(i, n) for (ll i = 0; i < n; ++i) #define ALL(x) x.begin(), x.end() using namespace std; typedef long long ll; template <typename T> T gcd(T a, T b) { if (a % b == 0) { return (b); } else { return (gcd(b, a % b)); } } template <typename T> T lcm(T a, T b) { return a ...
#include "bits/stdc++.h" #define rep(i, n) for (ll i = 0; i < n; ++i) #define ALL(x) x.begin(), x.end() using namespace std; typedef long long ll; template <typename T> T gcd(T a, T b) { if (a % b == 0) { return (b); } else { return (gcd(b, a % b)); } } template <typename T> T lcm(T a, T b) { return a ...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
211
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> //#include <boost/multiprecision/cpp_int.hpp> // // using namespace boost::multiprecision; using namespace __gnu_pbds; using namespace std; typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> //#include <boost/multiprecision/cpp_int.hpp> // // using namespace boost::multiprecision; using namespace __gnu_pbds; using namespace std; typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
951
#include <bits/stdc++.h> using namespace std; // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> // using namespace __gnu_pbds; #define ordered_set \ tree<pair<int, int>, null_type, less<pair<int, int>>, rb_tree_tag, ...
#include <bits/stdc++.h> using namespace std; // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> // using namespace __gnu_pbds; #define ordered_set \ tree<pair<int, int>, null_type, less<pair<int, int>>, rb_tree_tag, ...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
780
import os import heapq import sys,threading import math import operator from collections import defaultdict from io import BytesIO, IOBase sys.setrecursionlimit(10 ** 5) threading.stack_size(2**27) def gcd(a, b): if b == 0: return a else: return gcd(b, a % b) """def pw(a,b): result=1 ...
import os import heapq import sys,threading import math import operator from collections import defaultdict from io import BytesIO, IOBase sys.setrecursionlimit(10 ** 5) threading.stack_size(2**27) def gcd(a, b): if b == 0: return a else: return gcd(b, a % b) """def pw(a,b): result=1 ...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
641
import copy s = input() t = input() sn = len(s) tn = len(t) answer = int(copy.deepcopy(tn)) for i in range(sn-tn): sk = s[i:i+tn] count = 0 for j in range(tn): if sk[j] != t[j]: count += 1 if count < answer: answer = count print(answer)
import copy s = input() t = input() sn = len(s) tn = len(t) answer = int(copy.deepcopy(tn)) for i in range(sn-tn+1): sk = s[i:i+tn] count = 0 for j in range(tn): if sk[j] != t[j]: count += 1 if count < answer: answer = count print(answer)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
92
#include <bits/stdc++.h> #define ll long long #define pb push_back #define ff first #define ss second #define setbits(x) __builtin_popcountll(x) #define lp(a, n) for (ll i = a; i < n; i++) #define lpi(a, n) for (int i = a; i < n; i++) #define w(t) \ in...
#include <bits/stdc++.h> #define ll long long #define pb push_back #define ff first #define ss second #define setbits(x) __builtin_popcountll(x) #define lp(a, n) for (ll i = a; i < n; i++) #define lpi(a, n) for (int i = a; i < n; i++) #define w(t) \ in...
[["+", 0, 57, 64, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 27, 17, 29], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35]]
1
649
#include <bits/stdc++.h> #define F first #define S second #define pb push_back #define eb emplace_back #define mp make_pair #define repi(n) for (int i = 0; i < (n); i++) #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define all(p) p.begin(), p.end() #define pop_count(p) __builtin_popcountll(p) #define len(s, e) ...
#include <bits/stdc++.h> #define F first #define S second #define pb push_back #define eb emplace_back #define mp make_pair #define repi(n) for (int i = 0; i < (n); i++) #define rep(i, n) for (int(i) = 0; (i) < (n); (i)++) #define all(p) p.begin(), p.end() #define pop_count(p) __builtin_popcountll(p) #define len(s, e) ...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 22], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
1,335
#include <bits/stdc++.h> using namespace std; #define endl "\n" #define ll long long #define mod 1000000007 const int sz = 1e5 + 5; ll inf = 1e15; int main() { ios_base::sync_with_stdio(false); cin.tie(0); int t = 1; // cin>>t; while (t--) { string s1, s2; cin >> s1 >> s2; int n = s1.length(); ...
#include <bits/stdc++.h> using namespace std; #define endl "\n" #define ll long long #define mod 1000000007 const int sz = 1e5 + 5; ll inf = 1e15; int main() { ios_base::sync_with_stdio(false); cin.tie(0); int t = 1; // cin>>t; while (t--) { string s1, s2; cin >> s1 >> s2; int n = s1.length(); ...
[["+", 8, 9, 0, 7, 15, 16, 31, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 31, 16, 12, 13]]
1
167
#include <bits/stdc++.h> using namespace std; #define loop(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) for (int i = 0; i < n; ++i) #define dump(a) cerr << #a << " = " << (a) << "(L:" << __LINE__ << ")" << endl void solve(std::string S, std::string T) { int a = 0; rep(i, S.size() - T.size()) { i...
#include <bits/stdc++.h> using namespace std; #define loop(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) for (int i = 0; i < n; ++i) #define dump(a) cerr << #a << " = " << (a) << "(L:" << __LINE__ << ")" << endl void solve(std::string S, std::string T) { int a = 0; rep(i, S.size() - T.size() + 1) { ...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
160
/* * じょえチャンネル * 高評価・チャンネル登録よろしくおねがいします! * https://www.youtube.com/channel/UCRXsI3FL_kvaVL9zoolBfbQ */ #include <algorithm> #include <bitset> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <ctime> #include <deque> #include <fstream> #include <functional> #includ...
/* * じょえチャンネル * 高評価・チャンネル登録よろしくおねがいします! * https://www.youtube.com/channel/UCRXsI3FL_kvaVL9zoolBfbQ */ #include <algorithm> #include <bitset> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <ctime> #include <deque> #include <fstream> #include <functional> #includ...
[["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
3,039
#include <bits/stdc++.h> using namespace std; #define ll long long #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie...
#include <bits/stdc++.h> using namespace std; #define ll long long #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
138
#include <bits/stdc++.h> #include <cmath> using namespace std; #define coutv(v) \ for (int i = 0; i < (v).size(); ++i) \ cout << v[i] << ' '; \ cout << end...
#include <bits/stdc++.h> #include <cmath> using namespace std; #define coutv(v) \ for (int i = 0; i < (v).size(); ++i) \ cout << v[i] << ' '; \ cout << end...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
182
#include <algorithm> #include <cmath> #include <iostream> #include <stdio.h> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main() { string s, t; cin >> s >> t; int max = -1; rep(i, s.size() - t.size()) { int cnt = 0; rep(j, t.size()) { ...
#include <algorithm> #include <cmath> #include <iostream> #include <stdio.h> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main() { string s, t; cin >> s >> t; int max = -1; rep(i, s.size() - t.size() + 1) { int cnt = 0; rep(j, t.size()) { ...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
127
#include <bits/stdc++.h> #define ll long long int #define mp make_pair #define F first #define S second #define pb push_back #define rep(i, a, b) for (ll i = a; i <= b; i++) #define all(a) a.begin(), a.end() #define Nmax 1000005 #define INF 1000000000 #define MOD 1000000007 using namespace std; ll mod = 1e9 + 7; ll ...
#include <bits/stdc++.h> #define ll long long int #define mp make_pair #define F first #define S second #define pb push_back #define rep(i, a, b) for (ll i = a; i <= b; i++) #define all(a) a.begin(), a.end() #define Nmax 1000005 #define INF 1000000000 #define MOD 1000000007 using namespace std; ll mod = 1e9 + 7; ll ...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
388
#include <bits/stdc++.h> using namespace std; #define FIO \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define tc \ int t; ...
#include <bits/stdc++.h> using namespace std; #define FIO \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define tc \ int t; ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
242
s = input() t = input() res = 10**10 for n in range(len(s)-len(t)): id = n ct = 0 for k in range(len(t)): a = t[k] b = s[id] if a != b: ct += 1 id += 1 res = min(res, ct) print(res)
s = input() t = input() res = 10**10 for n in range(len(s)-len(t)+1): id = n ct = 0 for k in range(len(t)): a = t[k] b = s[id] if a != b: ct += 1 id += 1 res = min(res, ct) print(res)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
83
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; int main() { string s, t; cin >> s; cin >> t; int m = s.size(); int n = t.size(); int mincount = m; for (int i = 0; i < m - n; i++) { int count = 0; for (int k = 0; k < n; k++) { ...
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; int main() { string s, t; cin >> s; cin >> t; int m = s.size(); int n = t.size(); int mincount = m; for (int i = 0; i < m - n + 1; i++) { int count = 0; for (int k = 0; k < n; k++) ...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
135
#include <iostream> using namespace std; #define int long long int32_t main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); string s, t; cin >> s >> t; int n = s.length(); int k = t.length(); int ans = 1e9; for (int i = 0; i + k <= n; ++i) { int c = 0; for (int j = i; j <= i + k; ...
#include <iostream> using namespace std; #define int long long int32_t main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); string s, t; cin >> s >> t; int n = s.length(); int k = t.length(); int ans = 1e9; for (int i = 0; i + k <= n; ++i) { int c = 0; for (int j = i; j < i + k; +...
[["-", 0, 7, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 17, 18]]
1
141
#include <bits/stdc++.h> #include <chrono> using namespace std; template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } // typedef //------------------------------------------ typedef pair<int, int> PII; typedef long long LL; typedef pair<LL, LL> PLL; // container u...
#include <bits/stdc++.h> #include <chrono> using namespace std; template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } // typedef //------------------------------------------ typedef pair<int, int> PII; typedef long long LL; typedef pair<LL, LL> PLL; // container u...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
728
import sys input = sys.stdin.readline s = input()[:-1] t = input()[:-1] ans = len(t) for i in range(len(s) - len(t)): tmp = sum(s[i + j] != t[j] for j in range(len(t))) ans = min(ans, tmp) print(ans)
import sys input = sys.stdin.readline s = input()[:-1] t = input()[:-1] ans = len(t) for i in range(len(s) - len(t) + 1): tmp = sum(s[i + j] != t[j] for j in range(len(t))) 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
89
s=input() t=input() ans=10000 for i in range(len(s)-len(t)): temp=s[i:i+len(t)] m=0 for j,k in enumerate(temp): if k!=t[j]: m+=1 ans=min(ans,m) print(ans)
s=input() t=input() ans=10000 for i in range(len(s)-len(t)+1): temp=s[i:i+len(t)] m=0 for j,k in enumerate(temp): if k!=t[j]: m+=1 ans=min(ans,m) print(ans)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
78
s = gets.chomp.split("") t = gets.chomp.split("") n = s.size m = t.size ans = 114514 (n-m).times do |i| c = 0 m.times do |j| c += 1 if s[i+j] != t[j] end ans = ans > c ? c : ans end puts ans
s = gets.chomp.split("") t = gets.chomp.split("") n = s.size m = t.size ans = 114514 (n-m+1).times do |i| c = 0 m.times do |j| c += 1 if s[i+j] != t[j] end ans = ans > c ? c : ans end puts ans
[["+", 0, 493, 0, 652, 486, 739, 0, 738, 17, 72], ["+", 0, 493, 0, 652, 486, 739, 0, 738, 12, 612]]
4
84
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll inf = 1e18; #define rep(i, a, b) for (int i = a; i < b; i++) #define per(i, a, b) for (int i = b - 1; i >= a; i--) #define int ll using pint = pair<int, int>; int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}; signed main() { string s, t; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll inf = 1e18; #define rep(i, a, b) for (int i = a; i < b; i++) #define per(i, a, b) for (int i = b - 1; i >= a; i--) #define int ll using pint = pair<int, int>; int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}; signed main() { string s, t; ...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
183
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> #define FOR(i, a, b) for (int i = a; i < b; i++) #define rep(i, n) FOR(i, 0, n) #define ROF(i, a, b) for (int i = a; i >= b; i--) #define per(i, a) ROF(i, a, 0) #define pb push_back using namespace std; using ll = long long; using ld = long double; typedef pair<ll, ll> P;...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> #define FOR(i, a, b) for (int i = a; i < b; i++) #define rep(i, n) FOR(i, 0, n) #define ROF(i, a, b) for (int i = a; i >= b; i--) #define per(i, a) ROF(i, a, 0) #define pb push_back using namespace std; using ll = long long; using ld = long double; typedef pair<ll, ll> P;...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
337
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using vl = vector<ll>; using vll = vector<vl>; using Pll = pair<ll, ll>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define all(v) v.begin(), v.end() #define sz(x) ((int)x.size()) #define pb push_back #define mp make_pai...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using vl = vector<ll>; using vll = vector<vl>; using Pll = pair<ll, ll>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define all(v) v.begin(), v.end() #define sz(x) ((int)x.size()) #define pb push_back #define mp make_pai...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
317
//#pragma GCC target("avx2") #pragma GCC optimize("O3") //#pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include <prettyprint.hpp> #define debug(...) cerr << "[" << #__VA_ARGS__ << "]: ", d_err(__VA_ARGS__); #else #define debug(...) 83; #endif void d_err() { cerr <...
//#pragma GCC target("avx2") #pragma GCC optimize("O3") //#pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include <prettyprint.hpp> #define debug(...) cerr << "[" << #__VA_ARGS__ << "]: ", d_err(__VA_ARGS__); #else #define debug(...) 83; #endif void d_err() { cerr <...
[["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]]
1
339
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; int main() ...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; int main() ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
146
#include <bits/stdc++.h> using namespace std; #define ll long long int #define pb push_back #define mp make_pair #define deb(x) cout << #x << " " << x << "\n"; #define MAX 9223372036854775807 #define MIN -9223372036854775807 #define PI 3.141592653589 #define setbits(n) __builtin_popcountll(n) const ll mod = 1e9 + 7; i...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define pb push_back #define mp make_pair #define deb(x) cout << #x << " " << x << "\n"; #define MAX 9223372036854775807 #define MIN -9223372036854775807 #define PI 3.141592653589 #define setbits(n) __builtin_popcountll(n) const ll mod = 1e9 + 7; i...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 7, 8, 9, 0, 43, 39, 78]]
1
214
#include <bits/stdc++.h> using namespace std; #define ll long long int #define pb push_back #define F first #define S second #define mod 1000000000 #define all(a) a.begin(), a.end() #define dbg(n) cout << #n << ' ' << n << endl; #define dbg_v(v) \ cout << ...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define pb push_back #define F first #define S second #define mod 1000000000 #define all(a) a.begin(), a.end() #define dbg(n) cout << #n << ' ' << n << endl; #define dbg_v(v) \ cout << ...
[["-", 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, 31, 22], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33]]
1
259
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; typedef pair<int, int> P; typedef tuple<ll, ll, ll> T; const long long INF = 1LL << 60; const int MOD = 1000000000 + 7; #define rev(s) (string((s).rbegin(), (s).rend())) template <typename T> inline strin...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; typedef pair<int, int> P; typedef tuple<ll, ll, ll> T; const long long INF = 1LL << 60; const int MOD = 1000000000 + 7; #define rev(s) (string((s).rbegin(), (s).rend())) template <typename T> inline strin...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
211
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <string> #include <utility> #include <vector> using namespace std; #define int long long #define endl "\n" constexpr long long INF = (long long)1e18; constexpr long long MOD = 1'000'000'007; struct fast_io { fast_io() { std:...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <string> #include <utility> #include <vector> using namespace std; #define int long long #define endl "\n" constexpr long long INF = (long long)1e18; constexpr long long MOD = 1'000'000'007; struct fast_io { fast_io() { std:...
[["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 13], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 72]]
1
201
#include <bits/stdc++.h> using namespace std; int main() { char s[1005], t[1005]; scanf("%s", s); scanf("%s", t); int sl = strlen(s), tl = strlen(t), ans = sl + tl, cnt; for (int k = 0; k < sl - tl; ++k) { cnt = 0; for (int i = 0; i < tl; ++i) { cnt += (t[i] != s[k + i]); } ans = min(an...
#include <bits/stdc++.h> using namespace std; int main() { char s[1005], t[1005]; scanf("%s", s); scanf("%s", t); int sl = strlen(s), tl = strlen(t), ans = sl + tl, cnt; for (int k = 0; k <= sl - tl; ++k) { cnt = 0; for (int i = 0; i < tl; ++i) { cnt += (t[i] != s[k + i]); } ans = min(a...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
137
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) typedef long long ll; #define ALL(v) v.begin(), v.end() #define vmax(v) *max_element(ALL(v)) #define vmin(v) *min_element(ALL(v)) #define chmax(x, a) x = max(x, a...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) typedef long long ll; #define ALL(v) v.begin(), v.end() #define vmax(v) *max_element(ALL(v)) #define vmin(v) *min_element(ALL(v)) #define chmax(x, a) x = max(x, a...
[["-", 8, 9, 0, 43, 49, 50, 51, 16, 17, 72], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
159
import java.io.*; import java.math.*; import java.util.*; public class Main { static int repow(int b, int p) { long a = b; long res = 1; while (p > 0) { if (p % 2 == 1) { res *= a; } a *= a; p /= 2; } return (int)res; } static int repow(int b, int p, int modder...
import java.io.*; import java.math.*; import java.util.*; public class Main { static int repow(int b, int p) { long a = b; long res = 1; while (p > 0) { if (p % 2 == 1) { res *= a; } a *= a; p /= 2; } return (int)res; } static int repow(int b, int p, int modder...
[["+", 8, 196, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 196, 0, 7, 15, 16, 12, 16, 12, 499]]
3
4,999
s=input() t=input() ans=0 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 print(len(t)-count)
s=input() t=input() ans=0 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 print(len(t)-ans)
[["-", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
78
#include <bits/stdc++.h> #define boost_io \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) #define int long long #define num(a) a...
#include <bits/stdc++.h> #define boost_io \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) #define int long long #define num(a) a...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
282
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; using P = pair<ll, ll>; using V = vector<ll>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep1(i, n) for (ll i = 1; i <= (ll)(n); i++) #define rep2(i, m, n) for (ll i = m; i < (ll)(n); i++) #define rrep(...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; using P = pair<ll, ll>; using V = vector<ll>; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rep1(i, n) for (ll i = 1; i <= (ll)(n); i++) #define rep2(i, m, n) for (ll i = m; i < (ll)(n); i++) #define rrep(...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
344
S = input() T = input() result = float('inf') for i in range(len(S) - len(T)): count = sum(x != y for x, y in zip(S[i:i+len(T)], T)) if count < result: result = count print(result)
S = input() T = input() result = float('inf') for i in range(len(S) - len(T) + 1): count = sum(x != y for x, y in zip(S[i:i+len(T)], T)) if count < result: result = count print(result)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
75
#include <bits/stdc++.h> #define int long long #define pii pair<int, int> #define mp make_pair #define fi fisrt #define se second using namespace std; const int N = 1e5 + 5; const int mod = 1e9 + 7; const int inf = 0x3f3f3f3f3f3f3f; vector<int> vec[N]; int n, m, k, ans = inf; int a[N]; int num[N]; string s, t; int l...
#include <bits/stdc++.h> #define int long long #define pii pair<int, int> #define mp make_pair #define fi fisrt #define se second using namespace std; const int N = 1e5 + 5; const int mod = 1e9 + 7; const int inf = 0x3f3f3f3f3f3f3f; vector<int> vec[N]; int n, m, k, ans = inf; int a[N]; int num[N]; string s, t; int l...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
237
#include <bits/stdc++.h> #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define ll long long int #define dbg(...
#include <bits/stdc++.h> #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define ll long long int #define dbg(...
[["-", 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> using namespace std; int main() { // string a, b; int Max = 0; cin >> a >> b; for (int i = 0; i < a.size() - b.size(); i++) { int cnt = 0; for (int j = 0; j < b.size(); j++) { if (a.at(i + j) == b.at(j)) cnt++; } Max = max(Max, cnt); } cout << b.si...
#include <bits/stdc++.h> using namespace std; int main() { // string a, b; int Max = 0; cin >> a >> b; for (int i = 0; i <= a.size() - b.size(); i++) { int cnt = 0; for (int j = 0; j < b.size(); j++) { if (a.at(i + j) == b.at(j)) cnt++; } Max = max(Max, cnt); } cout << b.s...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
121
#include <bits/stdc++.h> typedef uint64_t u64; typedef int64_t i64; typedef uint32_t u32; typedef int32_t i32; #define MAX_NUM (1000000007) #define PI 3.14159265358979323846 using namespace std; template <typename T> static inline void ArrayInput(vector<T> &A) { for (auto itr = A.begin(); itr < A.end(); ++itr) ...
#include <bits/stdc++.h> typedef uint64_t u64; typedef int64_t i64; typedef uint32_t u32; typedef int32_t i32; #define MAX_NUM (1000000007) #define PI 3.14159265358979323846 using namespace std; template <typename T> static inline void ArrayInput(vector<T> &A) { for (auto itr = A.begin(); itr < A.end(); ++itr) ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
1,235
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <iostream> #include <string> #include <unordered_map> #include <unordered_set> using namespace std; #define ll long long #define rep(i, n) for (ll i = 0; i < (n); i++) #define FOR(i, a, b) for (ll i = (a); i < (b); i++) #define FORR(i, a, b) for (l...
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <iostream> #include <string> #include <unordered_map> #include <unordered_set> using namespace std; #define ll long long #define rep(i, n) for (ll i = 0; i < (n); i++) #define FOR(i, a, b) for (ll i = (a); i < (b); i++) #define FORR(i, a, b) for (l...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
390
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <string> #include <vector> using namespace std; typedef long long ll; ty...
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <string> #include <vector> using namespace std; typedef long long ll; ty...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
320
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int l1 = s.length(), l2 = t.length(); int ans = 1005; for (int i = 0; i < l1 - l2; i++) { int temp = 0; for (int j = 0; j < l2; j++) { if (s[i + j] != t[j]) temp++; } ans = min(ans, temp); }...
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int l1 = s.length(), l2 = t.length(); int ans = 1005; for (int i = 0; i <= l1 - l2; i++) { int temp = 0; for (int j = 0; j < l2; j++) { if (s[i + j] != t[j]) temp++; } ans = min(ans, temp); ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
114
#include <cmath> #include <iostream> #include <algorithm> #include <array> #include <limits> #include <queue> #include <unordered_set> #include <vector> using namespace std; int main() { string s; string t; cin >> s >> t; int min_score = numeric_limits<int>::max(); for (int i = 0; i < s.size() - t.size(); ...
#include <cmath> #include <iostream> #include <algorithm> #include <array> #include <limits> #include <queue> #include <unordered_set> #include <vector> using namespace std; int main() { string s; string t; cin >> s >> t; int min_score = numeric_limits<int>::max(); for (int i = 0; i <= s.size() - t.size();...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
139
#include <bits/stdc++.h> #include <random> #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep1(i, n) for (int i = 1; i <= (n); ++i) using namespace std; using ll = long long; using P = pair<ll, ll>; using ull = unsigned long long; const ll K_MAX = 1e5 + 5; const ll Lmax = ll(1e18); const int Nmax = 2e5 + 1; c...
#include <bits/stdc++.h> #include <random> #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep1(i, n) for (int i = 1; i <= (n); ++i) using namespace std; using ll = long long; using P = pair<ll, ll>; using ull = unsigned long long; const ll K_MAX = 1e5 + 5; const ll Lmax = ll(1e18); const int Nmax = 2e5 + 1; c...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
195
#include <bits/stdc++.h> using namespace std; int main() { string S, T; cin >> S >> T; int diff = S.size() - T.size(); int ans = T.size(); for (int i = 0; i < diff; i++) { int change = 0; for (int j = 0; j < T.size(); j++) { if (S.at(j + i) != T.at(j)) { change++; } } ans...
#include <bits/stdc++.h> using namespace std; int main() { string S, T; cin >> S >> T; int diff = S.size() - T.size(); int ans = T.size(); for (int i = 0; i <= diff; i++) { int change = 0; for (int j = 0; j < T.size(); j++) { if (S.at(j + i) != T.at(j)) { change++; } } an...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
129
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> ii; typedef vector<int> vi; typedef vector<ii> vii; typedef long double ld; typedef set<int>::iterator sit; typedef map<int, int>::iterator mit; typedef vector<int>::iterator vit; const int INF = 1e9 + 7; const int MOD = 1e9 +...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> ii; typedef vector<int> vi; typedef vector<ii> vii; typedef long double ld; typedef set<int>::iterator sit; typedef map<int, int>::iterator mit; typedef vector<int>::iterator vit; const int INF = 1e9 + 7; const int MOD = 1e9 +...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
400
#include "bits/stdc++.h" #define MOD 1000000007 #define rep(i, n) for (ll i = 0; i < (n); i++) #define rrep(i, n) for (ll i = (n)-1; i >= 0; i--) #define ALL(v) v.begin(), v.end() #define rALL(v) v.rbegin(), v.rend() #define FOR(i, j, k) for (ll i = j; i < k; i++) #define debug_print(var) cerr << #var << "=" << var <<...
#include "bits/stdc++.h" #define MOD 1000000007 #define rep(i, n) for (ll i = 0; i < (n); i++) #define rrep(i, n) for (ll i = (n)-1; i >= 0; i--) #define ALL(v) v.begin(), v.end() #define rALL(v) v.rbegin(), v.rend() #define FOR(i, j, k) for (ll i = j; i < k; i++) #define debug_print(var) cerr << #var << "=" << var <<...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
1,010
S=list(input()) T=list(input()) ans_li=[] for i in range(len(S)-len(T)): ans=0 for j in range(len(T)): if S[i+j]!=T[j]: ans+=1 ans_li.append(ans) print(min(ans_li))
S=list(input()) T=list(input()) ans_li=[] for i in range(len(S)-len(T)+1): ans=0 for j in range(len(T)): if S[i+j]!=T[j]: ans+=1 ans_li.append(ans) print(min(ans_li))
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
79
#pragma GCC target("avx") //#pragma GCC target("avx512f,avx512dq,avx512cd,avx512bw,avx512vl") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> using namespace std; #define LL long long #define DB double #define LD long double #define ST string #define BS bitset #define PA pair<LL...
#pragma GCC target("avx") //#pragma GCC target("avx512f,avx512dq,avx512cd,avx512bw,avx512vl") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> using namespace std; #define LL long long #define DB double #define LD long double #define ST string #define BS bitset #define PA pair<LL...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
1,886
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; vector<string> v; int ans = 1e9; for (int i = 0; i < s.size() - t.size(); i++) { int cnt = 0; for (int j = 0; j < t.size(); j++) { if (t[j] != s[i + j]) cnt++; } ans = min(ans, cnt); } cou...
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; vector<string> v; int ans = 1e9; for (int i = 0; i <= s.size() - t.size(); i++) { int cnt = 0; for (int j = 0; j < t.size(); j++) { if (t[j] != s[i + j]) cnt++; } ans = min(ans, cnt); } co...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
120
#include <bits/stdc++.h> using namespace std; // template {{{ #define range(i, l, r) for (int i = (int)(l); i < (int)(r); (i) += 1) #define rrange(i, l, r) for (int i = (int)(r)-1; i >= (int)(l); (i) -= 1) #define whole(f, x, ...) \ ([&](decltype((x)) container)...
#include <bits/stdc++.h> using namespace std; // template {{{ #define range(i, l, r) for (int i = (int)(l); i < (int)(r); (i) += 1) #define rrange(i, l, r) for (int i = (int)(r)-1; i >= (int)(l); (i) -= 1) #define whole(f, x, ...) \ ([&](decltype((x)) container)...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
669
#include <bits/stdc++.h> using namespace std; using ll = long long; int gcd(int a, int b) { if (b == 0) return a; return gcd(b, a % b); } int power(int x, int y, int p) { int res = 1; x = x % p; while (y > 0) { if (y & 1) res = (res * x) % p; y = y >> 1; x = (x * x) % p; } return r...
#include <bits/stdc++.h> using namespace std; using ll = long long; int gcd(int a, int b) { if (b == 0) return a; return gcd(b, a % b); } int power(int x, int y, int p) { int res = 1; x = x % p; while (y > 0) { if (y & 1) res = (res * x) % p; y = y >> 1; x = (x * x) % p; } return r...
[["+", 8, 9, 0, 7, 15, 16, 31, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 31, 16, 12, 13]]
1
410
#include <bits/stdc++.h> using namespace std; void solve(std::string S, std::string T) { int ans = 1e9; for (int i = 0; i + T.size() < S.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 << ...
#include <bits/stdc++.h> using namespace std; void solve(std::string S, std::string T) { int ans = 1e9; for (int i = 0; i + T.size() - 1 < S.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...
[["+", 8, 9, 0, 7, 15, 16, 31, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 31, 16, 12, 13]]
1
152
import os import sys from io import BytesIO, IOBase BUFSIZE = 8192 class FastIO(IOBase): newlines = 0 def __init__(self, file): self._fd = file.fileno() self.buffer = BytesIO() self.writable = "x" in file.mode or "r" not in file.mode self.write = self.buffer.write if self.writa...
import os import sys from io import BytesIO, IOBase BUFSIZE = 8192 class FastIO(IOBase): newlines = 0 def __init__(self, file): self._fd = file.fileno() self.buffer = BytesIO() self.writable = "x" in file.mode or "r" not in file.mode self.write = self.buffer.write if self.writa...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
770
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int len_s = s.length(); int len_t = t.length(); int mn = 2000; for (int i = 0; i < len_s - len_t; i++) { int cnt = 0; for (int j = 0; j < len_t; j++) { cnt += s[i + j] != t[j]; } mn = min(mn, cnt); ...
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int len_s = s.length(); int len_t = t.length(); int mn = 2000; for (int i = 0; i <= len_s - len_t; i++) { int cnt = 0; for (int j = 0; j < len_t; j++) { cnt += s[i + j] != t[j]; } mn = min(mn, cnt);...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
118