buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
#include <bits/stdc++.h> using namespace std; int main() { string a, b; cin >> a; cin >> b; int ans = INT_MAX; for (int i = 0; i < a.length() - b.length(); i++) { int temp = 0; for (int j = 0; j < b.length(); j++) { if (a[i + j] != b[j]) temp++; } ans = min(ans, temp); } cou...
#include <bits/stdc++.h> using namespace std; int main() { string a, b; cin >> a; cin >> b; int ans = INT_MAX; for (int i = 0; i <= a.length() - b.length(); i++) { int temp = 0; for (int j = 0; j < b.length(); j++) { if (a[i + j] != b[j]) temp++; } ans = min(ans, temp); } co...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
116
// Author - Soumik Roy // Date & Time - August 29, 2020 6:04 PM // Problem name - B - Substring // Problem url - https://atcoder.jp/contests/abc177/tasks/abc177_b // Time limit - 2000 ms // Memory Limit - 1024 MB #include <bits/stdc++.h> #define ll long long int #define pb push_back #define F first #define S second #d...
// Author - Soumik Roy // Date & Time - August 29, 2020 6:04 PM // Problem name - B - Substring // Problem url - https://atcoder.jp/contests/abc177/tasks/abc177_b // Time limit - 2000 ms // Memory Limit - 1024 MB #include <bits/stdc++.h> #define ll long long int #define pb push_back #define F first #define S second #d...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
245
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pii pair<pii, pii> #define _FastIO \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pii pair<pii, pii> #define _FastIO \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
142
#include <stdio.h> int main() { char a[10000], b[10000]; scanf("%s", a); scanf("%s", b); int lena = 0; int lenb = 0; while (a[lena] != 0) lena++; while (b[lenb] != 0) lenb++; int count = 10000000; for (int i = 0; i < lena - lenb; i++) { int ans = 0; for (int j = 0; j < lenb; j++) { ...
#include <stdio.h> int main() { char a[10000], b[10000]; scanf("%s", a); scanf("%s", b); int lena = 0; int lenb = 0; while (a[lena] != 0) lena++; while (b[lenb] != 0) lenb++; int count = 10000000; for (int i = 0; i < lena - lenb + 1; i++) { int ans = 0; for (int j = 0; j < lenb; j++) {...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
0
151
#include "bits/stdc++.h" using namespace std; int main() { string s, t; cin >> s >> t; int ans, x, y; x = s.size(); y = t.size(); ans = 1000; for (int i = 0; i < x - y; i++) { int a = 0; for (int j = 0; j < y; j++) { if (s.at(i + j) != t.at(j)) a++; } ans = min(ans, a); } ...
#include "bits/stdc++.h" using namespace std; int main() { string s, t; cin >> s >> t; int ans, x, y; x = s.size(); y = t.size(); ans = 1008; for (int i = 0; i <= x - y; i++) { int a = 0; for (int j = 0; j < y; j++) { if (s.at(i + j) != t.at(j)) a++; } ans = min(ans, a); }...
[["-", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
127
#!/usr/bin/env python def main(): s = input() t = input() m = len(s) n = len(t) c_max = 0 for i in range(m-n): cnt = 0 for j in range(n): if s[i+j] == t[j]: cnt += 1 if cnt > c_max: c_max = cnt print(n - c_max) if __name__ =...
#!/usr/bin/env python def main(): s = input() + "#" t = input() m = len(s) n = len(t) c_max = 0 for i in range(m-n): cnt = 0 for j in range(n): if s[i+j] == t[j]: cnt += 1 if cnt > c_max: c_max = cnt print(n - c_max) if __na...
[["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 72], ["+", 0, 1, 0, 662, 12, 657, 12, 557, 0, 654], ["+", 0, 1, 0, 662, 12, 657, 12, 557, 0, 6], ["+", 0, 1, 0, 662, 12, 657, 12, 557, 0, 655]]
5
92
#include <stdio.h> #include <stdlib.h> int main(void) { char s[1001], t[1001]; scanf("%s %s", s, t); int len_s = strlen(s), len_t = strlen(t); int min = 100000, count = 0; for (int i = 0; i < len_s - len_t; i++) { for (int j = 0; j < len_t; j++) { if (s[i + j] != t[j]) { count++; }...
#include <stdio.h> #include <stdlib.h> int main(void) { char s[1001], t[1001]; scanf("%s %s", s, t); int len_s = strlen(s), len_t = strlen(t); int min = 100000, count = 0; for (int i = 0; i < len_s - len_t + 1; i++) { for (int j = 0; j < len_t; j++) { if (s[i + j] != t[j]) { count++; ...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
0
139
#include <bits/stdc++.h> using namespace std; string s, t; int main() { ios_base::sync_with_stdio(false); cin.tie(0), cout.tie(0); cin >> s >> t; int wynik = 0, mini = 1000 * 1000 + 10; for (int i = 0; i <= s.size() - t.size() + 1; i++) { wynik = 0; for (int j = i; j < i + t.size(); j++) wynik +...
#include <bits/stdc++.h> using namespace std; string s, t; int main() { ios_base::sync_with_stdio(false); cin.tie(0), cout.tie(0); cin >> s >> t; int wynik = 0, mini = 1000 * 1000 + 10; for (int i = 0; i < s.size() - t.size() + 1; i++) { wynik = 0; for (int j = i; j < i + t.size(); j++) wynik +=...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18]]
1
142
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int dy[] = {1, 0, -1, 0}; int dx[] = {0, 1, 0, -1}; const ll INF = 1e18; int main() { string a, b; int cnt = 0, ma = 0; cin >> a >> b; rep(i, a.size() - b.size()) { ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int dy[] = {1, 0, -1, 0}; int dx[] = {0, 1, 0, -1}; const ll INF = 1e18; int main() { string a, b; int cnt = 0, ma = 0; cin >> a >> b; rep(i, a.size() - b.size() + 1) { ...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
168
#include <algorithm> #include <bitset> #include <cmath> #include <functional> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; #define INF pow(10, 9) // typedef priority_queu...
#include <algorithm> #include <bitset> #include <cmath> #include <functional> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; #define INF pow(10, 9) // typedef priority_queu...
[["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]]
1
160
#include <bits/stdc++.h> //#define DEBUG #define REP(i, nn) for (int i = 0; i < (int)nn; i++) #define deb(x) std::cout << #x << " " << x << endl; using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; template <typename... T> void read(T &...a) { ((cin >> a), ...); } template <typenam...
#include <bits/stdc++.h> //#define DEBUG #define REP(i, nn) for (int i = 0; i < (int)nn; i++) #define deb(x) std::cout << #x << " " << x << endl; using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; template <typename... T> void read(T &...a) { ((cin >> a), ...); } template <typenam...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
266
#include <bits/stdc++.h> using namespace std; #define ll long long #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) for (int i = (0); i < (n); ++i) #define ALL(obj) (obj).begin(), (obj).end() #define DEBUG(val) cout << #val << " : " << val << endl #define MOD 1000000007 int main() { string s, t...
#include <bits/stdc++.h> using namespace std; #define ll long long #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) for (int i = (0); i < (n); ++i) #define ALL(obj) (obj).begin(), (obj).end() #define DEBUG(val) cout << #val << " : " << val << endl #define MOD 1000000007 int main() { string s, t...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
135
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define ll long long #define fi first #define se second #define fast_io \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define ll long long #define fi first #define se second #define fast_io \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
163
// BELIEVE IN YOURSELF // next_permutation #include <bits/stdc++.h> #define ll long long int #define ld long double #define pb push_back #define pob pop_back #define vi vector<ll> #define mp make_pair #define rep1(i, n) for (ll i = 1; i <= n; i++) #define rep(i, n) for (ll i = 0; i < n; i++) #define fast ...
// BELIEVE IN YOURSELF // next_permutation #include <bits/stdc++.h> #define ll long long int #define ld long double #define pb push_back #define pob pop_back #define vi vector<ll> #define mp make_pair #define rep1(i, n) for (ll i = 1; i <= n; i++) #define rep(i, n) for (ll i = 0; i < n; i++) #define fast ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
245
#include <bits/stdc++.h> #define mp make_pair #define fi first #define se second #define VAL 100000 #define ll long long #define INF 0x3f3f3f3f #define pll pair<long long, long long> const int MAX = 5e6 + 9; const ll MOD = 1e9 + 7; const int TOT_PRIMES = 19; const int MAX_A = 70; using namespace std; int main() { st...
#include <bits/stdc++.h> #define mp make_pair #define fi first #define se second #define VAL 100000 #define ll long long #define INF 0x3f3f3f3f #define pll pair<long long, long long> const int MAX = 5e6 + 9; const ll MOD = 1e9 + 7; const int TOT_PRIMES = 19; const int MAX_A = 70; using namespace std; int main() { st...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
169
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define endl "\n" #define ff first #define ss second #define pb push_back #define INF ll(1e18) #define MOD 1000000007 #define debug(x) cout << x << "\n"; #define pll pair<ll, ll> #define mp make_pair #define Craig ios_base::sync_with_stdio(false),...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define endl "\n" #define ff first #define ss second #define pb push_back #define INF ll(1e18) #define MOD 1000000007 #define debug(x) cout << x << "\n"; #define pll pair<ll, ll> #define mp make_pair #define Craig ios_base::sync_with_stdio(false),...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
185
#include "bits/stdc++.h" using namespace std; #define IOS \ { \ ios::sync_with_stdio(false); \ cin.tie(0); ...
#include "bits/stdc++.h" using namespace std; #define IOS \ { \ ios::sync_with_stdio(false); \ cin.tie(0); ...
[["+", 8, 9, 0, 7, 15, 16, 31, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 31, 16, 12, 13]]
1
280
s=input() t=input() k=0 for i in range(len(s)-len(t)): a=s[i:len(t)+i] kari=0 for j in range(len(t)): if a[j]==t[j]: kari+=1 k=max(kari,k) print(len(t)-k)
s=input() t=input() k=0 for i in range(len(s)-len(t)+1): a=s[i:len(t)+i] kari=0 for j in range(len(t)): if a[j]==t[j]: kari+=1 k=max(kari,k) print(len(t)-k)
[["+", 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; const int64_t MOD = 1000000007; typedef long long ll; typedef unsigned long long ull; #define FOR(i, start, end) for (uint64_t i = start; i < end; i++) #define REP(i, n) FOR(i, 0, n) // 最大公約数gcd // 最小公倍数lcm=m*n/gcd uint64_t gcd(uint64_t m, uint64_t n) { uint64_t temp; ...
#include <bits/stdc++.h> using namespace std; const int64_t MOD = 1000000007; typedef long long ll; typedef unsigned long long ull; #define FOR(i, start, end) for (uint64_t i = start; i < end; i++) #define REP(i, n) FOR(i, 0, n) // 最大公約数gcd // 最小公倍数lcm=m*n/gcd uint64_t gcd(uint64_t m, uint64_t n) { uint64_t temp; ...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
589
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define prime 31 #define mp make_pair #define INF 1000000000 #define mod 1000000007 #define fi first #define se second int main() { string s, t; cin >> s >> t; ll ans = INF; for (ll i = 0; i < s.length() - t.length(); i++) {...
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define prime 31 #define mp make_pair #define INF 1000000000 #define mod 1000000007 #define fi first #define se second int main() { string s, t; cin >> s >> t; ll ans = INF; for (ll i = 0; i <= s.length() - t.length(); i++) ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
143
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pa pair<int, int> #define pal pair<long long, long long> #define pali pair<long long, int> #define pad pair<double, double> #define pb push_back #define mp make_pair #define COUT(v) ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pa pair<int, int> #define pal pair<long long, long long> #define pali pair<long long, int> #define pad pair<double, double> #define pb push_back #define mp make_pair #define COUT(v) ...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
1,210
def main(): s = input() t = input() slen = len(s) tlen = len(t) ans = 10 ** 10 for i in range(slen - tlen): tmp = 0 for j in range(tlen): if s[i+j] != t[j]: tmp += 1 if ans > tmp: ans = tmp print(ans) if __name__ == "...
def main(): s = input() t = input() slen = len(s) tlen = len(t) ans = 10 ** 10 for i in range(slen - tlen+1): tmp = 0 for j in range(tlen): if s[i+j] != t[j]: tmp += 1 if ans > tmp: ans = tmp print(ans) if __name__ ==...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
91
S=input() T=input() ans=float("inf") for i in range(len(S)-len(T)): tmp=0 for j in range(len(T)): if S[i+j]!=T[j]: tmp+=1 ans=min(ans,tmp) print(ans) if ans<float("inf") else print(len(T))
S=input() T=input() ans=float("inf") 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 ans=min(ans,tmp) print(ans) if ans<float("inf") else print(len(T))
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
93
#include <bits/stdc++.h> using namespace std; long long MOD = 1e9 + 7; int MAX_INT = 1e9; long long H, W; vector<vector<long long>> cost_map(1000 + 1, vector<long long>(1000 + 1, 0)); // 最大公約数 long long gcd(long long a, long long b) { if (b == 0) return a; return gcd(b, a % b); } // 最小公倍数 long long lcm(long ...
#include <bits/stdc++.h> using namespace std; long long MOD = 1e9 + 7; int MAX_INT = 1e9; long long H, W; vector<vector<long long>> cost_map(1000 + 1, vector<long long>(1000 + 1, 0)); // 最大公約数 long long gcd(long long a, long long b) { if (b == 0) return a; return gcd(b, a % b); } // 最小公倍数 long long lcm(long ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
244
import sys from collections import deque import bisect import copy import heapq import itertools import math input = sys.stdin.readline sys.setrecursionlimit(1000000) mod = 10 ** 9 + 7 def read_values(): return map(int, input().split()) def read_index(): return map(lambda x: int(x) - 1, input().split()) def read_list(...
import sys from collections import deque import bisect import copy import heapq import itertools import math input = sys.stdin.readline sys.setrecursionlimit(1000000) mod = 10 ** 9 + 7 def read_values(): return map(int, input().split()) def read_index(): return map(lambda x: int(x) - 1, input().split()) def read_list(...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
202
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <iomanip> // fixed, setprecis...
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <iomanip> // fixed, setprecis...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
185
# -*- coding: utf-8 -*- import sys import math debug = False def log(text): if debug: print(text) def parse_input(lines_as_string = None): global debug lines = [] if lines_as_string is None: debug = False for line in sys.stdin: lines.append(line.strip()) els...
# -*- coding: utf-8 -*- import sys import math debug = False def log(text): if debug: print(text) def parse_input(lines_as_string = None): global debug lines = [] if lines_as_string is None: debug = False for line in sys.stdin: lines.append(line.strip()) els...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
251
#include <algorithm> #include <bitset> #include <cctype> #include <cstdlib> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <random> #include <sstream> #include <stack> #include <stdio.h> #include <string> #include ...
#include <algorithm> #include <bitset> #include <cctype> #include <cstdlib> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <random> #include <sstream> #include <stack> #include <stdio.h> #include <string> #include ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
828
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { string s, t; cin >> s >> t; int mincnt = INFINITY; 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]) cnt++; } mincnt = min(cnt...
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { string s, t; cin >> s >> t; int mincnt = INFINITY; 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]) cnt++; } mincnt = min(cn...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
112
def main(): s = input() t = input() c = 0 ans = len(t) for i in range(len(s)-len(t)): c = 0 now = i for tt in t: if s[now] != tt: c += 1 now += 1 ans = min(ans,c) print(ans) if __name__=='__main__': main()
def main(): s = input() t = input() c = 0 ans = len(t) for i in range(len(s)-len(t)+1): c = 0 now = i for tt in t: if s[now] != tt: c += 1 now += 1 ans = min(ans,c) print(ans) if __name__=='__main__': main()
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
87
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { string s, t; cin >> s >> t; int ls = s.size(), lt = t.size(), r = lt; for (int i = 0; i + lt < ls; ++i) { int pr = 0; for (int j = 0; j < lt; ++j) { ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { string s, t; cin >> s >> t; int ls = s.size(), lt = t.size(), r = lt; for (int i = 0; i + lt - 1 < ls; ++i) { int pr = 0; for (int j = 0; j < lt; ++j...
[["+", 8, 9, 0, 7, 15, 16, 31, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 31, 16, 12, 13]]
1
137
#pragma GCC target("avx2") #pragma GCC optimization("O3") #pragma GCC optimization("unroll-loops") #include <bits/stdc++.h> #define ll long long #define pb push_back #define pii pair<int, int> #define pll pair<ll, ll> #define st first #define sc second #define arr array #define yes ...
#pragma GCC target("avx2") #pragma GCC optimization("O3") #pragma GCC optimization("unroll-loops") #include <bits/stdc++.h> #define ll long long #define pb push_back #define pii pair<int, int> #define pll pair<ll, ll> #define st first #define sc second #define arr array #define yes ...
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]]
1
247
# -*- coding: utf-8 -*- import numpy as np s = np.array(list(input())) t = np.array(list(input())) t_len = len(t) chk_num = len(s) - t_len change_num = t_len for i in range(chk_num): tmp = t_len - np.count_nonzero(s[i: t_len + i] == t) change_num = min(tmp, change_num) print(change_num)
# -*- coding: utf-8 -*- import numpy as np s = np.array(list(input())) t = np.array(list(input())) t_len = len(t) chk_num = len(s) - t_len change_num = t_len for i in range(chk_num + 1): tmp = t_len - np.count_nonzero(s[i: t_len + i] == t) change_num = min(tmp, change_num) print(change_num)
[["+", 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; #define all(c) c.begin(), c.end() #define init(c) memset(c, 0, sizeof c) #define S second #define F first typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<int> vi; typedef vector<ll> vl; const int N = 20000005; int n, k, x, t, a, b,...
#include <bits/stdc++.h> using namespace std; #define all(c) c.begin(), c.end() #define init(c) memset(c, 0, sizeof c) #define S second #define F first typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<int> vi; typedef vector<ll> vl; const int N = 20000005; int n, k, x, t, a, b,...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
217
#include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() #define vi vector<int> #define pii pair<int, int> #define F first #define S second #define pb push_back #define rep(i, a, b) for (int i = a; i < b; i++) #define repr(i, a, b) for (int i = a - 1; i >= b; i--) #define iter(m) for (auto it...
#include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() #define vi vector<int> #define pii pair<int, int> #define F first #define S second #define pb push_back #define rep(i, a, b) for (int i = a; i < b; i++) #define repr(i, a, b) for (int i = a - 1; i >= b; i--) #define iter(m) for (auto it...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
182
package main import ( "bufio" "container/heap" "fmt" "os" "sort" "strconv" ) const ( initialBufSize = 1e4 maxBufSize = 1e6 + 7 ) var buf []byte = make([]byte, maxBufSize) var sc = bufio.NewScanner(os.Stdin) func init() { sc.Split(bufio.ScanWords) sc.Buffer(buf, maxBufSize) } var d = []Position{{1, 0}...
package main import ( "bufio" "container/heap" "fmt" "os" "sort" "strconv" ) const ( initialBufSize = 1e4 maxBufSize = 1e6 + 7 ) var buf []byte = make([]byte, maxBufSize) var sc = bufio.NewScanner(os.Stdin) func init() { sc.Split(bufio.ScanWords) sc.Buffer(buf, maxBufSize) } var d = []Position{{1, 0}...
[["-", 8, 196, 0, 7, 0, 430, 15, 16, 17, 18], ["+", 8, 196, 0, 7, 0, 430, 15, 16, 17, 19]]
7
1,326
S=str(input()) T=str(input()) ls=len(S) lt=len(T) m=0 for i in range(ls): A=S[i:lt] a=0 for s,t in zip(A,T): if s==t: a+=1 m=max(m,a) print(lt-m)
S=str(input()) T=str(input()) ls=len(S) lt=len(T) m=0 for i in range(ls-lt+1): A=S[i:i+lt] a=0 for s,t in zip(A,T): if s==t: a+=1 m=max(m,a) print(lt-m)
[["+", 12, 652, 3, 4, 0, 657, 31, 657, 17, 33], ["+", 12, 652, 3, 4, 0, 657, 31, 657, 12, 22], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 662, 12, 206, 206, 663, 0, 657, 31, 22], ["+", 0, 662, 12, 206, 206, 663, 0, 657, 17, 72]]
5
84
ni = lambda: int(input()) nm = lambda: map(int, input().split()) nl = lambda: list(map(int, input().split())) s = [_ for _ in input()] t = [_ for _ in input()] ans = 10**10 for i in range(len(s) - len(t)): a = 0 for j in range(len(t)): if s[i+j] != t[j]: a+=1 ans = min(a,ans) print(ans)
ni = lambda: int(input()) nm = lambda: map(int, input().split()) nl = lambda: list(map(int, input().split())) s = [_ for _ in input()] t = [_ for _ in input()] ans = 10**10 for i in range(len(s) - len(t)+1): a = 0 for j in range(len(t)): if s[i+j] != t[j]: a+=1 ans = min(a,ans) print(ans)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
130
import re import sys import math import itertools import bisect from copy import copy from collections import deque,Counter from decimal import Decimal import functools def v(): return input() def k(): return int(input()) def S(): return input().split() def I(): return map(int,input().split()) def X(): return list(inpu...
import re import sys import math import itertools import bisect from copy import copy from collections import deque,Counter from decimal import Decimal import functools def v(): return input() def k(): return int(input()) def S(): return input().split() def I(): return map(int,input().split()) def X(): return list(inpu...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
261
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); ++i) #define REP2(i, x, n) for (int i = x; i < (n); ++i) #define ALL(v) v.begin(), v.end() #define RALL(v) v.rbegin(), v.rend() using namespace std; using ll = long long; using P = pair<int, int>; static const double PI = acos(-1); static const int INF...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); ++i) #define REP2(i, x, n) for (int i = x; i < (n); ++i) #define ALL(v) v.begin(), v.end() #define RALL(v) v.rbegin(), v.rend() using namespace std; using ll = long long; using P = pair<int, int>; static const double PI = acos(-1); static const int INF...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
289
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { string S, T; cin >> S >> T; ll max = 0; ll tmp; for (int i = 0; i < S.length() - T.length(); i++) { tmp = 0; for (int j = 0; j < T.length(); j++) { if (S[i + j] == T[j]) { tmp++; } } if (tmp...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { string S, T; cin >> S >> T; ll max = 0; ll tmp; for (int i = 0; i < S.length() - T.length() + 1; i++) { tmp = 0; for (int j = 0; j < T.length(); j++) { if (S[i + j] == T[j]) { tmp++; } } if ...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
129
#pragma GCC optimize("Ofast", "unroll-loops") #include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double string S, T; int T_len; void input(void) { cin >> S >> T; T_len = T.length(); } int change(int idx) { int res = 0; for (int i = 0; i < T_len; ++i) if (S[idx + i] != T...
#pragma GCC optimize("Ofast", "unroll-loops") #include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double string S, T; int T_len; void input(void) { cin >> S >> T; T_len = T.length(); } int change(int idx) { int res = 0; for (int i = 0; i < T_len; ++i) if (S[idx + i] != T...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
147
#include <bits/stdc++.h> using namespace std; #define ALL(a) (a).begin(), (a).end() #define rALL(a) (a).rbegin(), (a).rend() typedef pair<int, int> Pint; typedef pair<int64_t, int64_t> Pll; typedef int64_t ll; int main() { string S, T; int ans = 1000000007; cin >> S >> T; for (int i = 0; i < int(S.size() - T.s...
#include <bits/stdc++.h> using namespace std; #define ALL(a) (a).begin(), (a).end() #define rALL(a) (a).rbegin(), (a).rend() typedef pair<int, int> Pint; typedef pair<int64_t, int64_t> Pll; typedef int64_t ll; int main() { string S, T; int ans = 1000000007; cin >> S >> T; for (int i = 0; i < int(S.size() - T.s...
[["+", 15, 16, 12, 2, 3, 4, 0, 16, 17, 72], ["+", 15, 16, 12, 2, 3, 4, 0, 16, 12, 13], ["+", 8, 9, 0, 7, 15, 16, 12, 2, 63, 40], ["+", 0, 7, 15, 16, 12, 2, 3, 4, 0, 24], ["+", 12, 2, 3, 4, 0, 2, 3, 4, 0, 25]]
1
163
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; typedef long long int lld; const lld N = 200043; const lld MOD = 1000000007; lld add(lld x, lld y) { x = ((x % MOD) + (y % MOD)) % MOD; while (x >= MOD) x -= MOD; while (x < 0) x += MOD; return x; } lld mul(lld x, lld y) { re...
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; typedef long long int lld; const lld N = 200043; const lld MOD = 1000000007; lld add(lld x, lld y) { x = ((x % MOD) + (y % MOD)) % MOD; while (x >= MOD) x -= MOD; while (x < 0) x += MOD; return x; } lld mul(lld x, lld y) { re...
[["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]]
1
352
#include <iostream> #include <string> using namespace std; int main(void) { string s, t; cin >> s >> t; int cost = -1; 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]) cnt++; } if (cost > cnt || cost...
#include <iostream> #include <string> using namespace std; int main(void) { string s, t; cin >> s >> t; int cost = -1; 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]) cnt++; } if (cost > cnt || cost...
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72]]
1
128
import sys,bisect from sys import stdin,stdout from bisect import bisect_left,bisect_right,bisect,insort,insort_left,insort_right from math import gcd,ceil,floor,sqrt from collections import Counter,defaultdict,deque,OrderedDict dx=[-1,1,0,0] dy=[0,0,1,-1] sys.setrecursionlimit(10**6) INF = float('inf') MOD = 9...
import sys,bisect from sys import stdin,stdout from bisect import bisect_left,bisect_right,bisect,insort,insort_left,insort_right from math import gcd,ceil,floor,sqrt from collections import Counter,defaultdict,deque,OrderedDict dx=[-1,1,0,0] dy=[0,0,1,-1] sys.setrecursionlimit(10**6) INF = float('inf') MOD = 9...
[["+", 8, 196, 0, 52, 15, 666, 0, 657, 17, 72], ["+", 8, 196, 0, 52, 15, 666, 0, 657, 12, 612]]
5
537
s = input().rstrip() t = input().rstrip() ns = len(s) nt = len(t) ans = ns for i in range(ns-nt+1): tmp = s[i:i+nt] n=0 for j in range(nt): if tmp[j]!=t[j]: n+=1 if ans>n: ans=n print(n)
s = input().rstrip() t = input().rstrip() ns = len(s) nt = len(t) ans = ns for i in range(ns-nt+1): tmp = s[i:i+nt] n=0 for j in range(nt): if tmp[j]!=t[j]: n+=1 if ans>n: ans=n print(ans)
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]]
5
92
#include <algorithm> #include <bits/stdc++.h> #include <chrono> #include <iomanip> #include <map> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <thread> #include <typeinfo> #include <vector> // define #define trav(i, v) for (auto i : v) #define rep(i, n) for (int i = 0; i < n; i...
#include <algorithm> #include <bits/stdc++.h> #include <chrono> #include <iomanip> #include <map> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <thread> #include <typeinfo> #include <vector> // define #define trav(i, v) for (auto i : v) #define rep(i, n) for (int i = 0; i < n; i...
[["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
444
#include <bits/stdc++.h> using namespace std; #define debug(x) cout << (#x) << " is " << x << endl; #define Q \ int t; \ scanf("%d", &t); ...
#include <bits/stdc++.h> using namespace std; #define debug(x) cout << (#x) << " is " << x << endl; #define Q \ int t; \ scanf("%d", &t); ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
152
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define mem0(a) memset(a, 0, sizeof(a)) #define mem1(a) memset(a, -1, sizeof(a)) #define memf(a) memset(a, false, sizeof(a)) #define all(v) v.begin(), v.end() #define sz(a) (ll) a.size() #define F first #define S second #define INF...
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define mem0(a) memset(a, 0, sizeof(a)) #define mem1(a) memset(a, -1, sizeof(a)) #define memf(a) memset(a, false, sizeof(a)) #define all(v) v.begin(), v.end() #define sz(a) (ll) a.size() #define F first #define S second #define INF...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
491
#include <cmath> #include <iostream> #include <string> using namespace std; using ll = long long; int main() { string S, T; cin >> S >> T; ll min_change = 1000; ll S_l = S.length(); ll T_l = T.length(); for (ll i = 0; i < S_l - T_l; i++) { ll temp = 0; for (ll j = 0; j < T_l; j++) { if (S[i +...
#include <cmath> #include <iostream> #include <string> using namespace std; using ll = long long; int main() { string S, T; cin >> S >> T; ll min_change = 1000; ll S_l = S.length(); ll T_l = T.length(); for (ll i = 0; i <= S_l - T_l; i++) { ll temp = 0; for (ll j = 0; j < T_l; j++) { if (S[i ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
132
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int ans = INT_MAX; 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]) cnt++; } ans = min(ans, cnt); } cout << a...
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int ans = INT_MAX; 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]) cnt++; } ans = min(ans, cnt); } cout ...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
112
def dif (s,t): ans=0 for i in range(len(s)): if s[i]!=t[i]: ans+=1 return ans s=input() t=input() k=len(t) ans=99999999999999999 for i in range(len(s)-k): a=s[i:i+k] b=dif(a,t) ans=min(ans,b) print (ans)
def dif (s,t): ans=0 for i in range(len(s)): if s[i]!=t[i]: ans+=1 return ans s=input() t=input() k=len(t) ans=99999999999999999 for i in range(len(s)-k+1): a=s[i:i+k] b=dif(a,t) ans=min(ans,b) print (ans)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
100
#include <stdio.h> #define _USE_MATH_DEFINES #include <algorithm> #include <iostream> #include <math.h> #include <vector> using namespace std; int main() { string s, t; cin >> s; cin >> t; int ns = s.length(); int nt = t.length(); int nMax = 0; for (int i = 0; i < ns - nt; i++) { int nTmp = 0; ...
#include <stdio.h> #define _USE_MATH_DEFINES #include <algorithm> #include <iostream> #include <math.h> #include <vector> using namespace std; int main() { string s, t; cin >> s; cin >> t; int ns = s.length(); int nt = t.length(); int nMax = 0; for (int i = 0; i < ns - nt + 1; i++) { int nTmp = 0;...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
139
#include <algorithm> #include <cmath> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; long long MOD = 1000000007LL; const double PI = 3.14159265358979323846; #undef INT_MIN #undef INT_MAX #define INT_MIN -21474...
#include <algorithm> #include <cmath> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; long long MOD = 1000000007LL; const double PI = 3.14159265358979323846; #undef INT_MIN #undef INT_MAX #define INT_MIN -21474...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
157
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <stdio.h> #include <string> #include <vector> using namespace std; typedef long long ll; int main() { string S, T; cin >> S >> T; int count = 0; int m = 0; for (int i = 0; i < S.size() - T.size(); i++) { for (int j = 0; j ...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <stdio.h> #include <string> #include <vector> using namespace std; typedef long long ll; int main() { string S, T; cin >> S >> T; int count = 0; int m = 0; // cout << S.size() << endl; // cout << T.size() << endl; for (int...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
141
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using ll = long long; using p = pair<int, int>; const long long INF = 1ll << 60; int main() { string S, T; cin >> S >> T; int sizes = S.size(); int sizet = T.size(); int ans = sizet; rep(i, sizes - sizet) { ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; using ll = long long; using p = pair<int, int>; const long long INF = 1ll << 60; int main() { string S, T; cin >> S >> T; int sizes = S.size(); int sizet = T.size(); int ans = sizet; rep(i, sizes - sizet + 1)...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
148
# 入力 S = str(input()) T = str(input()) 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 if (ans > count): ans = count print(ans)
# 入力 S = str(input()) T = str(input()) 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 if (ans > count): 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
85
#include <algorithm> #include <bitset> #include <cmath> #include <fstream> #include <iostream> #include <limits> #include <map> #include <queue> #include <set> #include <string> #include <unordered_set> #include <vector> int MOD_BIG = 1000000007; int MOD_BIG2 = 998244353; using std::cerr; using std::cin; using std::co...
#include <algorithm> #include <bitset> #include <cmath> #include <fstream> #include <iostream> #include <limits> #include <map> #include <queue> #include <set> #include <string> #include <unordered_set> #include <vector> int MOD_BIG = 1000000007; int MOD_BIG2 = 998244353; using std::cerr; using std::cin; using std::co...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
241
#define _USE_MATH_DEFINES #include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <ctime> #include <deque> #include <iostream> #include <list> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set>...
#define _USE_MATH_DEFINES #include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <ctime> #include <deque> #include <iostream> #include <list> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set>...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
162
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> // Common file #include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update using namespace std; using namespace __gnu_pbds; template <class T> ostream &operator<<(ostream &os, vector<T> V) { os << "[ "; for (auto v : V) o...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> // Common file #include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update using namespace std; using namespace __gnu_pbds; template <class T> ostream &operator<<(ostream &os, vector<T> V) { os << "[ "; for (auto v : V) o...
[["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
946
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define sz(a) a.size() #define re return #define all(a) a.begin(), a.end() #define int long long using namespace std; const int dx[4] = {-1, 1, 0, 0}; const int dy[4] = {0, 0, -1, 1}; signed main() { string s, t; cin >> s >> t; int ans = 1e9; fo...
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define sz(a) a.size() #define re return #define all(a) a.begin(), a.end() #define int long long using namespace std; const int dx[4] = {-1, 1, 0, 0}; const int dy[4] = {0, 0, -1, 1}; signed main() { string s, t; cin >> s >> t; int ans = 1e9; fo...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
169
S = list(input()) T = list(input()) ans = 10**9 for i in range(len(S)-len(T)+1): Spart = S[i:i+len(T)] #print(Spart) temp_ans = 0 for j in range(len(T)): #print(Spart[j],T[j]) if Spart[j] != T[j]: temp_ans += 1 if temp_ans < ans: ans = temp_ans print(temp...
S = list(input()) T = list(input()) ans = 10**9 for i in range(len(S)-len(T)+1): Spart = S[i:i+len(T)] #print(Spart) temp_ans = 0 for j in range(len(T)): #print(Spart[j],T[j]) if Spart[j] != T[j]: temp_ans += 1 if temp_ans < ans: ans = temp_ans...
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]]
5
94
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, d, e, i, j; string s, s1; cin >> s >> s1; e = s.length(); for (i = 0; i < s.length() - s1.length(); i++) { int k = i, m = 0; for (j = 0; j < s1.length(); j++) { if (s1[j] != s[k]) { m++; } k++; } ...
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, d, e, i, j; string s, s1; cin >> s >> s1; e = s.length(); for (i = 0; i <= s.length() - s1.length(); i++) { int k = i, m = 0; for (j = 0; j < s1.length(); j++) { if (s1[j] != s[k]) { m++; } k++; } ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
134
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define fori(a, b) for (int i = a; i < b; i++) #define forj(a, b) for (int j = a; j < b; j++) #define ford(b, a) for (int i = b; i >= a; i--) typedef pair<int, int> pi; #define PI 3.14159265359 #define vi vector<int> long long mod ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define fori(a, b) for (int i = a; i < b; i++) #define forj(a, b) for (int j = a; j < b; j++) #define ford(b, a) for (int i = b; i >= a; i--) typedef pair<int, int> pi; #define PI 3.14159265359 #define vi vector<int> long long mod ...
[["+", 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
260
#!python3 import sys iim = lambda: map(int, sys.stdin.readline().rstrip().split()) def resolve(): S, T = sys.stdin.read().split() ls, lt = len(S), len(T) ans = lt for i in range(ls - lt): x = 0 for j in range(lt): if S[i+j] == T[j]: continue x +...
#!python3 import sys iim = lambda: map(int, sys.stdin.readline().rstrip().split()) def resolve(): S, T = sys.stdin.read().split() ls, lt = len(S), len(T) ans = lt for i in range(ls - lt+1): x = 0 for j in range(lt): if S[i+j] == T[j]: continue x...
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
131
#include <bits/stdc++.h> #include <cctype> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ll long long int #define ld long double #define PRY cout << "YES\n" #define PRN cout << "NO\n" #define SETP(sp) fixed << setprecision(sp) #define PB push_back #define GO ...
#include <bits/stdc++.h> #include <cctype> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ll long long int #define ld long double #define PRY cout << "YES\n" #define PRN cout << "NO\n" #define SETP(sp) fixed << setprecision(sp) #define PB push_back #define GO ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 8, 9, 0, 7, 15, 16, 12, 23, 0, 24], ["+", 8, 9, 0, 7, 15, 16, 12, 23, 0, 25]]
1
352
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define pb push_back using namespace std; typedef long long ll; int main() { string s, t; cin >> s >> t; int ls = s.size(); int lt = t.size(); int ans = lt; rep(i, ls - lt) { int res = 0; rep(j, lt) { if (t[j] != s[i + j]...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define pb push_back using namespace std; typedef long long ll; int main() { string s, t; cin >> s >> t; int ls = s.size(); int lt = t.size(); int ans = lt; rep(i, ls - lt + 1) { int res = 0; rep(j, lt) { if (t[j] != s[i ...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
118
#include <bits/stdc++.h> using namespace std; #define gc getchar_unlocked #define fo(i, n) for (i = 0; i < n; i++) #define Fo(i, k, n) for (i = k; k < n ? i < n : i > n; k < n ? i += 1 : i -= 1) #define ll long long #define si(x) scanf("%d", &x) #define sl(x) scanf("%lld", &x) #define ss(s) scanf("%s", s) #define pi(x)...
#include <bits/stdc++.h> using namespace std; #define gc getchar_unlocked #define fo(i, n) for (i = 0; i < n; i++) #define Fo(i, k, n) for (i = k; k < n ? i < n : i > n; k < n ? i += 1 : i -= 1) #define ll long long #define si(x) scanf("%d", &x) #define sl(x) scanf("%lld", &x) #define ss(s) scanf("%s", s) #define pi(x)...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
567
S = list(input()) T = list(input()) ls = len(S) lt = len(T) ans = lt for offset in range(ls - lt + 1): cnt = 0 for i in range(lt): if S[offset + i] != T[i]: cnt += 1 ans = min(lt, cnt) print(ans)
S = list(input()) T = list(input()) ls = len(S) lt = len(T) ans = lt for offset in range(ls - lt + 1): cnt = 0 for i in range(lt): if S[offset + i] != T[i]: cnt += 1 ans = min(ans, cnt) print(ans)
[["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22]]
5
82
#include <iostream> #include <string> #include <vector> using namespace std; int main() { string s, t; cin >> s >> t; int m = t.size(); int c; string sub; int slen = (int)s.size(); int tlen = (int)t.size(); for (int i = 0; i < slen - tlen; ++i) { sub = s.substr(i, tlen); c = 0; for (int j =...
#include <iostream> #include <string> #include <vector> using namespace std; int main() { string s, t; cin >> s >> t; int m = t.size(); int c; string sub; int slen = (int)s.size(); int tlen = (int)t.size(); for (int i = 0; i <= slen - tlen; ++i) { sub = s.substr(i, tlen); c = 0; for (int j ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
146
#include <algorithm> #include <iostream> #include <iterator> #include <map> #include <set> #include <vector> //#include<bits/stdc++.h> using namespace std; const int maxn = 3e3 + 5; #define ll long long #define inf 0x3f3f #define mod 1000000007 #define endl '\n' // int a[maxn]; // int b[maxn][maxn]; int main() { ios:...
#include <algorithm> #include <iostream> #include <iterator> #include <map> #include <set> #include <vector> //#include<bits/stdc++.h> using namespace std; const int maxn = 3e3 + 5; #define ll long long #define inf 0x3f3f #define mod 1000000007 #define endl '\n' // int a[maxn]; // int b[maxn][maxn]; int main() { ios:...
[["+", 8, 9, 0, 7, 15, 16, 31, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 31, 16, 12, 13]]
1
169
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <se...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #include <se...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
209
S = input() T = input() match = 0 k = 0 result = 0 for i in range(len(S)-len(T)) : k = i # start match = 0 for j in range(len(T)) : if T[j] == S[k] : match = match + 1 k += 1 result = max(result,match) print(len(T) - result)
S = input() T = input() match = 0 k = 0 result = 0 for i in range(len(S)-len(T)+1) : k = i # start match = 0 for j in range(len(T)) : #print(T[j],S[k]) if T[j] == S[k] : match = match + 1 k += 1 result = max(result,match) #print(result) print(len(T) - result)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
89
#include <bits/stdc++.h> using namespace std; using vi = vector<int>; int main() { string s, t; cin >> s >> t; int ans = 1001; for (int ix = 0; ix + t.size() < (int)s.size(); ix++) { string tmp = s.substr(ix, t.size()); int cnt = 0; for (int ix2 = 0; ix2 < t.size(); ix2++) { if (tmp.at(ix2) !...
#include <bits/stdc++.h> using namespace std; using vi = vector<int>; int main() { string s, t; cin >> s >> t; int ans = 10001; for (int ix = 0; ix + (int)t.size() <= (int)s.size(); ix++) { string tmp = s.substr(ix, t.size()); int cnt = 0; for (int ix2 = 0; ix2 < t.size(); ix2++) { if (tmp.at...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 7, 15, 16, 31, 16, 12, 74, 0, 24], ["+", 15, 16, 31, 16, 12, 74, 39, 77, 39, 40], ["+", 0, 7, 15, 16, 31, 16, 12, 74, 0, 25], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
140
s=input() t=input() ans=[] for i in range(len(s)-len(t)): count=0 for j in range(len(t)): if t[j]==s[i+j]: count+=1 ans.append(count) print(len(t)-max(ans))
s=input() t=input() ans=[] for i in range(len(s)-len(t)+1): count=0 for j in range(len(t)): if t[j]==s[i+j]: count+=1 ans.append(count) print(len(t)-max(ans))
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
78
import sys from sys import exit from math import gcd, factorial, ceil, floor, sqrt from bisect import bisect_left, bisect_right from copy import deepcopy from heapq import heapify, heappop, heappush from itertools import permutations, combinations, product, accumulate from collections import defaultdict, deque, Counter...
import sys from sys import exit from math import gcd, factorial, ceil, floor, sqrt from bisect import bisect_left, bisect_right from copy import deepcopy from heapq import heapify, heappop, heappush from itertools import permutations, combinations, product, accumulate from collections import defaultdict, deque, Counter...
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72]]
5
187
#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; cin >> T; int count = 0, ans = 100000; for (int i = 0; i < S.length() - T.length(); ++i) { count = 0; for (int j = 0; j < T.length(); ++j) { if (S[i + j] != T[...
#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; cin >> T; int count = 0, ans = 100000; for (int i = 0; i <= S.length() - T.length(); ++i) { count = 0; for (int j = 0; j < T.length(); ++j) { if (S[i + j] != T...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
129
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; //----------------------- Print Function ----------------------// inline void print() { cout << endl; } template <typename First, typename... Rest> void print(const First &first, const Rest &...rest) { cout << first << ' '; print(rest...); } ...
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; //----------------------- Print Function ----------------------// inline void print() { cout << endl; } template <typename First, typename... Rest> void print(const First &first, const Rest &...rest) { cout << first << ' '; print(rest...); } ...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
231
#include <bits/stdc++.h> using namespace std; //“Remember, Hope is a good thing, maybe the best of things, and no good thing //ever dies.” //― Stephen King const int MOD = 1e9 + 7; #define ll long long int #define pii pair<int, int> #define pll pair<ll, ll> #define pb push_back #define eb emplace_back #define in ins...
#include <bits/stdc++.h> using namespace std; //“Remember, Hope is a good thing, maybe the best of things, and no good thing //ever dies.” //― Stephen King const int MOD = 1e9 + 7; #define ll long long int #define pii pair<int, int> #define pll pair<ll, ll> #define pb push_back #define eb emplace_back #define in ins...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
352
#include <algorithm> #include <cmath> //abs()かfabs()で少数絶対値 #include <cstdlib> //abs()で整数絶対値 #include <deque> #include <functional> //sort第三引数greater<型名>()で降順 #include <iomanip> //cout<<setw(数字) で空白による桁揃え #include <iostream> //cout<<right で右揃え #include <map> #include <queue> #include <string> #include <vector> u...
#include <algorithm> #include <cmath> //abs()かfabs()で少数絶対値 #include <cstdlib> //abs()で整数絶対値 #include <deque> #include <functional> //sort第三引数greater<型名>()で降順 #include <iomanip> //cout<<setw(数字) で空白による桁揃え #include <iostream> //cout<<right で右揃え #include <map> #include <queue> #include <string> #include <vector> u...
[["+", 0, 7, 15, 16, 12, 16, 31, 16, 17, 72], ["+", 0, 7, 15, 16, 12, 16, 31, 16, 12, 13]]
1
163
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cmath> //sqrt pow #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // dequef #includ...
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cmath> //sqrt pow #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // dequef #includ...
[["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 72], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13]]
1
184
#include <bits/stdc++.h> using namespace std; #define pb push_back #define pop_b pop_back #define pf push_front #define pop_f pop_front typedef long long int ll; typedef pair<int, int> ii; // are aligned to the right like this typedef vector<ii> vii; // vector pair typedef vector<int> vi; // vector integer typ...
#include <bits/stdc++.h> using namespace std; #define pb push_back #define pop_b pop_back #define pf push_front #define pop_f pop_front typedef long long int ll; typedef pair<int, int> ii; // are aligned to the right like this typedef vector<ii> vii; // vector pair typedef vector<int> vi; // vector integer typ...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
167
#include <bits/stdc++.h> #define f(i, a, b) for (ll i = a; i < b; i++) #define af(i, a, b) for (ll i = a; i >= b; i--) #define rep(i, a, b, k) for (ll i = a; i < b; i += k) #define arep(i, a, b, k) for (ll i = a; i >= b; i -= k) #define ones(x) (ll) __builtin_popcount(x) #define fs first #define sc second #define pb p...
#include <bits/stdc++.h> #define f(i, a, b) for (ll i = a; i < b; i++) #define af(i, a, b) for (ll i = a; i >= b; i--) #define rep(i, a, b, k) for (ll i = a; i < b; i += k) #define arep(i, a, b, k) for (ll i = a; i >= b; i -= k) #define ones(x) (ll) __builtin_popcount(x) #define fs first #define sc second #define pb p...
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
260
#include <bits/stdc++.h> using namespace std; int main() { int check, result = 0; string S, T; cin >> S; cin >> T; for (int i = 0; i < S.size() - T.size(); i++) { check = 0; for (int j = 0; j < T.size(); j++) { if (S[i + j] == T[j]) { check++; } } if (result < check) ...
#include <bits/stdc++.h> using namespace std; int main() { int check, result = 0; string S, T; cin >> S; cin >> T; for (int i = 0; i < S.size() - T.size() + 1; i++) { check = 0; for (int j = 0; j < T.size(); j++) { if (S[i + j] == T[j]) { check++; } } if (result < check) ...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
123
#include <iostream> #include <string> using namespace std; int main() { string S, T; cin >> S; cin >> T; const char *cS = S.c_str(); const char *cT = T.c_str(); int max_count = 0; for (size_t i = 0; i < (S.size() - T.size() - 1); ++i) { int count = 0; for (size_t j = 0; j < T.size(); ++j) { ...
#include <iostream> #include <string> using namespace std; int main() { string S, T; cin >> S; cin >> T; const char *cS = S.c_str(); const char *cT = T.c_str(); int max_count = 0; for (size_t i = 0; i < (S.size() - T.size() + 1); ++i) { int count = 0; for (size_t j = 0; j < T.size(); ++j) { ...
[["-", 0, 7, 15, 16, 12, 23, 0, 16, 17, 33], ["+", 0, 7, 15, 16, 12, 23, 0, 16, 17, 72]]
1
163
S = gets T = gets ns = S.length nt = T.length n_try = ns - nt + 1 i = 0 mm = 0 n_try.times do j = 0 m = 0 nt.times do if S[i+j] == T[j] m+=1 end j += 1 end if m > mm mm = m end i += 1 end puts nt - mm
S = gets.strip T = gets.strip ns = S.length nt = T.length n_try = ns - nt + 1 i = 0 mm = 0 n_try.times do j = 0 m = 0 nt.times do if S[i+j] == T[j] m+=1 end j += 1 end if m > mm mm = m end i += 1 end puts nt - mm
[["+", 36, 36, 0, 493, 0, 662, 12, 652, 17, 131], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 735, 22]]
4
79
#include <bits/stdc++.h> using namespace std; int main(int argc, char const *argv[]) { string s, t; cin >> s >> t; int n = s.size(); int m = t.size(); int ans = INT_MAX; vector<int> f(26, 0); for (int i = 0; i < n - m; ++i) { int tmp = 0; for (int j = 0; j < m; ++j) { if (s[i + j] != t[j]) ...
#include <bits/stdc++.h> using namespace std; int main(int argc, char const *argv[]) { string s, t; cin >> s >> t; int n = s.size(); int m = t.size(); int ans = INT_MAX; vector<int> f(26, 0); for (int i = 0; i <= n - m; ++i) { int tmp = 0; for (int j = 0; j < m; ++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
144
S = input() T = input() len_S = len(S) len_T = len(T) ans = len_T for i in range(len_S - len_T): match = 0 for s, t in zip(S[i:i + len_T], T): if s == t: match += 1 change = len_T - match ans = min(ans, change) print(ans)
S = input() T = input() len_S = len(S) len_T = len(T) ans = len_T for i in range(0, len_S - len_T + 1): match = 0 for s, t in zip(S[i:i + len_T], T): if s == t: match += 1 change = len_T - match ans = min(ans, change) print(ans)
[["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
82
#define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> #include <random> using namespace std; typedef unsigned int uint; typedef long long ll; typedef long double ld; typedef unsigned long long ull; typedef pair<int, int> ii; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<string> vs; typedef vector<...
#define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> #include <random> using namespace std; typedef unsigned int uint; typedef long long ll; typedef long double ld; typedef unsigned long long ull; typedef pair<int, int> ii; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<string> vs; typedef vector<...
[["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 19]]
1
753
import math S = input() T = input() ans = math.inf for i in range(len(S) - len(T)): tmp = sum([s != t for s, t in zip(S[i:i + len(T)], T)]) ans = min(ans, tmp) print(ans)
import math S = input() T = input() ans = math.inf for i in range(len(S) - len(T)+1): tmp = sum([s != t for s, t in zip(S[i:i + len(T)], 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
76
#include <bits/stdc++.h> using namespace std; int main() { string S, T; cin >> S >> T; int itchi = 0; int max = 0; for (int i = 0; i < (size(S) - size(T)); i++) { for (int j = 0; j < size(T); j++) { if (S[i + j] == T[j]) itchi++; // cout << S[i+j] << T[j] << ' '; } if (itch...
#include <bits/stdc++.h> using namespace std; int main() { string S, T; cin >> S >> T; int itchi = 0; int max = 0; for (int i = 0; i < (size(S) - size(T) + 1); i++) { for (int j = 0; j < size(T); j++) { if (S[i + j] == T[j]) itchi++; // cout << S[i+j] << T[j] << ' '; } if (...
[["+", 0, 7, 15, 16, 12, 23, 0, 16, 17, 72], ["+", 0, 7, 15, 16, 12, 23, 0, 16, 12, 13]]
1
121
import sys import math import fractions from collections import defaultdict stdin = sys.stdin ns = lambda: stdin.readline().rstrip() ni = lambda: int(stdin.readline().rstrip()) nm = lambda: map(int, stdin.readline().split()) nl = lambda: list(map(int, stdin.readline().split())) S=list(ns()) T=list(ns()) INF=1...
import sys import math import fractions from collections import defaultdict stdin = sys.stdin ns = lambda: stdin.readline().rstrip() ni = lambda: int(stdin.readline().rstrip()) nm = lambda: map(int, stdin.readline().split()) nl = lambda: list(map(int, stdin.readline().split())) S=list(ns()) T=list(ns()) INF=1...
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]]
5
169
import java.util.*; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); String S = sc.next(); String T = sc.next(); int counter = 0; for (int i = 0; i < (S.length() - T.length()); i++) { int count2 = 0; for (int j = 0; j < T.length(); j++) ...
import java.util.*; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); String S = sc.next(); String T = sc.next(); int counter = 0; for (int i = 0; i < (S.length() - T.length() + 1); i++) { int count2 = 0; for (int j = 0; j < T.length(); j...
[["+", 0, 7, 15, 16, 12, 23, 0, 16, 17, 72], ["+", 0, 7, 15, 16, 12, 23, 0, 16, 12, 499]]
3
160
/// Bismillahir Rahmanir Rahim #include <bits/stdc++.h> using namespace std; #define ll long long int ll gcd(int a, int b) { if (b == 0) return a; return gcd(b, a % b); } #define in(x) scanf("%lld", &x) #define in2(x, y) scanf("%lld %lld", &x, &y) #define in3(x, y, z) scanf("%lld %lld %lld", &x, &y, &z) #defin...
/// Bismillahir Rahmanir Rahim #include <bits/stdc++.h> using namespace std; #define ll long long int ll gcd(int a, int b) { if (b == 0) return a; return gcd(b, a % b); } #define in(x) scanf("%lld", &x) #define in2(x, y) scanf("%lld %lld", &x, &y) #define in3(x, y, z) scanf("%lld %lld %lld", &x, &y, &z) #defin...
[["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
247
s = input() t = input() tt = t max_count = 0 while True: count = 0 for i in range(len(t)): if s[i] == tt[i]: count += 1 # print(count) max_count = max(max_count, count) # print(f"{len(s)} {len(t)}") if len(s) == len(tt): break tt = ' ' + tt print...
s = input() t = input() tt = t max_count = 0 while True: count = 0 for i in range(len(tt)): if s[i] == tt[i]: count += 1 # print(count) max_count = max(max_count, count) # print(f"{len(s)} {len(t)}") if len(s) == len(tt): break tt = ' ' + tt prin...
[["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 22]]
5
85
// Problem : B - Substring // Contest : AtCoder - AtCoder Beginner Contest 177 // URL : https://atcoder.jp/contests/abc177/tasks/abc177_b // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) #include <bits/stdc++.h> using namespace std; #define endl '\n' #d...
// Problem : B - Substring // Contest : AtCoder - AtCoder Beginner Contest 177 // URL : https://atcoder.jp/contests/abc177/tasks/abc177_b // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) #include <bits/stdc++.h> using namespace std; #define endl '\n' #d...
[["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
834
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define fr first #define sc second #define MOD 1000000007 #define len(x) x.size() #define min3(a, b, c) min(a, min(b, c)) #define max3(a, b, c) max(a, max(b, c)) #define all(v) v.begin(), v.end() #define alla(a, n) a, a + n #define prtarr(n, len) ...
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define fr first #define sc second #define MOD 1000000007 #define len(x) x.size() #define min3(a, b, c) min(a, min(b, c)) #define max3(a, b, c) max(a, max(b, c)) #define all(v) v.begin(), v.end() #define alla(a, n) a, a + n #define prtarr(n, len) ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
284
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) using ll = long long; using P = pair<int, int>; int main() { string s, t; cin >> s >> t; int ans = 10000; for (int i = 0; i + t.size() < s.size(); i++) { int cnt = 0; rep(j, t.size()) { if (t.at(j) != s.a...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) using ll = long long; using P = pair<int, int>; int main() { string s, t; cin >> s >> t; int ans = 10000; for (int i = 0; i + t.size() <= s.size(); i++) { int cnt = 0; rep(j, t.size()) { if (t.at(j) != s...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
135
s = input() t = input() a = [] for i in range(len(s)-len(t)): count = 0 for j in range(len(t)): if t[j] != s[j+i]: count += 1 a.append(count) print(min(a))
s = input() t = input() a = [] for i in range(len(s)-len(t)+1): count = 0 for j in range(len(t)): if t[j] != s[j+i]: count += 1 a.append(count) print(min(a))
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
73