problem_id
stringlengths
6
6
language
stringclasses
2 values
original_status
stringclasses
3 values
original_src
stringlengths
19
243k
changed_src
stringlengths
19
243k
change
stringclasses
3 values
i1
int64
0
8.44k
i2
int64
0
8.44k
j1
int64
0
8.44k
j2
int64
0
8.44k
error
stringclasses
270 values
stderr
stringlengths
0
226k
p02558
C++
Runtime Error
#include <algorithm> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <utility> #include <vector> #define MOD 1000000007 using namespace std; typedef long long ll; #include <cstring> int n, m; struct unionfind { int pa...
#include <algorithm> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <utility> #include <vector> #define MOD 1000000007 using namespace std; typedef long long ll; #include <cstring> int n, m; struct unionfind { int pa...
replace
23
24
23
24
0
p02558
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; // conversion //------------------------------------------ inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } // math //--------...
#include <bits/stdc++.h> using namespace std; // conversion //------------------------------------------ inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } // math //--------...
delete
231
233
231
231
0
p02558
C++
Runtime Error
#pragma GCC optimize("Ofast") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #pragma GCC target("avx") #include <bits/stdc++.h> #define _GLIBCXX_DEBUG using namespace std; using ll = long long; using vec = vector<ll>; using vect = vector<double>; using Graph = vector<vector<ll>>; #define endl '\n' #def...
#pragma GCC optimize("Ofast") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #pragma GCC target("avx") #include <bits/stdc++.h> #define _GLIBCXX_DEBUG using namespace std; using ll = long long; using vec = vector<ll>; using vect = vector<double>; using Graph = vector<vector<ll>>; #define endl '\n' #def...
replace
101
102
101
102
0
p02558
C++
Runtime Error
#include <bits/stdc++.h> const double pi = 3.141592653589793238462643383279; using namespace std; // typedef //------------------------------------------ typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<string> VS; typedef pair<int, int> PII; typedef pair<long long, long long> PLL; typedef pair<int, PII...
#include <bits/stdc++.h> const double pi = 3.141592653589793238462643383279; using namespace std; // typedef //------------------------------------------ typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<string> VS; typedef pair<int, int> PII; typedef pair<long long, long long> PLL; typedef pair<int, PII...
replace
98
100
98
99
0
p02558
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; } #define all(x) (x).beg...
#include <bits/stdc++.h> using namespace std; typedef long long ll; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; } #define all(x) (x).beg...
replace
2,008
2,010
2,008
2,009
-6
e9d016d2-16d2-42cb-b7c0-080c08378956.out: /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02558/C++/s089586109.cpp:854: bool atcoder::dsu::same(int, int): Assertion `0 <= a && a < _n' failed.
p02558
C++
Runtime Error
// ヘッダー #include <bits/stdc++.h> using namespace std; // 型定義 typedef long long ll; // 定数 const ll INF = 1e+18; const int MOD = 1e+9 + 7; // REPマクロ #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define REPD(i, n) for (ll i = n - 1; i >= 0; i--) #define REP2(i, a, b) for (ll i = a; i < (ll)(b); i++) #define REPD2...
// ヘッダー #include <bits/stdc++.h> using namespace std; // 型定義 typedef long long ll; // 定数 const ll INF = 1e+18; const int MOD = 1e+9 + 7; // REPマクロ #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define REPD(i, n) for (ll i = n - 1; i >= 0; i--) #define REP2(i, a, b) for (ll i = a; i < (ll)(b); i++) #define REPD2...
delete
79
81
79
79
0
p02558
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; vector<int> root; vector<int> Rank; // 通常バージョン int find(int x) { if (root[x] == x) return x; root[x] = find(root[x]); return root[x]; } bool check(int x, int y) { return find(x) == find(y); } void Union(int x, int y) { x = find(x); y = find(y); if (check...
#include <bits/stdc++.h> using namespace std; vector<int> root; vector<int> Rank; // 通常バージョン int find(int x) { if (root[x] == x) return x; root[x] = find(root[x]); return root[x]; } bool check(int x, int y) { return find(x) == find(y); } void Union(int x, int y) { x = find(x); y = find(y); if (check...
delete
42
44
42
42
0
p02558
C++
Runtime Error
// #pragma GCC optimize("Ofast") // #pragma GCC target("avx,avx2,fma") // #pragma GCC optimization ("unroll-loops") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; #define fo(i, n) for (int i = 0; i < n; i++) #define nl "\n" #define ff first #define s...
// #pragma GCC optimize("Ofast") // #pragma GCC target("avx,avx2,fma") // #pragma GCC optimization ("unroll-loops") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; #define fo(i, n) for (int i = 0; i < n; i++) #define nl "\n" #define ff first #define s...
replace
121
123
121
123
-11
p02558
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; struct UnionFind { vector<int> par, size; UnionFind(int x) { par.resize(x); size.resize(x, 1); for (int i = 0; i < x; i++) { par[i] = i; } } int find(int x) { if (par[x] == x) return x; return par[x] = find(par[x]); } bool sam...
#include <bits/stdc++.h> using namespace std; struct UnionFind { vector<int> par, size; UnionFind(int x) { par.resize(x); size.resize(x, 1); for (int i = 0; i < x; i++) { par[i] = i; } } int find(int x) { if (par[x] == x) return x; return par[x] = find(par[x]); } bool sam...
replace
35
36
35
36
0
p02558
C++
Runtime Error
#pragma GCC optimize("Ofast") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #pragma GCC target("avx") #include <bits/stdc++.h> #define _GLIBCXX_DEBUG using namespace std; using ll = long long; using vec = vector<ll>; using vect = vector<double>; using Graph = vector<vector<ll>>; #define endl '\n' #def...
#pragma GCC optimize("Ofast") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #pragma GCC target("avx") #include <bits/stdc++.h> #define _GLIBCXX_DEBUG using namespace std; using ll = long long; using vec = vector<ll>; using vect = vector<double>; using Graph = vector<vector<ll>>; #define endl '\n' #def...
replace
101
102
101
102
0
p02558
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fastio \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) const int Mxn = 2...
#include <bits/stdc++.h> using namespace std; #define fastio \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) const int Mxn = 2...
replace
16
17
16
17
0
p02559
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; const int nax = 5e5 + 5; vector<long long> st(2 * nax); int n; void modify(int p, int v) { for (st[p += n] += v; p > 0; p--) st[p >> 1] = st[p] + st[p ^ 1]; } long long sum(int l, int r) { l += n, r += n; long long ans = 0; while (l < r) { if (l & 1) ...
#include <bits/stdc++.h> using namespace std; const int nax = 5e5 + 5; vector<long long> st(2 * nax); int n; void modify(int p, int v) { for (st[p += n] += v; p > 0; p >>= 1) st[p >> 1] = st[p] + st[p ^ 1]; } long long sum(int l, int r) { l += n, r += n; long long ans = 0; while (l < r) { if (l & 1) ...
replace
8
9
8
9
TLE
p02559
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; template <class T> struct fenwick_tree { // using U = internal::to_unsigned_t<T>; using U = T; public: fenwick_tree() : _n(0) {} fenwick_tree(int n) : _n(n), data(n) {} void add(int p, T x) { assert(0 <= p && p < _n); p++; whil...
#include <bits/stdc++.h> using namespace std; typedef long long ll; template <class T> struct fenwick_tree { // using U = internal::to_unsigned_t<T>; using U = T; public: fenwick_tree() : _n(0) {} fenwick_tree(int n) : _n(n), data(n) {} void add(int p, T x) { assert(0 <= p && p < _n); p++; whil...
replace
45
46
45
46
0
p02559
C++
Runtime Error
#include <cstdio> #include <iostream> #include <vector> using namespace std; using ui = unsigned int; using ul = unsigned long; #pragma GCC optimize("Ofast") #define loop(i, n) for (ui i = 0; i < n; i++) ul bit[500001]; struct BIT { ui n; inline ul sum(ui x) { ul ret = 0; while (x > 0) { ret += bit[x]...
#include <cstdio> #include <iostream> #include <vector> using namespace std; using ui = unsigned int; using ul = unsigned long; #pragma GCC optimize("Ofast") #define loop(i, n) for (ui i = 0; i < n; i++) ul bit[550001]; struct BIT { ui n; inline ul sum(ui x) { ul ret = 0; while (x > 0) { ret += bit[x]...
replace
8
9
8
9
0
p02559
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define f first #define s second #define sz size() #define ll long long #define all(_v) _v.begin(), _v.end() #define pii pair<int, int> #define pll pair<ll, ll> #define pvllvll pair<vector<ll>, vector<ll>> #define ld long double #de...
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define f first #define s second #define sz size() #define ll long long #define all(_v) _v.begin(), _v.end() #define pii pair<int, int> #define pll pair<ll, ll> #define pvllvll pair<vector<ll>, vector<ll>> #define ld long double #de...
replace
23
24
23
24
0
p02559
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; // #define int long long typedef long long ll; typedef unsigned long long ul; typedef unsigned int ui; const ll mod = 1000000007; const ll INF = mod * mod; const int INF_N = 1e+9; typedef pair<int, int> P; // #define stop char nyaa;cin>>nyaa; #define rep(i, n) for (int i ...
#include <bits/stdc++.h> using namespace std; // #define int long long typedef long long ll; typedef unsigned long long ul; typedef unsigned int ui; const ll mod = 1000000007; const ll INF = mod * mod; const int INF_N = 1e+9; typedef pair<int, int> P; // #define stop char nyaa;cin>>nyaa; #define rep(i, n) for (int i ...
replace
128
129
128
129
0
p02559
C++
Runtime Error
#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; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; #define int long long #define ar array #defin...
#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; template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; #define int long long #define ar array #defin...
replace
24
25
24
25
0
p02561
C++
Runtime Error
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; // template #define rep(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define ALL(v) (v).begin(), (v).end() typedef long long int ll; const int inf = 0x3fffffff; const ll INF = 0x1fffffffffffffff; const double eps = 1e-12; template <typename ...
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; // template #define rep(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define ALL(v) (v).begin(), (v).end() typedef long long int ll; const int inf = 0x3fffffff; const ll INF = 0x1fffffffffffffff; const double eps = 1e-12; template <typename ...
replace
222
223
222
223
0
p02561
Python
Runtime Error
import sys import itertools import numpy as np import networkx as nx read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N, M = map(int, readline().split()) S = np.frombuffer(read(), "S1").reshape(N, -1)[:, :M].astype("U1") A = [] B = [] E = [] for i, j in iterto...
import sys import itertools import numpy as np import networkx as nx read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N, M = map(int, readline().split()) S = np.frombuffer(read(), "S1").reshape(N, -1)[:, :M].astype("U1") A = [] B = [] E = [] for i, j in iterto...
replace
35
36
35
36
TLE
p02561
C++
Runtime Error
#define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> #include <unordered_map> using namespace std; typedef long long ll; template <class Cap> struct mf_graph { public: mf_graph() : _n(0) {} mf_graph(int n) : _n(n), g(n) {} int add_edge(int from, int to, Cap cap) { assert(0 <= from && from < _n); a...
#define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> #include <unordered_map> using namespace std; typedef long long ll; template <class Cap> struct mf_graph { public: mf_graph() : _n(0) {} mf_graph(int n) : _n(n), g(n) {} int add_edge(int from, int to, Cap cap) { assert(0 <= from && from < _n); a...
replace
186
187
186
187
0
p02561
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define inf 2000000000 // 1e17 template <class T> struct Dinic { struct edge { int to; T cap; int rev; }; vector<vector<edge>> edges; vector<int> id; vector<int> d; Dinic(int n = 1) { edges.clear(); edges.resize(n); id.resize(n); d.r...
#include <bits/stdc++.h> using namespace std; #define inf 2000000000 // 1e17 template <class T> struct Dinic { struct edge { int to; T cap; int rev; }; vector<vector<edge>> edges; vector<int> id; vector<int> d; Dinic(int n = 1) { edges.clear(); edges.resize(n); id.resize(n); d.r...
insert
84
84
84
89
0
p02561
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (ll i = 0; i < n; ++i) #define all(c) begin(c), end(c) #define PI acos(-1) #define oo LLONG_MAX template <typename T1, typename T2> bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return true; } else return false; } ...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (ll i = 0; i < n; ++i) #define all(c) begin(c), end(c) #define PI acos(-1) #define oo LLONG_MAX template <typename T1, typename T2> bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return true; } else return false; } ...
replace
39
40
39
40
0
p02561
C++
Runtime Error
#include <algorithm> #include <array> #include <assert.h> #include <bitset> #include <chrono> #include <cmath> #include <complex> #include <cstring> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <istream> #include <map> #include <math.h> #include <numeric> #include <ostream> ...
#include <algorithm> #include <array> #include <assert.h> #include <bitset> #include <chrono> #include <cmath> #include <complex> #include <cstring> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <istream> #include <map> #include <math.h> #include <numeric> #include <ostream> ...
replace
161
162
161
162
0
p02561
C++
Runtime Error
#include "algorithm" #include "bitset" #include "cassert" #include "climits" #include "cmath" #include "cstdio" #include "ctime" #include "functional" #include "iomanip" #include "iostream" #include "list" #include "map" #include "numeric" #include "queue" #include "random" #include "set" #include "stack" #include "str...
#include "algorithm" #include "bitset" #include "cassert" #include "climits" #include "cmath" #include "cstdio" #include "ctime" #include "functional" #include "iomanip" #include "iostream" #include "list" #include "map" #include "numeric" #include "queue" #include "random" #include "set" #include "stack" #include "str...
insert
155
155
155
157
0
p02562
C++
Runtime Error
#pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> // #include<ext/pb_ds/assoc_container.hpp> // #include<ext/pb_ds/tree_policy.hpp> // #include<ext/pb_ds/tag_and_trait.hpp> // using namespace __gnu_pbds; // #include<boost/multiprecision/cpp_int.hpp> // na...
#pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> // #include<ext/pb_ds/assoc_container.hpp> // #include<ext/pb_ds/tree_policy.hpp> // #include<ext/pb_ds/tag_and_trait.hpp> // using namespace __gnu_pbds; // #include<boost/multiprecision/cpp_int.hpp> // na...
replace
235
236
235
236
0
p02564
C++
Runtime Error
#include <bits/stdc++.h> // ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); // clock_t start=clock();clock_t // end=clock();cout<<(double)(end-start)/CLOCKS_PER_SEC<<endl; using namespace std; typedef long long ll; typedef unsigned long long ull; typedef unsigned int ui; typedef pair<int, int> pii; typedef pair<pii...
#include <bits/stdc++.h> // ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); // clock_t start=clock();clock_t // end=clock();cout<<(double)(end-start)/CLOCKS_PER_SEC<<endl; using namespace std; typedef long long ll; typedef unsigned long long ull; typedef unsigned int ui; typedef pair<int, int> pii; typedef pair<pii...
replace
2,099
2,100
2,099
2,100
0
p02564
C++
Runtime Error
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> #define int long long #define ll long long using ull = unsigned long long; using namespace std; #define dump(x) \ if (dbg) { \ cerr << #x...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> #define int long long #define ll long long using ull = unsigned long long; using namespace std; #define dump(x) \ if (dbg) { \ cerr << #x...
replace
655
656
655
656
0
Please Verify
p02565
C++
Runtime Error
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N, D; cin >> N >> D; vector<int> X(N), Y(N); for (int i = 0; i < N; ++i) cin >> X[i] >> Y[i]; vector<vector<int>> graph(N * 2), rev(N * 2); for (int i = ...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N, D; cin >> N >> D; vector<int> X(N), Y(N); for (int i = 0; i < N; ++i) cin >> X[i] >> Y[i]; vector<vector<int>> graph(N * 2), rev(N * 2); for (int i = ...
replace
46
47
46
47
0
p02565
C++
Runtime Error
#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...
replace
93
94
93
94
-11
p02566
C++
Runtime Error
#pragma region header #include <bits/stdc++.h> #define int long long #define all(a) begin(a), end(a) #define rall(a) rbegin(a), rend(a) #define mp make_pair #define rep1(i, n) for (decltype(+n) i = 0; i < (n); i++) #define rrep1(i, n) for (auto i = n - 1; i > static_cast<decltype(i)>(-1); i--) #define rep2(i, a, b) for...
#pragma region header #include <bits/stdc++.h> #define int long long #define all(a) begin(a), end(a) #define rall(a) rbegin(a), rend(a) #define mp make_pair #define rep1(i, n) for (decltype(+n) i = 0; i < (n); i++) #define rrep1(i, n) for (auto i = n - 1; i > static_cast<decltype(i)>(-1); i--) #define rep2(i, a, b) for...
replace
201
203
201
207
0
p02567
C++
Runtime Error
/* #include <boost/multiprecision/cpp_dec_float.hpp> #include <boost/multiprecision/cpp_int.hpp> #include <boost/rational.hpp> */ // #include <atcoder/all> #include <bits/stdc++.h> using namespace std; // using namespace atcoder; #define _GLIBCXX_DEBUG #define rep(i, t) for (ll i = (ll)(0); i < (ll)(t); i++) #define r...
/* #include <boost/multiprecision/cpp_dec_float.hpp> #include <boost/multiprecision/cpp_int.hpp> #include <boost/rational.hpp> */ // #include <atcoder/all> #include <bits/stdc++.h> using namespace std; // using namespace atcoder; #define _GLIBCXX_DEBUG #define rep(i, t) for (ll i = (ll)(0); i < (ll)(t); i++) #define r...
replace
466
467
466
467
0
p02567
C++
Runtime Error
#line 1 "/workspaces/compro/lib/atcoder/segtree.hpp" #line 1 "/workspaces/compro/lib/atcoder/internal_bit.hpp" #ifdef _MSC_VER #include <intrin.h> #endif namespace atcoder { namespace internal { // @param n `0 <= n` // @return minimum non-negative `x` s.t. `n <= 2**x` int ceil_pow2(int n) { int x = 0; while ((...
#line 1 "/workspaces/compro/lib/atcoder/segtree.hpp" #line 1 "/workspaces/compro/lib/atcoder/internal_bit.hpp" #ifdef _MSC_VER #include <intrin.h> #endif namespace atcoder { namespace internal { // @param n `0 <= n` // @return minimum non-negative `x` s.t. `n <= 2**x` int ceil_pow2(int n) { int x = 0; while ((...
replace
238
239
238
239
0
p02567
C++
Runtime Error
/** * @FileName a.cpp * @Author kanpurin * @Created 2020.09.20 18:40:53 **/ #include "bits/stdc++.h" using namespace std; typedef long long ll; template <class Monoid> struct SegmentTree { private: using Func = std::function<Monoid(Monoid, Monoid)>; Func F; Monoid UNITY; int n; std::vector<Monoid>...
/** * @FileName a.cpp * @Author kanpurin * @Created 2020.09.20 18:40:53 **/ #include "bits/stdc++.h" using namespace std; typedef long long ll; template <class Monoid> struct SegmentTree { private: using Func = std::function<Monoid(Monoid, Monoid)>; Func F; Monoid UNITY; int n; std::vector<Monoid>...
replace
107
108
107
108
0
p02567
C++
Runtime Error
#include <bits/stdc++.h> #define endl "\n" using namespace std; #define ll long long #define ld long double #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repo(i, n) for (int i = 1; i < (int)(n); i++) #define pb push_back #define mp make_pair #define np next_permutation #define fi first #define se second ...
#include <bits/stdc++.h> #define endl "\n" using namespace std; #define ll long long #define ld long double #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repo(i, n) for (int i = 1; i < (int)(n); i++) #define pb push_back #define mp make_pair #define np next_permutation #define fi first #define se second ...
replace
2,022
2,023
2,022
2,023
0
p02567
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <deque> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <deque> #include <functional> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set...
replace
2,356
2,357
2,356
2,357
0
p02567
C++
Runtime Error
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #define _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #pragma comment(linker, "/STACK:526000000") #include "bits/stdc++.h" /* Here starts the AtCoder STL. */ #ifndef ATCODE...
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #define _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #pragma comment(linker, "/STACK:526000000") #include "bits/stdc++.h" /* Here starts the AtCoder STL. */ #ifndef ATCODE...
replace
2,491
2,492
2,491
2,492
0
p02567
C++
Runtime Error
#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...
replace
52
53
52
53
-6
munmap_chunk(): invalid pointer
p02567
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n - 1; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define ALL(v) v.begin(), v.end() #define SIZE(x) ll(x.size()) using P = pair<int, int>; template <class ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n - 1; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define ALL(v) v.begin(), v.end() #define SIZE(x) ll(x.size()) using P = pair<int, int>; template <class ...
replace
141
142
141
142
0
p02567
C++
Runtime Error
#include <bits/stdc++.h> #ifndef ATCODER_INTERNAL_BITOP_HPP #define ATCODER_INTERNAL_BITOP_HPP 1 #ifdef _MSC_VER #include <intrin.h> #endif namespace atcoder { namespace internal { // @param n `0 <= n` // @return minimum non-negative `x` s.t. `n <= 2**x` int ceil_pow2(int n) { int x = 0; while ((1U << x) < (unsign...
#include <bits/stdc++.h> #ifndef ATCODER_INTERNAL_BITOP_HPP #define ATCODER_INTERNAL_BITOP_HPP 1 #ifdef _MSC_VER #include <intrin.h> #endif namespace atcoder { namespace internal { // @param n `0 <= n` // @return minimum non-negative `x` s.t. `n <= 2**x` int ceil_pow2(int n) { int x = 0; while ((1U << x) < (unsign...
replace
1,992
1,993
1,992
1,993
0
p02567
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int INF = 1e9; const ll LINF = 1e18; inline ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } inline ll lcm(ll a, ll b) { return a / gcd(a, b) * b; } template <class S, class T> ostream &op...
#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int INF = 1e9; const ll LINF = 1e18; inline ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } inline ll lcm(ll a, ll b) { return a / gcd(a, b) * b; } template <class S, class T> ostream &op...
replace
164
165
164
165
0
p02567
C++
Runtime Error
// #define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; template <class T> struct SegTree { using FX = function<T(T, T)>; int n, _n; FX fx; const T ex; vector<T> dat; SegTree(int n_, FX fx_, T ex_) : fx(fx_), ex(ex_), n(1), _n(n_) { while (n < n_) n <<= 1; dat.assign((n << 1) ...
// #define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; template <class T> struct SegTree { using FX = function<T(T, T)>; int n, _n; FX fx; const T ex; vector<T> dat; SegTree(int n_, FX fx_, T ex_) : fx(fx_), ex(ex_), n(1), _n(n_) { while (n < n_) n <<= 1; dat.assign((n << 1) ...
replace
100
101
100
101
0
p02567
C++
Runtime Error
#ifndef ATCODER_INTERNAL_BITOP_HPP #define ATCODER_INTERNAL_BITOP_HPP 1 #ifdef _MSC_VER #include <intrin.h> #endif namespace atcoder { namespace internal { // @param n `0 <= n` // @return minimum non-negative `x` s.t. `n <= 2**x` int ceil_pow2(int n) { int x = 0; while ((1U << x) < (unsigned int)(n)) x++; ret...
#ifndef ATCODER_INTERNAL_BITOP_HPP #define ATCODER_INTERNAL_BITOP_HPP 1 #ifdef _MSC_VER #include <intrin.h> #endif namespace atcoder { namespace internal { // @param n `0 <= n` // @return minimum non-negative `x` s.t. `n <= 2**x` int ceil_pow2(int n) { int x = 0; while ((1U << x) < (unsigned int)(n)) x++; ret...
replace
1,988
1,989
1,988
1,989
0
p02567
C++
Runtime Error
// warm heart, wagging tail,and a smile just for you! // ███████████ // ███╬╬╬╬╬╬╬╬╬╬███ // ███╬╬╬╬╬████╬╬╬╬╬╬███ // ...
// warm heart, wagging tail,and a smile just for you! // ███████████ // ███╬╬╬╬╬╬╬╬╬╬███ // ███╬╬╬╬╬████╬╬╬╬╬╬███ // ...
replace
74
75
74
75
0
p02568
C++
Runtime Error
#include <iostream> #include <vector> using namespace std; // ax+b -> c(ax+b) + d = acx + bc + d const int MOD = 998244353; template <typename T, typename F, typename W = int> class LazySegTree { public: explicit LazySegTree(int n, T def, F unit) : N(calcN_(n)), def(def), unit(unit), mVal(2 * calcN_(n), def...
#include <iostream> #include <vector> using namespace std; // ax+b -> c(ax+b) + d = acx + bc + d const int MOD = 998244353; template <typename T, typename F, typename W = int> class LazySegTree { public: explicit LazySegTree(int n, T def, F unit) : N(calcN_(n)), def(def), unit(unit), mVal(2 * calcN_(n), def...
replace
81
82
81
82
0
p02570
C++
Runtime Error
#include <stdio.h> int main(void) { int d, t, s; printf("距離・待ち合わせ時刻・分速を入力..."); scanf("%d $d %d", &d, &t, &s); if (d / s <= t) { printf("Yes"); } else printf("No"); return 0; }
#include <stdio.h> int main(void) { int d, t, s; scanf("%d %d %d", &d, &t, &s); if (t * s >= d) { printf("Yes"); } else printf("No"); return 0; }
replace
3
6
3
5
-8
p02570
C++
Runtime Error
#include <iostream> int main(int args, char *argc[]) { int D = std::stoi(std::string(argc[1])); int T = std::stoi(std::string(argc[2])); int S = std::stoi(std::string(argc[3])); if (T * S >= D) std::cout << "Yes"; else std::cout << "No"; std::cout << std::endl; return 0; }
#include <iostream> int main(void) { int D, T, S; std::cin >> D >> T >> S; if (T * S >= D) std::cout << "Yes"; else std::cout << "No"; std::cout << std::endl; return 0; }
replace
2
6
2
5
-6
terminate called after throwing an instance of 'std::logic_error' what(): basic_string: construction from null is not valid
p02570
C++
Runtime Error
#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 sim template <class c #define ris return *this #define dor > debug &operator<< #define eni(x) ...
#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 sim template <class c #define ris return *this #define dor > debug &operator<< #define eni(x) ...
replace
77
91
77
83
0
p02570
C++
Runtime Error
#include <bits/stdc++.h> // #define int ll typedef long long ll; const int INF = 0x3f3f3f3f; const int mod = 1e9 + 7; const int MAX = 1e5 + 10; using namespace std; int solve() { int d, t, s; cin >> d >> t >> s; cout << (t * s >= d ? "Yes" : "No") << endl; } signed main() { // ios::sync_with_stdio(false);cin....
#include <bits/stdc++.h> // #define int ll typedef long long ll; const int INF = 0x3f3f3f3f; const int mod = 1e9 + 7; const int MAX = 1e5 + 10; using namespace std; int solve() { int d, t, s; cin >> d >> t >> s; cout << (t * s >= d ? "Yes" : "No") << endl; return 0; } signed main() { // ios::sync_with_stdio...
insert
12
12
12
13
0
p02570
C++
Runtime Error
#include <algorithm> #include <chrono> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> PII; typedef pair<ll, ll> PLL; #define INF 1000000000 #de...
#include <algorithm> #include <chrono> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> PII; typedef pair<ll, ll> PLL; #define INF 1000000000 #de...
replace
26
27
26
27
1
p02570
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; int main() { float d, t, s; scanf("%f %f %f", &d, &t, &s); return (d / s <= t); }
#include "bits/stdc++.h" using namespace std; int main() { float d, t, s; scanf("%f %f %f", &d, &t, &s); if (d / s <= t) { printf("Yes"); } else { printf("No"); } return 0; }
replace
5
6
5
11
1
p02570
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long int #define mod 1000000007 /* cout<<"\ndebugging\n"; */ int main() { ios_base::sync_with_stdio(false); // Fast I/O cin.tie(NULL); double t, n, i, j, d, s; cin >> d >> t >> s; if (d <= s * t) return true; return false; return 0; }...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define mod 1000000007 /* cout<<"\ndebugging\n"; */ int main() { ios_base::sync_with_stdio(false); // Fast I/O cin.tie(NULL); double t, n, i, j, d, s; cin >> d >> t >> s; if (d <= s * t) cout << "Yes"; else cout << "No"; ...
replace
18
20
18
21
1
p02570
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long int #define pb push_back #define mk make_pair #define mod 1000000007 int main() { string s, t; cin >> s >> t; int ans = INT_MAX; for (int i = 0; i < s.length() - t.length() + 1; i++) { string str = s.substr(i, i + t.length()); int c = 0;...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define pb push_back #define mk make_pair #define mod 1000000007 int main() { int d, t, s; cin >> d >> t >> s; if (d <= (t * s)) { cout << "Yes" << endl; } else cout << "No" << endl; }
replace
7
20
7
13
0
p02570
C++
Runtime Error
#include <cstdio> int main() { int d, t, s; scanf("%d %d %d", &d, &t, &s); return t * s >= d; }
#include <cstdio> int main() { int d, t, s; scanf("%d %d %d", &d, &t, &s); if (t * s >= d) { printf("Yes"); } else { printf("No"); } }
replace
6
7
6
11
1
p02570
Python
Runtime Error
D, T, S = list(map(input().split())) if D <= S * T: print("Yes") else: print("No")
D, T, S = list(map(int, input().split())) if D <= S * T: print("Yes") else: print("No")
replace
0
1
0
1
TypeError: map() must have at least two arguments.
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02570/Python/s822730167.py", line 1, in <module> D, T, S = list(map(input().split())) TypeError: map() must have at least two arguments.
p02570
Python
Runtime Error
d, t, s = int(input()) a = d / s print("Yes" if a <= t else "No")
d, t, s = map(int, input().split()) a = d / s print("Yes" if a <= t else "No")
replace
0
1
0
1
ValueError: invalid literal for int() with base 10: '1000 15 80'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02570/Python/s514222170.py", line 1, in <module> d, t, s = int(input()) ValueError: invalid literal for int() with base 10: '1000 15 80'
p02570
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string s, t, u; int ans, c; cin >> s >> t; for (int i = 0; i < s.size() - t.size() + 1; i++) { u = s.substr(i, t.size()); c = 0; for (int j = 0; j < t.size(); j++) { if (u[j] != t[j]) { c++; } } ans = min(1000, c)...
#include <bits/stdc++.h> using namespace std; int main() { double a, b, c; cin >> a >> b >> c; if (b >= a / c) { cout << "Yes"; } else cout << "No"; return 0; }
replace
3
17
3
9
0
p02570
C++
Runtime Error
#include <iostream> using namespace std; int main() { int d, t, s; cin >> d >> t >> s; double speed = d / (t * 1.0); cout << (s >= speed ? "Yes" : "No"); main(); return 0; }
#include <iostream> using namespace std; int main() { int d, t, s; cin >> d >> t >> s; double speed = d / (t * 1.0); cout << (s >= speed ? "Yes" : "No"); return 0; }
replace
11
12
11
12
-11
p02570
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int D, T, S; cin >> D, T, S; if (D / S < T) { cout << "Yes" << endl; } else { cout << "No" << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int D, T, S; cin >> D >> T >> S; if (T * S >= D) { cout << "Yes" << endl; } else { cout << "No" << endl; } }
replace
5
7
5
7
0
p02570
C++
Runtime Error
// #pragma GCC optimize("03,unroll-loops") // #pragma GCC target("avx,avx2,fma") #include <bits/stdc++.h> typedef long long ll; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ordered_set \ tree<int, null_type, less_equa...
// #pragma GCC optimize("03,unroll-loops") // #pragma GCC target("avx,avx2,fma") #include <bits/stdc++.h> typedef long long ll; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define ordered_set \ tree<int, null_type, less_equa...
replace
68
69
68
69
0
p02570
C++
Runtime Error
// #pragma GCC optimize("unroll-loops", "omit-frame-pointer", "inline") // #pragma GCC option("arch=native", "tune=native", "no-zero-upper") // #pragma GCC // target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native") // #pragma GCC optimize("Ofast") // #pragma GCC optimize("tree-vectorize","openmp","predic...
// #pragma GCC optimize("unroll-loops", "omit-frame-pointer", "inline") // #pragma GCC option("arch=native", "tune=native", "no-zero-upper") // #pragma GCC // target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native") // #pragma GCC optimize("Ofast") // #pragma GCC optimize("tree-vectorize","openmp","predic...
replace
77
89
77
83
0
p02571
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <cmath> #define ll long long #define PI 3.14159265358979323846 #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); ...
#include <bits/stdc++.h> #include <cmath> #define ll long long #define PI 3.14159265358979323846 #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); ...
replace
38
39
38
40
TLE
p02571
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int ns = s.size(); int nt = t.size(); vector<int> match(ns - nt + 1); match[0] = nt; for (int i = 0; i < ns - nt + 1; i++) { int mat = nt; for (int j = 0; j < nt; j++) { if (t[j] == s[i + j]) { ...
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int ns = s.size(); int nt = t.size(); vector<int> match(ns - nt + 2); match[0] = nt; for (int i = 0; i < ns - nt + 1; i++) { int mat = nt; for (int j = 0; j < nt; j++) { if (t[j] == s[i + j]) { ...
replace
9
10
9
10
0
p02571
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define FAST_IO \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) #define int long long int #define nl "...
#include <bits/stdc++.h> #define FAST_IO \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) #define int long long int #define nl "...
replace
15
16
15
16
TLE
p02571
C++
Runtime Error
#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...
replace
9
10
9
10
0
p02571
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { string s, t; int i = 0; int z = t.size(); while (s.size() - i >= t.size()) { int r = 0; for (int j = 0; j < t.size(); j++) if (s[i + j] != t[j]) r++; if (r < z) z = r; i++; } cout << z << endl; }
#include <iostream> using namespace std; int main() { string s, t; cin >> s >> t; int i = 0; int z = t.size(); while (s.size() - i >= t.size()) { int r = 0; for (int j = 0; j < t.size(); j++) if (s[i + j] != t[j]) r++; if (r < z) z = r; i++; } cout << z << endl; }
insert
5
5
5
6
TLE
p02571
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; int main() { string s; cin >> s; string t; cin >> t; int sl = s.length(); int tl = t.length(); vector<int> v(sl - tl); for (int i = 0; i < sl - tl; i++) { for (int j = 0; j < tl; j++)...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; int main() { string s; cin >> s; string t; cin >> t; int sl = s.length(); int tl = t.length(); vector<int> v(sl - tl + 1); for (int i = 0; i <= sl - tl; i++) { for (int j = 0; j < tl;...
replace
12
14
12
14
0
p02571
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long int; int main() { string S, T; cin >> S >> T; int N = S.size(); int M = T.size(); vector<int> V; int P = 0; for (int i = 0; i < N - M + 1; i++) { for (int j = 0; j < M; j++) { if (S.at(i + j) == T.at(j)) P++; } ...
#include <bits/stdc++.h> using namespace std; using ll = long long int; int main() { string S, T; cin >> S >> T; int N = S.size(); int M = T.size(); vector<int> V; int P = 0; for (int i = 0; i < N - M + 1; i++) { for (int j = 0; j < M; j++) { if (S.at(i + j) == T.at(j)) P++; } ...
replace
22
23
22
23
0
p02571
C++
Runtime Error
#include <iostream> using namespace std; int main() { string a, b; cin >> a >> b; int i, d = 0, c = 0, j; for (i = 0; i <= a.size() - b.size() - 1; i++) { c = 0; for (j = i; j <= i + b.size() - 1; j++) { if (a[j] == b[j - i]) { c++; } } if (c > d) { d = c; } } c...
#include <iostream> using namespace std; int main() { string a, b; cin >> a >> b; int i, d = 0, c = 0, j; for (i = 0; i <= a.size() - b.size(); i++) { c = 0; for (j = i; j <= i + b.size() - 1; j++) { if (a[j] == b[j - i]) { c++; } } if (c > d) { d = c; } } cout ...
replace
6
7
6
7
0
p02571
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define rep(i, N) for (int i = 0; i < (N); i++) #define erep(i, N) for (int i = N - 1; i >= 0; i--) const ll INF = 1000000000; const ll MOD = 1000000007; const ld PI = (acos(-1)); using Graph = vector<vector<int>>; template <cla...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define rep(i, N) for (int i = 0; i < (N); i++) #define erep(i, N) for (int i = N - 1; i >= 0; i--) const ll INF = 1000000000; const ll MOD = 1000000007; const ld PI = (acos(-1)); using Graph = vector<vector<int>>; template <cla...
replace
84
85
84
85
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 3) >= this->size() (which is 3)
p02571
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, a, b) for (int i = a; i < b; ++i) #define rrep(i, z, a) for (int i = z; i >= a; --i) #define rep0(n) for (int i = 0; i < n; ++i) #define rep1(n) for (int i = 1; i <= n; ++i) #define pb push_back #define sd(x) scanf("%d", &x) #define tc ...
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, a, b) for (int i = a; i < b; ++i) #define rrep(i, z, a) for (int i = z; i >= a; --i) #define rep0(n) for (int i = 0; i < n; ++i) #define rep1(n) for (int i = 1; i <= n; ++i) #define pb push_back #define sd(x) scanf("%d", &x) #define tc ...
insert
50
50
50
51
0
p02571
C++
Runtime Error
#pragma GCC optimize("O3") #pragma GCC target("sse4") // #include <bits/stdc++.h> #include <algorithm> #include <climits> #include <complex> #include <cstring> #include <deque> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <unordered_m...
#pragma GCC optimize("O3") #pragma GCC target("sse4") // #include <bits/stdc++.h> #include <algorithm> #include <climits> #include <complex> #include <cstring> #include <deque> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <unordered_m...
replace
90
92
90
92
0
p02571
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string b, t; cin >> b >> t; int ct = 0; int minct = t.size(); for (int i = 0; i < (int)b.size(); i++) { if (b.at(i) != t.at(0)) continue; for (int j = 0; j < (int)t.size(); j++) { if (b.at(i + j) != t.at(j)) { ct++; ...
#include <bits/stdc++.h> using namespace std; int main() { string b, t; cin >> b >> t; int ct = 0; int minct = t.size(); for (int i = 0; i < (int)b.size(); i++) { if (i + (int)t.size() > (int)b.size()) break; for (int j = 0; j < (int)t.size(); j++) { if (b.at(i + j) != t.at(j)) { ...
replace
9
11
9
11
0
p02571
C++
Runtime Error
// #include <tourist> #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> p; const int INF = 1e9; const ll LINF = ll(1e18); const int MOD = 1000000007; const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0}; const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0...
// #include <tourist> #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> p; const int INF = 1e9; const ll LINF = ll(1e18); const int MOD = 1000000007; const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0}; const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0...
replace
48
49
48
49
0
p02571
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define EPS (1e-7) #define INF (1e9) #define PI (acos(-1)) #define deg_to_rad(deg) (((deg) / 360) * 2 * M_PI) #define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360) #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i < (int)(n); i++) typ...
#include <bits/stdc++.h> using namespace std; #define EPS (1e-7) #define INF (1e9) #define PI (acos(-1)) #define deg_to_rad(deg) (((deg) / 360) * 2 * M_PI) #define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360) #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i < (int)(n); i++) typ...
replace
18
19
18
19
0
p02571
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (ll i = 0; i < n; i++) int main() { string S, T; cin >> S >> T; ll nS = S.size(); ll nT = T.size(); ll sameTS = 0; rep(i, i <= nS - nT) { ll j = 0; while (S[i + j] == T[j] && j < nT) j++; if (sameTS ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (ll i = 0; i < n; i++) int main() { string S, T; cin >> S >> T; ll nS = S.size(); ll nT = T.size(); ll sameTS = 0; for (ll i = 0; i <= nS - nT; i++) { ll sam = 0; for (ll j = 0; j < nT; j++) { if (S[i + ...
replace
11
17
11
19
TLE
p02571
C++
Runtime Error
#include <bits/stdc++.h> #include <cmath> using namespace std; #define coutv(v) \ for (int i = 0; i < (v).size(); ++i) \ cout << v[i] << ' '; \ cout << end...
#include <bits/stdc++.h> #include <cmath> using namespace std; #define coutv(v) \ for (int i = 0; i < (v).size(); ++i) \ cout << v[i] << ' '; \ cout << end...
replace
45
46
45
46
0
p02571
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string t, s; cin >> t >> s; int ans = t.size(); for (int start = 0; start <= s.size() - t.size(); start++) { int diff = 0; for (int i = 0; i < t.size(); i++) { if (t[i] != s[start + i]) { diff++; } } ans = min(ans,...
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int ans = t.size(); for (int start = 0; start <= s.size() - t.size(); start++) { int diff = 0; for (int i = 0; i < t.size(); i++) { if (t[i] != s[start + i]) { diff++; } } ans = min(ans,...
replace
4
6
4
6
-11
p02571
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; #define rep(i, n) for (int i = 0; i < (int)n; i++) #define PI acos(-1) #define fast_io \ ios_base::sync_with_stdio(false); ...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; #define rep(i, n) for (int i = 0; i < (int)n; i++) #define PI acos(-1) #define fast_io \ ios_base::sync_with_stdio(false); ...
replace
20
21
20
21
0
p02571
Python
Time Limit Exceeded
S = input() T = input() min_dist = 10**10 for i in range(len(S) - len(T) + 1): for k in range(len(T)): dist = sum(s != t for s, t in zip(S[i : i + len(T)], T)) min_dist = min(dist, min_dist) if min_dist == 0: print(0) exit() print(min_dist)
S = input() T = input() min_dist = 10**10 for i in range(len(S) - len(T) + 1): for k in range(len(T)): dist = 0 for s, t in zip(S[i : i + len(T)], T): if s != t: dist += 1 if dist >= min_dist: break min_dist = min(dist, min_dist) ...
replace
6
7
6
13
TLE
p02571
Python
Runtime Error
#!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3 s = input() t = input() a = [] for i in range(len(s) - len(t)): cnt = 0 for j in range(len(t)): if t[j] == s[i + j]: cnt += 1 a.append(cnt) print(len(t) - max(a))
#!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3 s = input() t = input() a = [] for i in range(len(s) - len(t) + 1): cnt = 0 for j in range(len(t)): if t[j] == s[i + j]: cnt += 1 a.append(cnt) print(len(t) - max(a))
replace
6
7
6
7
0
p02571
Python
Runtime Error
s = input().strip() t = input().strip() if t in s: print(0) else: ans = 1000 for i in range(len(s) - len(t) - 1): count = len(t) - 1 for j in range(len(t) - 1): if s[i + j] == t[i]: count -= 1 ans = min(count, ans) print(ans)
s = input().strip() t = input().strip() if t in s: print(0) else: ans = 10001 for i in range(len(s) - len(t) + 1): count = 0 cnt = i for j in range(len(t)): if s[cnt] != t[j]: count += 1 cnt += 1 ans = min(count, ans) print(ans)
replace
6
12
6
14
0
p02571
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; using P = pair<int, int>; int main() { string s, t; cin >> s >> t; int i = 0; vector<int> zure(s.size() - t.size(), 0); do { rep(j, t.size()) { if (s[i + j] != t[j]) { zur...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; using P = pair<int, int>; int main() { string s, t; cin >> s >> t; int i = 0, sz; if (s.size() == t.size()) { sz = 1; } else { sz = s.size() - t.size(); } vector<int> zure(sz, 0...
replace
8
10
8
15
0
p02571
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define fast_IO \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define endl '\...
#include <bits/stdc++.h> using namespace std; #define fast_IO \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define endl '\...
replace
35
37
35
37
0
p02571
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string S, T; cin >> S >> T; int ans = T.size(); for (int i = 0; i < S.size() - T.size() + 1; i++) { int count = 0; for (int j = 0; j < T.size(); j++) { if (T.at(i) != S.at(i + j)) count++; } ans = min(ans, count); } ...
#include <bits/stdc++.h> using namespace std; int main() { string S, T; cin >> S >> T; int ans = T.size(); for (int i = 0; i < S.size() - T.size() + 1; i++) { int count = 0; for (int j = 0; j < T.size(); j++) { if (T.at(j) != S.at(i + j)) count++; } ans = min(ans, count); } ...
replace
12
13
12
13
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 3) >= this->size() (which is 3)
p02571
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; const int maxn = 100000 + 5; // ------------------------------------ vector<int> v; // ------------------------------------ // 1 is tru int main() { string s, t, subs; int a = 0; cin >> s >> t; for (int i = 0; i < s.length(); i++) { for (...
#include <bits/stdc++.h> using namespace std; using ll = long long; const int maxn = 100000 + 5; // ------------------------------------ vector<int> v; // ------------------------------------ // 1 is tru int main() { string s, t, subs; int a = 0; cin >> s >> t; v.push_back(t.length()); for (int i = 0; i < s...
insert
13
13
13
14
0
p02571
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; void __print(int x) { cerr << x; } void __print(long x) { cerr << x; } void __print(long long x) { cerr << x; } void __print(unsigned x) { cerr << x; } void __print(unsigned long x) { cerr << x; } void __print(unsigned long long x) { cerr << x; } void...
#include <bits/stdc++.h> using namespace std; typedef long long ll; void __print(int x) { cerr << x; } void __print(long x) { cerr << x; } void __print(long long x) { cerr << x; } void __print(unsigned x) { cerr << x; } void __print(unsigned long x) { cerr << x; } void __print(unsigned long long x) { cerr << x; } void...
delete
54
55
54
54
0
p02571
C++
Runtime Error
#include <bits/stdc++.h> typedef uint64_t u64; typedef int64_t i64; typedef uint32_t u32; typedef int32_t i32; #define MAX_NUM (1000000007) #define PI 3.14159265358979323846 using namespace std; template <typename T> static inline void ArrayInput(vector<T> &A) { for (auto itr = A.begin(); itr < A.end(); ++itr) ...
#include <bits/stdc++.h> typedef uint64_t u64; typedef int64_t i64; typedef uint32_t u32; typedef int32_t i32; #define MAX_NUM (1000000007) #define PI 3.14159265358979323846 using namespace std; template <typename T> static inline void ArrayInput(vector<T> &A) { for (auto itr = A.begin(); itr < A.end(); ++itr) ...
replace
193
194
193
194
0
p02571
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int kekka, kari; kekka = 0; kari = 0; string iti, ni; cin >> iti >> ni; for (int i = 0; i < iti.size() - ni.size(); i++) { for (int s = 0; s <= ni.size(); s++) { if (iti.at(i + s) == ni.at(s)) { kari++; } } if (kekka...
#include <bits/stdc++.h> using namespace std; int main() { int kekka, kari; kekka = 0; kari = 0; string iti, ni; cin >> iti >> ni; for (int i = 0; i <= iti.size() - ni.size(); i++) { for (int s = 0; s < ni.size(); s++) { if (iti.at(i + s) == ni.at(s)) { kari++; } } if (kekka...
replace
9
11
9
11
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 3) >= this->size() (which is 3)
p02571
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const long long MOD = 1000000007; const long long INF = 9999999999999999; using ll = long long; int main() { string s, t; cin >> s >> t; int ans = MOD; int temp = 0; for (int i = 0; i < (s.size() - t.size() - 1); i++) { temp = 0; for (int k = 0; k < t.size...
#include <bits/stdc++.h> using namespace std; const long long MOD = 1000000007; const long long INF = 9999999999999999; using ll = long long; int main() { string s, t; cin >> s >> t; int ans = MOD; int temp = 0; if (s.size() == t.size()) { for (int i = 0; i < s.size(); i++) { if (s.at(i) != t.at(i))...
replace
10
11
10
19
0
p02571
C++
Runtime Error
#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) { ...
replace
14
15
14
15
0
p02571
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define make_it_fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL) #define mp m...
#include <bits/stdc++.h> using namespace std; #define make_it_fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.tie(NULL) #define mp m...
replace
86
87
86
87
0
p02571
C++
Runtime Error
#include <bits/stdc++.h> #define LL long long #define MOD 1000000007 #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; LL gcd(LL C, LL D) { if (C < D) gcd(D, C); if (C % D == 0) return D; else gcd(D, C % D); } int main() { string s, t; int ans = 0; cin >> s >> t; for (...
#include <bits/stdc++.h> #define LL long long #define MOD 1000000007 #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; LL gcd(LL C, LL D) { if (C < D) gcd(D, C); if (C % D == 0) return D; else gcd(D, C % D); } int main() { string s, t; int ans = 0; cin >> s >> t; for (...
replace
33
34
33
35
1
p02571
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int e = s.size(); int b = t.size(); int c = 0; int m = 0; for (int i = 0; i <= e - b; i++) { for (int j = 0; j < b; i++) { if (t[j] == s[j + i]) { c++; } } m = max(m, c); c = 0; } ...
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int e = s.size(); int b = t.size(); int c = 0; int m = 0; for (int i = 0; i <= e - b; i++) { for (int j = 0; j < b; j++) { if (t[j] == s[j + i]) { c++; } } m = max(m, c); c = 0; } ...
replace
10
11
10
11
TLE
p02571
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int minx = 1001; for (int i = 0; i < s.size() - t.size() - 1; i++) { int x = 0; for (int j = 0; j < t.size(); j++) { if (t.at(j) != s.at(i + j)) { x += 1; } } minx = min(minx, x); } cou...
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int minx = 10000; for (int i = 0; i < s.size() - t.size() + 1; i++) { int x = 0; for (int j = 0; j < t.size(); j++) { if (t.at(j) != s.at(i + j)) { x += 1; } } minx = min(minx, x); } co...
replace
5
7
5
7
0
p02571
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define sort(v) sort(v.begin(), v.end()) #define pb push_back /* ll ar[1000000+9]={0}; void seiv() { ll n=1000000,i,j; ar[1]=1; for(i=4;i<=n;i+=2)ar[i]=1; for(i=3;i<=n;i+=2) { if(ar[i]==0) { for(j=i*i;j<=n;j+=i*2)ar[j]=1; } } }*/ int main() { string ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define sort(v) sort(v.begin(), v.end()) #define pb push_back /* ll ar[1000000+9]={0}; void seiv() { ll n=1000000,i,j; ar[1]=1; for(i=4;i<=n;i+=2)ar[i]=1; for(i=3;i<=n;i+=2) { if(ar[i]==0) { for(j=i*i;j<=n;j+=i*2)ar[j]=1; } } }*/ int main() { string ...
replace
22
23
22
23
0
p02571
C++
Runtime Error
#define _USE_MATH_DEFINES // M_PI等のフラグ #include <algorithm> #include <bitset> #include <cmath> #include <cstdlib> #include <cstring> #include <iostream> #include <list> #include <map> #include <string> #include <vector> #define MOD 1000000007 #define COUNTOF(array) (sizeof(array) / sizeof(array[0])) using namespace ...
#define _USE_MATH_DEFINES // M_PI等のフラグ #include <algorithm> #include <bitset> #include <cmath> #include <cstdlib> #include <cstring> #include <iostream> #include <list> #include <map> #include <string> #include <vector> #define MOD 1000000007 #define COUNTOF(array) (sizeof(array) / sizeof(array[0])) using namespace ...
replace
23
24
23
24
0
p02572
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define gc getchar_unlocked #define fo(i, n) for (int i = 0; i < n; i++) #define ll long long #define deb(x) cout << #x << "=" << x << endl #define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl #define all(x) x.begin(), x.end() #define clr(x) memset(x, ...
#include <bits/stdc++.h> using namespace std; #define gc getchar_unlocked #define fo(i, n) for (int i = 0; i < n; i++) #define ll long long #define deb(x) cout << #x << "=" << x << endl #define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl #define all(x) x.begin(), x.end() #define clr(x) memset(x, ...
replace
30
35
30
43
TLE
p02572
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<long long> V(N); for (int i = 0; i < N; i++) { cin >> V.at(i); } long long C = 1000000007; long long Sum = 0; for (int i = 0; i < N; i++) { for (int j = (i + 1); j < N; j++) { Sum += (V.at(i) * V.at(j)) % C...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<long long> V(N); for (int i = 0; i < N; i++) { cin >> V.at(i); } long long C = 1000000007; long long Sum = 0; vector<long long> W(N - 1); W.at(0) = V.at(0); for (int i = 1; i < N - 1; i++) { W.at(i) = W.at(i ...
replace
12
16
12
19
TLE
p02572
C++
Runtime Error
#include <bits/stdc++.h> #define rep(X, N) for (ll X = 0LL; X < (N); X++) #define ALL(V) (V).begin(), (V).end() #define endl "\n" using namespace std; typedef long long ll; const double PI = 3.1415926535897932384626; const ll MODN = 1000000007; const ll MODN2 = 998244353; const double EPS = 1e-10; int main() { i...
#include <bits/stdc++.h> #define rep(X, N) for (ll X = 0LL; X < (N); X++) #define ALL(V) (V).begin(), (V).end() #define endl "\n" using namespace std; typedef long long ll; const double PI = 3.1415926535897932384626; const ll MODN = 1000000007; const ll MODN2 = 998244353; const double EPS = 1e-10; int main() { i...
replace
31
32
31
33
0
p02572
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll mod = 1000000007; int main() { ll n; cin >> n; vector<ll> a(n); for (ll i = 0; i < n; ++i) { cin >> a[i]; } vector<ll> sum(n, 0); sum[0] = 0; for (ll i = 0; i < n; ++i) { sum[i + 1] = (sum[i] + a[n - 1 - i]) % mod; } ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll mod = 1000000007; int main() { ll n; cin >> n; vector<ll> a(n); for (ll i = 0; i < n; ++i) { cin >> a[i]; } vector<ll> sum(n, 0); sum[0] = 0; for (ll i = 0; i < n - 1; ++i) { sum[i + 1] = (sum[i] + a[n - 1 - i]) % mod; ...
replace
13
14
13
14
-6
Fatal glibc error: malloc assertion failure in sysmalloc: (old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)