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
package main import ( "bufio" "fmt" "math" "os" "reflect" "sort" "strconv" "strings" // "regexp" ) /* sort */ type pair struct { index int64 p1, p2 interface{} } type pairs []pair func (slice pairs) Len() int { return len(slice) } func (slice pairs) Less(i, j int) bool { return slice[i].index < slice[...
package main import ( "bufio" "fmt" "math" "os" "reflect" "sort" "strconv" "strings" // "regexp" ) /* sort */ type pair struct { index int64 p1, p2 interface{} } type pairs []pair func (slice pairs) Len() int { return len(slice) } func (slice pairs) Less(i, j int) bool { return slice[i].index < slice[...
[["-", 8, 196, 0, 7, 0, 430, 15, 16, 17, 18], ["+", 8, 196, 0, 7, 0, 430, 15, 16, 17, 19]]
7
1,790
// '-.-' // () __.'.__ // .-:--:-. |_______| // () \____/ \=====/ // /\ {====} )___( // (\=...
// '-.-' // () __.'.__ // .-:--:-. |_______| // () \____/ \=====/ // /\ {====} )___( // (\=...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
369
#include <bits/stdc++.h> //#pragma GCC optimize("Ofast","no-stack-protector","unroll-loops") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx") //#include<bits/extc++.h> // using namespace __gnu_pbds; using namespace std; #define int long long #define F(i, L, R) for (int i = L; i < R; ++i) #defi...
#include <bits/stdc++.h> //#pragma GCC optimize("Ofast","no-stack-protector","unroll-loops") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx") //#include<bits/extc++.h> // using namespace __gnu_pbds; using namespace std; #define int long long #define F(i, L, R) for (int i = L; i < R; ++i) #defi...
[["-", 0, 52, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 9, 0, 1, 0, 11, 12, 23, 0, 24], ["+", 0, 9, 0, 1, 0, 11, 12, 23, 0, 25]]
1
221
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <cstdio> #include <functional> #include <iostream> #include <map> #include <queue> #include <stack> #include <string> #include <vector> using ll = long long; #define rep(i, n) for (ll i = 0; i < n; i++) using namespace std; void solve() {} int mai...
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <cstdio> #include <functional> #include <iostream> #include <map> #include <queue> #include <stack> #include <string> #include <vector> using ll = long long; #define rep(i, n) for (ll i = 0; i < n; i++) using namespace std; void solve() {} int mai...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 22], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
170
#include <bits/stdc++.h> using namespace std; using lli = long long; #define rep(i, n) for (int i = 0; i < n; i++) 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 (b < a) { a = b; return 1; } r...
#include <bits/stdc++.h> using namespace std; using lli = long long; #define rep(i, n) for (int i = 0; i < n; i++) 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 (b < a) { a = b; return 1; } r...
[["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]]
1
207
#include <algorithm> #include <iostream> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); ++i) using std::cin; using std::cout; using std::endl; using std::string; using std::vector; int main() { string S, T; cin >> S >> T; int mn = S.size(); for (int i = 0; i < S.size() - T.si...
#include <algorithm> #include <iostream> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); ++i) using std::cin; using std::cout; using std::endl; using std::string; using std::vector; int main() { string S, T; cin >> S >> T; int mn = S.size(); for (int i = 0; i <= S.size() - T.s...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
148
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <set> #include <string> #include <vector> using namespace std; int main() { string s, t; cin >> s >> t; int ans = 1000000000; for (int i = 0; i < s.size() - t.size(); i++) { int cur = 0; for (int j = 0; j < t.size(); j++)...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <set> #include <string> #include <vector> using namespace std; int main() { string s, t; cin >> s >> t; int ans = 1000000000; for (/*unsigned*/ int i = 0; i <= s.size() - t.size(); i++) { int cur = 0; for (/*unsigned*/ in...
[["-", 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> using namespace std; // DEFINE and // TYPEDEF-------------------------------------------------------------- // For actual content check from line 85 #define FORG(i, a, n) \ for (lld i = (lld)a; a < n ? i < (lld)n : (lld)n < i; ...
#include <bits/stdc++.h> using namespace std; // DEFINE and // TYPEDEF-------------------------------------------------------------- // For actual content check from line 85 #define FORG(i, a, n) \ for (lld i = (lld)a; a < n ? i < (lld)n : (lld)n < i; ...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
825
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; #define rep(i, n) for (ll i = 0; i < (ll)(n); ++i) #define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++) const ll MAX = 1001001; const ll MOD = 1000000007; int main() { string s, t; cin >> s >> t; ll ans = 1001001001; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; #define rep(i, n) for (ll i = 0; i < (ll)(n); ++i) #define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++) const ll MAX = 1001001; const ll MOD = 1000000007; int main() { string s, t; cin >> s >> t; ll ans = 1001001001; ...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
143
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/detail/standard_policies.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define ll long long #define int long long #define endl "\n" #define fi first #define se second #define fastio ...
#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> using namespace std; using namespace __gnu_pbds; #define ll long long #define int long long #define endl "\n" #define fi first #define se second #define fastio ...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
449
// Author : Mohamed sameh #include <bits/stdc++.h> typedef long long ll; #define pb push_back #define f first #define s second #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define SZ(a) (int)a.size() #define Flush fflush(stdout); using namespace std; int main() { string x, y; cin >> x >> y...
// Author : Mohamed sameh #include <bits/stdc++.h> typedef long long ll; #define pb push_back #define f first #define s second #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define SZ(a) (int)a.size() #define Flush fflush(stdout); using namespace std; int main() { string x, y; cin >> x >> y...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
156
#include <bits/stdc++.h> typedef long long ll; using namespace std; #define _overload(_1, _2, _3, name, ...) name #define _rep(i, n) for (ll i = 0; i < (ll)n; i++) #define _repi(i, s, n) for (ll i = (ll)(s); i < (ll)n; i++) #define REP(...) _overload(__VA_ARGS__, _repi, _rep, )(__VA_ARGS__) #define all(v) (v).begin()...
#include <bits/stdc++.h> typedef long long ll; using namespace std; #define _overload(_1, _2, _3, name, ...) name #define _rep(i, n) for (ll i = 0; i < (ll)n; i++) #define _repi(i, s, n) for (ll i = (ll)(s); i < (ll)n; i++) #define REP(...) _overload(__VA_ARGS__, _repi, _rep, )(__VA_ARGS__) #define all(v) (v).begin()...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
160
#define rep(i, n) for (int i = 0; i < n; i++) #include "bits/stdc++.h" using namespace std; using ll = long long; using P = pair<int, int>; int main() { string s, t; cin >> s >> t; int ans = 1000; int len_s = s.length(); int len_t = t.length(); rep(i, len_s - len_t) { int diff = 0; rep(j, len_t) { ...
#define rep(i, n) for (int i = 0; i < n; i++) #include "bits/stdc++.h" using namespace std; using ll = long long; using P = pair<int, int>; int main() { string s, t; cin >> s >> t; int ans = 1000; int len_s = s.length(); int len_t = t.length(); rep(i, len_s - len_t + 1) { int diff = 0; rep(j, len_t...
[["+", 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() ans = 1000 for i in range(len(S)-len(T)): s = S[i:i+len(T)] n = 0 for j in range(len(s)): ss = s[j] if T[j] != ss: n += 1 ans = min(ans,n) print(ans)
S = input() T = input() ans = 1000 for i in range(len(S)-len(T)+1): s = S[i:i+len(T)] n = 0 for j in range(len(s)): ss = s[j] if T[j] != ss: n += 1 ans = min(ans,n) print(ans)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
85
#include <bits/stdc++.h> #define rep(i, n) for (long long i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<ll, ll>; using vec = vector<ll>; using vecp = vector<P>; using mat = vector<vec>; using matp = vector<vecp>; const ll MOD = 1e9 + 7; const ll INF = 1e18; #define all(v) v.begin(), v.e...
#include <bits/stdc++.h> #define rep(i, n) for (long long i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<ll, ll>; using vec = vector<ll>; using vecp = vector<P>; using mat = vector<vec>; using matp = vector<vecp>; const ll MOD = 1e9 + 7; const ll INF = 1e18; #define all(v) v.begin(), v.e...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
182
#include <bits/stdc++.h> using ll = long long; using ull = unsigned long long; using namespace std; constexpr int inf = 1 << 30; constexpr int mo = 1e9 + 7; constexpr ll infl = 1ll << 60; int dp[1005][1005]; bool visi[1005][1005]; string f[1005]; int main() { cin.tie(nullptr); std::ios::sync_with_stdio(false); ...
#include <bits/stdc++.h> using ll = long long; using ull = unsigned long long; using namespace std; constexpr int inf = 1 << 30; constexpr int mo = 1e9 + 7; constexpr ll infl = 1ll << 60; int dp[1005][1005]; bool visi[1005][1005]; string f[1005]; int main() { cin.tie(nullptr); std::ios::sync_with_stdio(false); ...
[["+", 8, 9, 0, 7, 15, 16, 31, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 31, 16, 12, 13]]
1
203
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { string s, t; cin >> s >> t; int res = 1e6; for (int i = 0; i < s.size() - t.size(); i++) { int cur = 0; for (int j = 0; j < t.size(); j++) { if (s[i + j] != t[j]) cur++; } res = min(res, cur); } ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { string s, t; cin >> s >> t; int res = 1e6; for (int i = 0; i <= s.size() - t.size(); i++) { int cur = 0; for (int j = 0; j < t.size(); j++) { if (s[i + j] != t[j]) cur++; } res = min(res, cur); } ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
118
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; using vint = vector<int>; using vvint = vector<vint>; using vll = vector<ll>; using vvll = vector<vll>; using vchar = vector<char>; using vvchar = vector<vchar>; using vp = vector<P>; using vpp = vector<pair<P, P>>; using vvp ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<int, int>; using vint = vector<int>; using vvint = vector<vint>; using vll = vector<ll>; using vvll = vector<vll>; using vchar = vector<char>; using vvchar = vector<vchar>; using vp = vector<P>; using vpp = vector<pair<P, P>>; using vvp ...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
363
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int ans = 1e9; for (int i = 0; i < s.size() - t.size(); i++) { int res = 0; for (int j = 0; j < t.size(); j++) res += s[i + j] != t[j]; ans = min(ans, res); } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int ans = 1e9; for (int i = 0; i <= s.size() - t.size(); i++) { int res = 0; for (int j = 0; j < t.size(); j++) res += s[i + j] != t[j]; ans = min(ans, res); } cout << ans << endl; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
106
package main import ( "bufio" "fmt" "os" "strconv" ) var sc = bufio.NewScanner(os.Stdin) func Scan() string { sc.Scan() return sc.Text() } func iScan() int { n, _ := strconv.Atoi(Scan()) return n } func fScan() float64 { n, _ := strconv.ParseFloat(Scan(), 64) return n } func stringToInt(s string) int { n,...
package main import ( "bufio" "fmt" "os" "strconv" ) var sc = bufio.NewScanner(os.Stdin) func Scan() string { sc.Scan() return sc.Text() } func iScan() int { n, _ := strconv.Atoi(Scan()) return n } func fScan() float64 { n, _ := strconv.ParseFloat(Scan(), 64) return n } func stringToInt(s string) int { n,...
[["+", 0, 7, 0, 430, 15, 16, 12, 16, 17, 72], ["+", 0, 7, 0, 430, 15, 16, 12, 16, 12, 433]]
7
634
#include <bits/stdc++.h> using namespace std; int main() { string S, T; cin >> S >> T; int answer = numeric_limits<int>::max(); for (int i = 0; i < S.length() - T.length(); i++) { int diff = 0; for (int j = 0; j < T.length(); j++) { if (S[i + j] != T[j]) diff++; } answer = min(an...
#include <bits/stdc++.h> using namespace std; int main() { string S, T; cin >> S >> T; int answer = numeric_limits<int>::max(); for (int i = 0; i <= S.length() - T.length(); i++) { int diff = 0; for (int j = 0; j < T.length(); j++) { if (S[i + j] != T[j]) diff++; } answer = min(a...
[["-", 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> using namespace std; typedef long long ll; typedef unsigned long long ull; #define pb push_back #define f(i, n) for (int i = 0; i < n; ++i) #define fi(i, st, n) for (int i = st; i <= n; ++i) #define veci vector<int> #define vecp vector<pair<int, int>> #define vecl vector<ll> int prime[100000 + ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define pb push_back #define f(i, n) for (int i = 0; i < n; ++i) #define fi(i, st, n) for (int i = st; i <= n; ++i) #define veci vector<int> #define vecp vector<pair<int, int>> #define vecl vector<ll> int prime[100000 + ...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
417
#include <bits/stdc++.h> int main() { using namespace std; string S, T; cin >> S >> T; unsigned long ans{numeric_limits<unsigned long>::max()}; for (unsigned long i{0}; i + size(T) < size(S); ++i) ans = min(ans, inner_product(begin(T), end(T), begin(S) + i, 0UL, plus<>(), ...
#include <bits/stdc++.h> int main() { using namespace std; string S, T; cin >> S >> T; unsigned long ans{numeric_limits<unsigned long>::max()}; for (unsigned long i{0}; i + size(T) <= size(S); ++i) ans = min(ans, inner_product(begin(T), end(T), begin(S) + i, 0UL, plus<>(), ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
123
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define INF 1LL << 62 #define inf 1000000007 int main() { string s, t; cin >> s >> t; ll ans = inf; for (ll i = 0; i < s.size() - t.size(); i++) { ll cnt = 0; for (ll j = 0; j < t.size(); j++) { if (s[i + j] != t[j]) { cn...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define INF 1LL << 62 #define inf 1000000007 int main() { string s, t; cin >> s >> t; ll ans = inf; for (ll i = 0; i < s.size() - t.size() + 1; i++) { ll cnt = 0; for (ll j = 0; j < t.size(); 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
126
#define _overload(_1, _2, _3, _4, name, ...) name #define _rep1(Itr, N) _rep3(Itr, 0, N, 1) #define _rep2(Itr, a, b) _rep3(Itr, a, b, 1) #define _rep3(Itr, a, b, step) for (llong(Itr) = a; (Itr) < b; (Itr) += step) #define repeat(...) _overload(__VA_ARGS__, _rep3, _rep2, _rep1)(__VA_ARGS__) #include <iostream> #includ...
#define _overload(_1, _2, _3, _4, name, ...) name #define _rep1(Itr, N) _rep3(Itr, 0, N, 1) #define _rep2(Itr, a, b) _rep3(Itr, a, b, 1) #define _rep3(Itr, a, b, step) for (llong(Itr) = a; (Itr) < b; (Itr) += step) #define repeat(...) _overload(__VA_ARGS__, _rep3, _rep2, _rep1)(__VA_ARGS__) #include <iostream> #includ...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
168
#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <algorithm> #include <iostream> #include <string> using namespace std; using i32 = int_fast32_t; using i64 = int_fast64_t; #define rep(i, n) for (i32 i = 0; i < (i32)(n); i++) #define all(a) (a).begin(), (a).end() #defin...
#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <algorithm> #include <iostream> #include <string> using namespace std; using i32 = int_fast32_t; using i64 = int_fast64_t; #define rep(i, n) for (i32 i = 0; i < (i32)(n); i++) #define all(a) (a).begin(), (a).end() #defin...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
178
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vll; typedef vector<vll> vvll; typedef pair<ll, ll> P; typedef string str; typedef vector<P> vp; typedef vector<string> vs; typedef vector<bool> vb; const ll mod = 1e9; const ll inf = 1e16; #define rep(i, m, n) for (ll i = m; i <...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vll; typedef vector<vll> vvll; typedef pair<ll, ll> P; typedef string str; typedef vector<P> vp; typedef vector<string> vs; typedef vector<bool> vb; const ll mod = 1e9; const ll inf = 1e16; #define rep(i, m, n) for (ll i = m; i <...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 22], ["+", 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]]
1
271
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); string s, t; cin >> s >> t; int n = s.size(); int ans = 1e9; for (int i = 0; i + t.size() < n; ++i) { int cnt = 0; for (int j = 0; j < t.size(); ++j) { if (s[i + j] != t[j]) { ...
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); string s, t; cin >> s >> t; int n = s.size(); int ans = 1e9; for (int i = 0; i + t.size() <= n; ++i) { int cnt = 0; for (int j = 0; j < t.size(); ++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
137
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using P = pair<ll, ll>; using Pld = pair<ld, ld>; using Vec = vector<ll>; using VecP = vector<P>; using VecB = vector<bool>; using VecC = vector<char>; using VecD = vector<ld>; using VecS = vector<string>; template <class T> usi...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using P = pair<ll, ll>; using Pld = pair<ld, ld>; using Vec = vector<ll>; using VecP = vector<P>; using VecB = vector<bool>; using VecC = vector<char>; using VecD = vector<ld>; using VecS = vector<string>; template <class T> usi...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
564
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <complex> #include <cstring> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limit...
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <complex> #include <cstring> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limit...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
625
#include <algorithm> #include <cmath> #include <deque> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stdio.h> #include <vector> using namespace std; #define int long long #define rep(s, i, n) for (int i = s; i < n; i++) #define c(n) cout << n << endl; #define ic(n) ...
#include <algorithm> #include <cmath> #include <deque> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stdio.h> #include <vector> using namespace std; #define int long long #define rep(s, i, n) for (int i = s; i < n; i++) #define c(n) cout << n << endl; #define ic(n) ...
[["+", 0, 42, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 42, 0, 2, 3, 4, 0, 16, 12, 13]]
1
1,923
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define Rep(i, n) for (int i = 1; i <= n; i++) #define sz(x) int(x.size()) #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define YesorNo(a) printf(a ? "Yes\n" : "No\n") #define endl '\n' #define fi firs...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define Rep(i, n) for (int i = 1; i <= n; i++) #define sz(x) int(x.size()) #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define YesorNo(a) printf(a ? "Yes\n" : "No\n") #define endl '\n' #define fi firs...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
367
#include <bits/stdc++.h> #define all(v) v.begin(), v.end() #define x first #define y second #define PQ priority_queue #define pb push_back #define fu(i, a, j) for (int i = a; i < j; i++) #define fd(i, a, j) for (int i = a; i >= j; i--) #define SYNC ios::sync_with_stdio(0), cin.tie(NULL), cout.tie(NULL) #define MOD 1000...
#include <bits/stdc++.h> #define all(v) v.begin(), v.end() #define x first #define y second #define PQ priority_queue #define pb push_back #define fu(i, a, j) for (int i = a; i < j; i++) #define fd(i, a, j) for (int i = a; i >= j; i--) #define SYNC ios::sync_with_stdio(0), cin.tie(NULL), cout.tie(NULL) #define MOD 1000...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
500
# import sys # import math #sqrt,gcd,pi # import decimal import queue # queue # import bisect # import heapq # priolity-queue # import time # from itertools import product,permutations,\ # combinations,combinations_with_replacement # 重複あり順列、順列、組み合わせ、重複あり組み合わせ # import collections # deque # from operator import item...
# import sys # import math #sqrt,gcd,pi # import decimal import queue # queue # import bisect # import heapq # priolity-queue # import time # from itertools import product,permutations,\ # combinations,combinations_with_replacement # 重複あり順列、順列、組み合わせ、重複あり組み合わせ # import collections # deque # from operator import item...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
138
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> pll; typedef pair<int, int> pii; #define fi first #define se second #define endl '\n' #define y1 holyshit #define all(x) x.begin(), x.end() const int inf = 0x3f3f3f3f; int main() { ios_base::sync_with_stdio(0); cin.tie(0); s...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> pll; typedef pair<int, int> pii; #define fi first #define se second #define endl '\n' #define y1 holyshit #define all(x) x.begin(), x.end() const int inf = 0x3f3f3f3f; int main() { ios_base::sync_with_stdio(0); cin.tie(0); s...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
171
#define LOCAL #undef _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(false); \ cin.tie(0) #define all(x) x.begin(), x.end() #define ff first #define s...
#define LOCAL #undef _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(false); \ cin.tie(0) #define all(x) x.begin(), x.end() #define ff first #define s...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
916
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() using namespace std; typedef long long ll; const int MOD = 1e9 + 7; int main() { string s, t; cin >> s >> t; 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 (s[i + j]...
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() using namespace std; typedef long long ll; const int MOD = 1e9 + 7; int main() { string s, t; cin >> s >> t; 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 (s[i + j...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
133
#include <bits/stdc++.h> #define all(vec) vec.begin(), vec.end() #define pb push_back #define eb emplace_back #define fi first #define se second using namespace std; using ll = long long; using P = pair<ll, ll>; template <class T> using V = vector<T>; template <class T> inline void chmin(T &a, const T &b) { a = min(a, ...
#include <bits/stdc++.h> #define all(vec) vec.begin(), vec.end() #define pb push_back #define eb emplace_back #define fi first #define se second using namespace std; using ll = long long; using P = pair<ll, ll>; template <class T> using V = vector<T>; template <class T> inline void chmin(T &a, const T &b) { a = min(a, ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
673
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> Pii; typedef pair<int, ll> Pil; typedef pair<ll, ll> Pll; typedef pair<ll, int> Pli; typedef vector<vector<ll>> Mat; #define fi first #define se second const ll MOD = 1e9 + 7; const ll MOD2 = 998244353...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> Pii; typedef pair<int, ll> Pil; typedef pair<ll, ll> Pll; typedef pair<ll, int> Pli; typedef vector<vector<ll>> Mat; #define fi first #define se second const ll MOD = 1e9 + 7; const ll MOD2 = 998244353...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
304
#pragma GCC target("avx2") #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> #define int long long #define double long double #define x first #define y second #define pb push_back #define mp make_pair #define xx exit(0) #define yy cout << "Yes\n" #define nn cout << "No\n" #defi...
#pragma GCC target("avx2") #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> #define int long long #define double long double #define x first #define y second #define pb push_back #define mp make_pair #define xx exit(0) #define yy cout << "Yes\n" #define nn cout << "No\n" #defi...
[["-", 51, 2, 3, 4, 0, 2, 3, 4, 0, 13], ["+", 51, 2, 3, 4, 0, 2, 3, 4, 0, 22]]
1
258
#include <bits/stdc++.h> using namespace std; int main() { string S, T; cin >> S >> T; int64_t ans = LLONG_MAX; for (int64_t i = 0; i < S.size() - T.size(); i++) { int64_t curr_ans = 0; for (int64_t j = 0; j < T.size(); j++) { if (T[j] != S[i + j]) { curr_ans++; } } ans = m...
#include <bits/stdc++.h> using namespace std; int main() { string S, T; cin >> S >> T; int64_t ans = LLONG_MAX; for (int64_t i = 0; i <= S.size() - T.size(); i++) { int64_t curr_ans = 0; for (int64_t j = 0; j < T.size(); j++) { if (T[j] != S[i + j]) { curr_ans++; } } ans = ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
113
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define all(x) x.begin(), x.end() #define fi first #define se second...
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> #define all(x) x.begin(), x.end() #define fi first #define se second...
[["-", 31, 16, 12, 16, 12, 2, 63, 118, 28, 22], ["+", 31, 16, 12, 16, 12, 2, 63, 118, 28, 22]]
1
276
#include <algorithm> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <string> #include <vector> #define PI 3.14159265359 typedef long long ll; const int MOD = 1e9 + 7; const ll LLINF = 7e18; using namespace std; int main() { string s...
#include <algorithm> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <string> #include <vector> #define PI 3.14159265359 typedef long long ll; const int MOD = 1e9 + 7; const ll LLINF = 7e18; using namespace std; int main() { string s...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
156
#define _USE_MATH_DEFINES #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define reps(i, n) for (int i = 1; i <= (n); ++i) #define repd(i, n) for (int i = (n)-1; i >= 0; --i) #define repds(i, n) for (int i = (n); i > 0; --i) #define loop(i, x, n) for (int i = (x); i < (n); ++i) #define loops(...
#define _USE_MATH_DEFINES #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define reps(i, n) for (int i = 1; i <= (n); ++i) #define repd(i, n) for (int i = (n)-1; i >= 0; --i) #define repds(i, n) for (int i = (n); i > 0; --i) #define loop(i, x, n) for (int i = (x); i < (n); ++i) #define loops(...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
729
# -*- coding: utf-8 -*- ############# # Libraries # ############# import sys input = sys.stdin.readline import math #from math import gcd import bisect import heapq from collections import defaultdict from collections import deque from collections import Counter from functools import lru_cache ############# # Const...
# -*- coding: utf-8 -*- ############# # Libraries # ############# import sys input = sys.stdin.readline import math #from math import gcd import bisect import heapq from collections import defaultdict from collections import deque from collections import Counter from functools import lru_cache ############# # Const...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
1,019
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); ++i) #define FOR(i, a, b) \ for (long long i = (a); ((a) < (b) ? i <= (b) : i >= (b)); \ ((a) < (b) ? ++i : --i)) #define SZ(v) ((int)(v).size()) #define ALL(v) (v).be...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); ++i) #define FOR(i, a, b) \ for (long long i = (a); ((a) < (b) ? i <= (b) : i >= (b)); \ ((a) < (b) ? ++i : --i)) #define SZ(v) ((int)(v).size()) #define ALL(v) (v).be...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
255
/* 17/10/2017 */ #include <bits/stdc++.h> #define ll long long #define mod 1000000007 using namespace std; int main() { string s, t; cin >> s >> t; int ans = mod; for (int i = 0; i + t.length() < s.length(); i++) { int cnt = 0; for (int o = 0; o < t.length(); o++) { if (s[o + i] != t[o]) { ...
/* 17/10/2017 */ #include <bits/stdc++.h> #define ll long long #define mod 1000000007 using namespace std; int main() { string s, t; cin >> s >> t; int ans = mod; for (int i = 0; i + t.length() <= s.length(); i++) { int cnt = 0; for (int o = 0; o < t.length(); o++) { if (s[o + i] != t[o]) { ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
118
S = input() T = input() n = len(S) m = len(T) res = n + 1 for i in range(n - m): cnt = 0 for j in range(m): cnt += int(S[i + j] != T[j]) res = min(res, cnt) print(res)
S = input() T = input() n = len(S) m = len(T) res = n + 1 for i in range(n - m + 1): cnt = 0 for j in range(m): cnt += int(S[i + j] != T[j]) res = min(res, cnt) print(res)
[["+", 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 For(i, a, b) for (int(i) = (int)(a); (i) < (int)(b); ++(i)) #define rFor(i, a, b) for (int(i) = (int)(a)-1; (i) >= (int)(b); --(i)) #define rep(i, n) For((i), 0, (n)) #define rrep(i, n) rFor((i), (n), 0) #define fi first #define se second using namespace std; typedef long long lint; typ...
#include <bits/stdc++.h> #define For(i, a, b) for (int(i) = (int)(a); (i) < (int)(b); ++(i)) #define rFor(i, a, b) for (int(i) = (int)(a)-1; (i) >= (int)(b); --(i)) #define rep(i, n) For((i), 0, (n)) #define rrep(i, n) rFor((i), (n), 0) #define fi first #define se second using namespace std; typedef long long lint; typ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
370
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define rep2(i, a, n) for (int i = a; i < n; i++) #define been(ix) (ix).begin(), (ix).end() using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<long long> vl; const ll INFL = 1e18; const int INF = 1001001001; typedef pa...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define rep2(i, a, n) for (int i = a; i < n; i++) #define been(ix) (ix).begin(), (ix).end() using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<long long> vl; const ll INFL = 1e18; const int INF = 1001001001; typedef pa...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
193
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <complex> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits.h> #include <map> #include <math.h> #include <numeric> #include <queue> #include <random> #...
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <complex> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <limits.h> #include <map> #include <math.h> #include <numeric> #include <queue> #include <random> #...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
1,593
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; int main() { string s, t; cin >> s >> t; int tt = t.size(), ss = s.size(); int...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; int main() { string s, t; cin >> s >> t; int tt = t.size(), ss = s.size(); int...
[["+", 8, 9, 0, 7, 15, 16, 31, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 31, 16, 12, 13]]
1
138
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define rrep(i, n) for (int i = n - 1; i >= 0; i--) using namespace std; #define INF ((1 << 30) - 1) #define LINF (1LL << 60) #define EPS (1e-10) typedef long long ll; typedef pair<ll, ll> P; const int MOD = 1000000007; const int MOD2 = 998244353; ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define rrep(i, n) for (int i = n - 1; i >= 0; i--) using namespace std; #define INF ((1 << 30) - 1) #define LINF (1LL << 60) #define EPS (1e-10) typedef long long ll; typedef pair<ll, ll> P; const int MOD = 1000000007; const int MOD2 = 998244353; ...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
156
/* Username : moondancer Name : Moon Dancer */ #include <bits/stdc++.h> using namespace std; #define int long long signed main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); string s, t; cin >> t >> s; int ans = 1e9; for (int i = 0; i < t.size() - s.size(); ++i) { int ss = 0; int k...
/* Username : moondancer Name : Moon Dancer */ #include <bits/stdc++.h> using namespace std; #define int long long signed main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); string s, t; cin >> t >> s; int ans = 1e9; for (int i = 0; i <= t.size() - s.size(); ++i) { int ss = 0; int ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
143
''' 自宅用PCでの解答 ''' import math #import numpy as np import itertools import queue import bisect from collections import deque,defaultdict import heapq as hpq from sys import stdin,setrecursionlimit #from scipy.sparse.csgraph import dijkstra #from scipy.sparse import csr_matrix ipt = stdin.readline setrecursionlimit(10**7...
''' 自宅用PCでの解答 ''' import math #import numpy as np import itertools import queue import bisect from collections import deque,defaultdict import heapq as hpq from sys import stdin,setrecursionlimit #from scipy.sparse.csgraph import dijkstra #from scipy.sparse import csr_matrix ipt = stdin.readline setrecursionlimit(10**7...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
176
#pragma GCC optimize("O3") #pragma GCC target("sse4") #include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <list> #include <map> #include <q...
#pragma GCC optimize("O3") #pragma GCC target("sse4") #include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <list> #include <map> #include <q...
[["-", 8, 9, 0, 9, 0, 7, 15, 16, 17, 18], ["+", 8, 9, 0, 9, 0, 7, 15, 16, 17, 19]]
1
402
#include <bits/stdc++.h> #define _for(i, a, b) for (int i = (a); i < (b); i++) #define _count(i, a, b) for (int i = (a); i <= b; i++) #define PB emplace_back #define MINI -2147483648 #define MAXI 2147483647 #define MAXLL 9223372036854775807 #define MINLL -9223372036854775808 #define VI vector<int> #define VB vector<boo...
#include <bits/stdc++.h> #define _for(i, a, b) for (int i = (a); i < (b); i++) #define _count(i, a, b) for (int i = (a); i <= b; i++) #define PB emplace_back #define MINI -2147483648 #define MAXI 2147483647 #define MAXLL 9223372036854775807 #define MINLL -9223372036854775808 #define VI vector<int> #define VB vector<boo...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
362
#include <bits/stdc++.h> using namespace std; typedef long long int lli; int main() { ios_base::sync_with_stdio(false); string s, t; cin >> s >> t; int m = -1; for (int i = 0; i < s.length() - t.length(); i++) { int counter = 0; for (int j = 0; j < t.length(); j++) { if (t[j] == s[i + j]) { ...
#include <bits/stdc++.h> using namespace std; typedef long long int lli; int main() { ios_base::sync_with_stdio(false); string s, t; cin >> s >> t; int m = -1; for (int i = 0; i <= s.length() - t.length(); i++) { int counter = 0; for (int j = 0; j < t.length(); j++) { if (t[j] == s[i + j]) { ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
130
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { string s, t; cin >> s; cin >> t; int mini = INT_MAX; for (int i = 0; i < s.length() - t.length(); i++) { int count = 0; for (int j = i; j < i + t.length(); j++) { if (s[j] != t[j - i]) count++; } ...
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { string s, t; cin >> s; cin >> t; int mini = INT_MAX; for (int i = 0; i <= (s.length() - t.length()); i++) { int count = 0; for (int j = i; j < i + t.length(); j++) { if (s[j] != t[j - i]) count++; } ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 8, 9, 0, 7, 15, 16, 12, 23, 0, 24], ["+", 12, 23, 0, 16, 12, 2, 3, 4, 0, 25]]
1
119
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String str1[] = br.readLine().split(""); String str2[] =...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String str1[] = br.readLine().split(""); String str2[] =...
[["+", 8, 196, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 196, 0, 7, 15, 16, 12, 16, 12, 499]]
3
185
#include <bits/stdc++.h> using namespace std; int calc(string a, string b) { int ans = 0; for (int i = 0; i < a.length(); i++) { if (a[i] == b[i]) ans++; } return ans; } int main() { string s, t; cin >> s >> t; int MAX = -1, tmp; for (int i = 0; i < s.length() - t.length(); i++) { tmp = ...
#include <bits/stdc++.h> using namespace std; int calc(string a, string b) { int ans = 0; for (int i = 0; i < a.length(); i++) { if (a[i] == b[i]) ans++; } return ans; } int main() { string s, t; cin >> s >> t; int MAX = -1, tmp; for (int i = 0; i < s.length() - t.length() + 1; i++) { tm...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
154
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; typedef long long int lli; typedef unsigned long long int ulli; typedef long double ld; #define vec(s) vector<s> #define vvec(s) vector<vector<s>> typedef vector<lli> vi; typedef vector<vi> vvi; typedef pair<lli, lli> pii; #define rep(i, n) for (int i...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; typedef long long int lli; typedef unsigned long long int ulli; typedef long double ld; #define vec(s) vector<s> #define vvec(s) vector<vector<s>> typedef vector<lli> vi; typedef vector<vi> vvi; typedef pair<lli, lli> pii; #define rep(i, n) for (int i...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
262
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> #define inf 0x3f3f3f3f using namespace std; typedef unsigned long long ull; typedef long...
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> #define inf 0x3f3f3f3f using namespace std; typedef unsigned long long ull; typedef long...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
183
#include <bits/stdc++.h> #define MSET(x, y) memset(x, y, sizeof(x)) #define F first #define S second #define MP make_pair #define PB push_back #define SZ size() #define M 100005 #define ll long long #define ld long double #define INF 1e18 #define endl "\n" #define fastio ...
#include <bits/stdc++.h> #define MSET(x, y) memset(x, y, sizeof(x)) #define F first #define S second #define MP make_pair #define PB push_back #define SZ size() #define M 100005 #define ll long long #define ld long double #define INF 1e18 #define endl "\n" #define fastio ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
165
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define mk make_pair #define pb push_back typedef long long lld; typedef pair<lld, lld> pr; typedef priority_queue<lld> max_heap; typedef priority_queue<lld, vector<l...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define mk make_pair #define pb push_back typedef long long lld; typedef pair<lld, lld> pr; typedef priority_queue<lld> max_heap; typedef priority_queue<lld, vector<l...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 22], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 22], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22]]
1
505
#include <algorithm> #include <iostream> #include <string> using namespace std; string S, T; int main() { cin >> S >> T; int ans = (int)T.size(); for (unsigned int i = 0; i < S.size() - T.size(); i++) { int now = 0; for (unsigned int j = 0; j < T.size(); j++) { if (S[i + j] != T[j]) { now...
#include <algorithm> #include <iostream> #include <string> using namespace std; string S, T; int main() { cin >> S >> T; int ans = (int)T.size(); for (unsigned int i = 0; i <= S.size() - T.size(); i++) { int now = 0; for (unsigned int j = 0; j < T.size(); j++) { if (S[i + j] != T[j]) { no...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
126
S = input() T = input() ans = 10000 for i in range(len(S)-len(T)): tmp = 0 for j in range(len(T)): if(S[i+j] != T[j]): tmp += 1 if tmp < ans: ans = tmp print(ans)
S = input() T = input() ans = 10000 for i in range(len(S)-len(T)+1): tmp = 0 for j in range(len(T)): if(S[i+j] != T[j]): tmp += 1 if tmp < ans: 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
73
S = input() T = input() ans = float('inf') for i in range(len(S)-len(T)): st = S[i:len(T)+i] count = 0 for j in range(len(T)): if st[j]!=T[j]: count+=1 ans = min(ans,count) print(ans)
S = input() T = input() ans = float('inf') for i in range(len(S)-len(T)+1): st = S[i:len(T)+i] count = 0 for j in range(len(T)): if st[j]!=T[j]: count+=1 ans = min(ans,count) print(ans)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
87
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "dump.hpp" #else #define dump(...) #define dumpv(...) #endif #define rep(i, n) for (int i = 0; i < (n); i++) #define mins(x, y) (x = min(x, y)) #define maxs(x, y) (x = max(x, y)) using ll = long long; using vi = vector<int>; using vl = vector<ll>; us...
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "dump.hpp" #else #define dump(...) #define dumpv(...) #endif #define rep(i, n) for (int i = 0; i < (n); i++) #define mins(x, y) (x = min(x, y)) #define maxs(x, y) (x = max(x, y)) using ll = long long; using vi = vector<int>; using vl = vector<ll>; us...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
285
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (ll i = 0; i < n; i++) #define repl(i, l, r) for (ll i = (l); i < (r); i++) #define per(i, n) for (ll i = n - 1; i >= 0; i--) #define perl(i, r, l) for (ll i = r - 1; i >= l; i--) #define fi first #define se second #define pb push_back #define ins inse...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (ll i = 0; i < n; i++) #define repl(i, l, r) for (ll i = (l); i < (r); i++) #define per(i, n) for (ll i = n - 1; i >= 0; i--) #define perl(i, r, l) for (ll i = r - 1; i >= l; i--) #define fi first #define se second #define pb push_back #define ins inse...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
577
#include <bits/stdc++.h> using namespace std; #define FOR(i, n) for (int i = 0; i < (int)n; i++) #define PB push_back #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define F first #define S second typedef long long ll; typedef vector<int> vi; typedef pair<int, int> pii; int main() { ios::...
#include <bits/stdc++.h> using namespace std; #define FOR(i, n) for (int i = 0; i < (int)n; i++) #define PB push_back #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define F first #define S second typedef long long ll; typedef vector<int> vi; typedef pair<int, int> pii; int main() { ios::...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 7, 8, 9, 0, 7, 8, 9, 0, 45], ["+", 0, 7, 8, 9, 0, 7, 8, 9, 0, 46]]
1
178
# B S=input() T=input() def check(i,T): ns=S[i:i+len(T)] res=0 for i in range(len(T)): if ns[i]!=T[i]: res+=1 return res print(min([check(i,T) for i in range(len(S)-len(T))]))
# B S=input() T=input() def check(i,T): ns=S[i:i+len(T)] res=0 for i in range(len(T)): if ns[i]!=T[i]: res+=1 return res print(min([check(i,T) for i in range(len(S)-len(T)+1)]))
[["+", 0, 659, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 659, 12, 652, 3, 4, 0, 657, 12, 612]]
5
91
#include <bits/stdc++.h> #define ll long long #define pb push_back #define pii pair<int, int> #define vi vector<int> #define vii vector<pii> #define mi map<int, int> #define mii map<pii, int> #define endl '\n' #define hell 1000000007 #define rep(i, a, b) for (int i = a; i < b; i++) #define repr(i, a, b) for (int i = a;...
#include <bits/stdc++.h> #define ll long long #define pb push_back #define pii pair<int, int> #define vi vector<int> #define vii vector<pii> #define mi map<int, int> #define mii map<pii, int> #define endl '\n' #define hell 1000000007 #define rep(i, a, b) for (int i = a; i < b; i++) #define repr(i, a, b) for (int i = a;...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
181
#include <bits/stdc++.h> using namespace std; #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define ll l...
#include <bits/stdc++.h> using namespace std; #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL); #define ll l...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
233
#include "bits/stdc++.h" #define ll long long int #define ld long double #define fastIO \ ios_base::sync_with_stdio(false); \ cin.tie(nullptr) #define pb push_back using namespace std; typedef pair<int, int> ...
#include "bits/stdc++.h" #define ll long long int #define ld long double #define fastIO \ ios_base::sync_with_stdio(false); \ cin.tie(nullptr) #define pb push_back using namespace std; typedef pair<int, int> ...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
145
// Author: AnandRaj doubleux #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<pii> vpii; typedef pair<ll, ll> pll; typedef vector<ll> vl; typedef vector<vl> vvl; typedef vector<pll> vpl...
// Author: AnandRaj doubleux #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<pii> vpii; typedef pair<ll, ll> pll; typedef vector<ll> vl; typedef vector<vl> vvl; typedef vector<pll> vpl...
[["-", 15, 16, 31, 16, 31, 16, 31, 16, 12, 22], ["-", 0, 7, 15, 16, 31, 16, 31, 16, 17, 33]]
1
289
#include <algorithm> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <set> #include <stack> #include <string> #include <vector> #define REP(i, n) for (int i = 0; i < n; ++i) using namespace std; using LLONG = long long; const LLONG MOD = 1000000007; ...
#include <algorithm> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <set> #include <stack> #include <string> #include <vector> #define REP(i, n) for (int i = 0; i < n; ++i) using namespace std; using LLONG = long long; const LLONG MOD = 1000000007; ...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
157
# -*- coding: utf-8 -*- S = input() T = input() max = len(S) for i in range(len(S)-len(T)+1): ans = len(T) for i,v in zip(T,S[i:i+len(T)]): if i == v: ans-=1 if ans < max: max = ans print(ans)
# -*- coding: utf-8 -*- S = input() T = input() max = len(S) for i in range(len(S)-len(T)+1): ans = len(T) for i,v in zip(T,S[i:i+len(T)]): if i == v: ans-=1 if ans < max: max = ans print(max)
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]]
5
83
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define vll vector<ll> #define vvll vector<vll> #define mll map<ll, ll> #define f(i, m, n) for (i = m; i < n; i++) #define ee endl #define pb push_back #define mp make_pair #define ff first #define ss second #define take(v, n) ...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define vll vector<ll> #define vvll vector<vll> #define mll map<ll, ll> #define f(i, m, n) for (i = m; i < n; i++) #define ee endl #define pb push_back #define mp make_pair #define ff first #define ss second #define take(v, n) ...
[["-", 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
387
s = input() t = input() ans = len(s)+1 for i in range(len(s)-len(t)): cnt = 0 for j in range(len(t)): if s[i+j]!=t[j]: cnt += 1 ans = min(ans, cnt) print(ans)
s = input() t = input() ans = len(s)+1 for i in range(len(s)-len(t)+1): cnt = 0 for j in range(len(t)): if s[i+j]!=t[j]: cnt += 1 ans = min(ans, cnt) print(ans)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
76
#line 1 "/home/parallels/kyopro/cplib/template.cpp" #include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < n; i++) #define mp make_pair #define pb push_back #define eb emplace_back #define all(x) (x).begin(), (x).end() template <class T> bool chmax(T &a, T b) { if (a < b) { a = b; ...
#line 1 "/home/parallels/kyopro/cplib/template.cpp" #include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < n; i++) #define mp make_pair #define pb push_back #define eb emplace_back #define all(x) (x).begin(), (x).end() template <class T> bool chmax(T &a, T b) { if (a < b) { a = b; ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
596
#include <bits/stdc++.h> using namespace std; #define fst first #define snd second typedef unsigned long long ull; typedef long long ll; typedef pair<int, int> pii; #define pb push_back #define for_tests(t, tt) \ int t; ...
#include <bits/stdc++.h> using namespace std; #define fst first #define snd second typedef unsigned long long ull; typedef long long ll; typedef pair<int, int> pii; #define pb push_back #define for_tests(t, tt) \ int t; ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
254
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdint> #include <cstdio> #include <ctype.h> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <unordered_map> #include <...
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdint> #include <cstdio> #include <ctype.h> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <unordered_map> #include <...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
392
#include <algorithm> #include <cstdio> #include <iostream> #include <string> #include <vector> using namespace std; #define FOR(S, X) for (int i = 0; i < X; i++) #define FOR2(S, X) for (int j = 0; j < X; j++) int main() { string s, t; int max = 0; cin >> s >> t; FOR(0, s.length() - t.length()) { int sum = 0...
#include <algorithm> #include <cstdio> #include <iostream> #include <string> #include <vector> using namespace std; #define FOR(S, X) for (int i = 0; i < X; i++) #define FOR2(S, X) for (int j = 0; j < X; j++) int main() { string s, t; int max = 0; cin >> s >> t; FOR(0, s.length() - t.length() + 1) { int sum...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
130
#include <stdio.h> #include <string.h> int main() { char s[1001], t[1001]; scanf("%s%*c%s", s, t); int slen = strlen(s), tlen = strlen(t), i, j; int min = tlen; for (i = 0; i < slen - tlen; i++) { int temp = 0; for (j = 0; j < tlen; j++) { if (s[i + j] != t[j]) temp++; } if (temp...
#include <stdio.h> #include <string.h> int main() { char s[1001], t[1001]; scanf("%s%*c%s", s, t); int slen = strlen(s), tlen = strlen(t), i, j; int min = tlen; for (i = 0; i < slen - tlen + 1; i++) { int temp = 0; for (j = 0; j < tlen; j++) { if (s[i + j] != t[j]) temp++; } if (...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
0
133
S = input() T = input() def diff_count(A,B): diff = 0 for a,b in zip(A,B): if a!=b: diff += 1 return diff ans = len(T) for i in range(len(S) - len(T)): temp = S[i:i+len(T)] diff_num = diff_count(T,temp) ans = min(diff_num,ans) print(ans)
S = input() T = input() def diff_count(A,B): diff = 0 for a,b in zip(A,B): if a!=b: diff += 1 return diff ans = len(T) for i in range(len(S) - len(T)+1): temp = S[i:i+len(T)] diff_num = diff_count(T,temp) ans = min(diff_num,ans) print(ans)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
98
#include <bits/stdc++.h> using namespace std; #define lli long long int #define llu unsigned long long int #define sa(a, n, t) \ for (int ii = 0; ii < n; ii++) \ scanf("%" #t "", &(a)[ii]) #define rep(i, n) for ...
#include <bits/stdc++.h> using namespace std; #define lli long long int #define llu unsigned long long int #define sa(a, n, t) \ for (int ii = 0; ii < n; ii++) \ scanf("%" #t "", &(a)[ii]) #define rep(i, n) for ...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
341
S = gets.chomp T = gets.chomp # $stdout = File.open(File::NULL, "w") def main t = S.length - T.length - 1 min = S.length t.times.each do |s| count = 0 T.chars.each.with_index do |c, i| if S[s + i] != c count += 1 end end if count < min min = count end end return...
S = gets.chomp T = gets.chomp # $stdout = File.open(File::NULL, "w") def main t = S.length - T.length + 1 min = S.length t.times.each do |s| count = 0 T.chars.each.with_index do |c, i| if S[s + i] != c count += 1 end end if count < min min = count end end return...
[["-", 0, 735, 8, 736, 0, 662, 12, 738, 17, 33], ["+", 0, 735, 8, 736, 0, 662, 12, 738, 17, 72]]
4
84
s = input() t = input() result = len(t) for i in range(len(s) - len(t) + 1): box = 0 for j in range(len(t)): if t[j] == s[i + j]: box += 1 if result > box : result = box print(result)
s = input() t = input() result = len(t) for i in range(len(s) - len(t) + 1): box = 0 for j in range(len(t)): if t[j] != s[i + j]: box += 1 if result > box : result = box print(result)
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 60], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 79]]
5
76
import sys def main(): S = sys.stdin.readline().rstrip() T = sys.stdin.readline().rstrip() ans = len(T) for i in range(len(S) - len(T)): cnt = 0 for j in range(len(T)): if S[i+j] != T[j]: cnt += 1 ans = min(ans, cnt) print(ans) main()
import sys def main(): S = sys.stdin.readline().rstrip() T = sys.stdin.readline().rstrip() ans = len(T) for i in range(len(S) - len(T) + 1): cnt = 0 for j in range(len(T)): if S[i+j] != T[j]: cnt += 1 ans = min(ans, cnt) print(ans) main()
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
100
#include <bits/stdc++.h> #define all(v) (v).begin(), (v).end() using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); string s, t; cin >> s >> t; int res = t.size(); for (int i = 0; i < s.size() - t.size(); ++i) { int diff = 0; for (int j = 0; j < t.size(); ++j) { ...
#include <bits/stdc++.h> #define all(v) (v).begin(), (v).end() using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); string s, t; cin >> s >> t; int res = t.size(); for (int i = 0; i <= s.size() - t.size(); ++i) { int diff = 0; for (int j = 0; j < t.size(); ++j) { ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
140
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { string S, T; cin >> S >> T; int max_cnt = 0; for (int i = 0; i < S.length() - T.length(); i++) { int cnt = 0; for (int l = 0; l < T.length(); l++) { if (S.at(i + l) == T.at(l)) { ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { string S, T; cin >> S >> T; int max_cnt = 0; for (int i = 0; i < (S.length() - T.length()) + 1; i++) { int cnt = 0; for (int l = 0; l < T.length(); l++) { if (S.at(i + l) == T.at(l)) {...
[["+", 0, 7, 15, 16, 12, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 2, 3, 4, 0, 25], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
129
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <vector> using namespace std; int main() { string s, t; cin >> s >> t; int res = s.length(); for (int i = 0; i < s.length() - t.length(); i++) { int tmp = 0; for (int j = 0; j < t.length(); j++) if (s[i + j] !=...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <vector> using namespace std; int main() { string s, t; cin >> s >> t; int res = s.length(); for (int i = 0; i < s.length() - t.length() + 1; i++) { int tmp = 0; for (int j = 0; j < t.length(); j++) if (s[i + j...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
122
def readinput(): s=input() t=input() return s,t def main(s,t): ans=len(t) for i in range(len(s)-len(t)): count=0 for j in range(len(t)): if s[i+j]!=t[j]: count+=1 ans=min(ans,count) return ans if __name__=='__main__': s,t=readinput() ...
def readinput(): s=input() t=input() return s,t def main(s,t): ans=len(t) for i in range(len(s)-len(t)+1): count=0 for j in range(len(t)): if s[i+j]!=t[j]: count+=1 ans=min(ans,count) return ans if __name__=='__main__': s,t=readinput() ...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
115
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (ll i = 0; i < ll(n); i++) int main() { string s, t; ll ans = 1e5; cin >> s >> t; rep(i, s.length() - t.length()) { ll x = 0; for (int j = i; j < i + t.length(); j++) { if (s[j] != t[j - i]) { x++; ...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (ll i = 0; i < ll(n); i++) int main() { string s, t; ll ans = 1e5; cin >> s >> t; rep(i, s.length() - t.length() + 1) { ll x = 0; for (int j = i; j < i + t.length(); j++) { if (s[j] != t[j - i]) { x++...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
125
#include <algorithm> #include <cstdio> #include <iostream> #include <numeric> #include <string> #include <utility> #include <vector> using namespace std; int main() { string s, t; cin >> s >> t; int ans = t.size(); for (int i = 0; i < s.size() - t.size(); i++) { int cnt = 0; for (int j = 0; j < t.siz...
#include <algorithm> #include <cstdio> #include <iostream> #include <numeric> #include <string> #include <utility> #include <vector> using namespace std; int main() { string s, t; cin >> s >> t; int ans = t.size(); for (int i = 0; i <= s.size() - t.size(); i++) { int cnt = 0; // printf("---\n"); ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 51, 16, 31, 69, 341, 342, 0, 16, 17, 72], ["+", 51, 16, 31, 69, 341, 342, 0, 16, 12, 22], ["-", 51, 16, 12, 69, 341, 342, 0, 16, 31, 22], ["-", 51, 16, 12, 69, 341, 342, 0, 16, 17, 72]]
1
132
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class Main { public static void main(String[] args) { long timeStart = System.nanoTime(); Utility.FastReader fr = new Utility.FastReader(); Solver solver = new Solver(fr); int t = 1...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class Main { public static void main(String[] args) { long timeStart = System.nanoTime(); Utility.FastReader fr = new Utility.FastReader(); Solver solver = new Solver(fr); int t = 1...
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]]
3
743
from math import inf S = input() T = input() best = inf for i in range(len(S)): if i + len(T) < len(S): diff = sum(1 for x, y in zip(S[i : i + len(T)], T) if x != y) best = min(diff, best) print(best)
from math import inf S = input() T = input() best = inf for i in range(len(S)): if i + len(T) <= len(S): diff = sum(1 for x, y in zip(S[i : i + len(T)], T) if x != y) best = min(diff, best) print(best)
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19]]
5
84
#include <bits/stdc++.h> using namespace std; #define int long long signed main() { string s, t; cin >> s >> t; int n = s.length(); int m = t.length(); int ans = (int)1e9; for (int i = 0; i < n; ++i) { int cost = 0; if (i + m - 1 >= n) break; for (int j = i; j < i + m; ++j) cost +...
#include <bits/stdc++.h> using namespace std; #define int long long signed main() { string s, t; cin >> s >> t; int n = s.length(); int m = t.length(); int ans = (int)1e9; for (int i = 0; i < n; ++i) { int cost = 0; if (i + m - 1 >= n) break; for (int j = 0; j < m; ++j) cost += (t...
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 22], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 31, 22], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 0, 16, 12, 69, 341, 342, 0, 16, 17, 72], ["+", 0, 16, 12, 69, 341, 342, 0, 16, 12, 22]]
1
130
s = input() t = input() len_s = len(s) len_t = len(t) ans = len_t for i in range(len_s - len_t): u = s[i: i+len_t] d = sum(0 if c1 == c2 else 1 for c1, c2 in zip(t, u)) ans = min(d, ans) print(ans)
s = input() t = input() len_s = len(s) len_t = len(t) ans = len_t for i in range(len_s - len_t + 1): u = s[i: i+len_t] d = sum(0 if c1 == c2 else 1 for c1, c2 in zip(t, u)) ans = min(d, ans) print(ans)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
80