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
p02644
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define FOR(i, a, b) for (auto i = a; i <= b; ++i) #define REP(i, a, b) for (auto i = a; i < b; ++i) #define FORI(i, a, b) \ for (auto i = a; i != b + 1 - 2 * (a > b); i += 1 - 2 * (a > b)) #define REPI(i, a, b) ...
#include <bits/stdc++.h> #define FOR(i, a, b) for (auto i = a; i <= b; ++i) #define REP(i, a, b) for (auto i = a; i < b; ++i) #define FORI(i, a, b) \ for (auto i = a; i != b + 1 - 2 * (a > b); i += 1 - 2 * (a > b)) #define REPI(i, a, b) ...
replace
174
177
174
180
TLE
p02644
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; constexpr int INF = 1000000000; constexpr int AREA_MAX = 100010; char flatGrid[AREA_MAX]; set<int> byRow[AREA_MAX], byCol[AREA_MAX]; int main() { int h, w, k; scanf("%d %d %d", &h, &w, &k); int x1, y1, x2, y2; scanf("%d %d %d %d", &x1, &y1, &x2, &y2); --x1, --y...
#include <bits/stdc++.h> using namespace std; constexpr int INF = 1000000000; constexpr int AREA_MAX = 1000010; char flatGrid[AREA_MAX]; set<int> byRow[AREA_MAX], byCol[AREA_MAX]; int main() { int h, w, k; scanf("%d %d %d", &h, &w, &k); int x1, y1, x2, y2; scanf("%d %d %d %d", &x1, &y1, &x2, &y2); --x1, --...
replace
4
5
4
5
0
p02644
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<double, double> pdd; // typedef vector<vector<ll>> Graph; const ll mod = 1e9 + 7; // const ll mod = 998244353; #define REP(i, n) for (ll i = 0; i < (l...
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<double, double> pdd; // typedef vector<vector<ll>> Graph; const ll mod = 1e9 + 7; // const ll mod = 998244353; #define REP(i, n) for (ll i = 0; i < (l...
insert
121
121
121
123
TLE
p02644
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int INF = 1e9; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; int main() { int H, W, K; cin >> H >> W >> K; vector<vector<int>> c(H + 2, vector<int>(W + 2)); vector<vector<int>> d(H + 2, vector<int>(W + 2, INF)); int x1, y1, x...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int INF = 1e9; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; int main() { int H, W, K; cin >> H >> W >> K; vector<vector<int>> c(H + 2, vector<int>(W + 2)); vector<vector<int>> d(H + 2, vector<int>(W + 2, INF)); int x1, y1, x...
replace
41
42
41
42
TLE
p02644
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using piii = pair<ll, pii>; ll solve() { ll H, W, K; ll x1, y1, x2, y2; cin >> H >> W >> K; cin >> x1 >> y1 >> x2 >> y2; x1--, y1--, x2--, y2--; vector<string> C(H); for (int i = 0; i < H; i++) { cin >> C[...
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using piii = pair<ll, pii>; ll solve() { ll H, W, K; ll x1, y1, x2, y2; cin >> H >> W >> K; cin >> x1 >> y1 >> x2 >> y2; x1--, y1--, x2--, y2--; vector<string> C(H); for (int i = 0; i < H; i++) { cin >> C[...
replace
40
41
40
41
TLE
p02644
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, a, b) for (int i = a; i < b; ++i) #define all(c) c.begin(), c.end() #define gmax(x, y) x = max(x, y) #define gmin(x, y) x = min(x, y) #define gadd(x, y) x = add(x, y) #define gmul(x, y) x = mul(x, y) using namespace std; typedef pair<int, int> pii; typedef long long ll; typedef ...
#include <bits/stdc++.h> #define rep(i, a, b) for (int i = a; i < b; ++i) #define all(c) c.begin(), c.end() #define gmax(x, y) x = max(x, y) #define gmin(x, y) x = min(x, y) #define gadd(x, y) x = add(x, y) #define gmul(x, y) x = mul(x, y) using namespace std; typedef pair<int, int> pii; typedef long long ll; typedef ...
replace
38
40
38
42
TLE
p02644
C++
Time Limit Exceeded
#ifndef COMPETITIVE_HEADER #pragma GCC optimize("Ofast") #ifdef ONLINE_JUDGE #pragma GCC target("avx512f") #else #pragma GCC target("avx") #endif //---------------------------- #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define int ll #define FOR(i, j, n) for (...
#ifndef COMPETITIVE_HEADER #pragma GCC optimize("Ofast") #ifdef ONLINE_JUDGE #pragma GCC target("avx512f") #else #pragma GCC target("avx") #endif //---------------------------- #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define int ll #define FOR(i, j, n) for (...
insert
71
71
71
72
TLE
p02644
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define ll long long #define ld long double #define mk make_pair #define fi first #define se second #define vll vector<ll> #define pii pair<ll, ll> #define vvll vector<vector<ll>> #define pb push_back #define sz(v) (ll)(v).size() #define inf 1e18 #define md 1e9 + 7 #define all(v) (v).begin(), (...
#include <bits/stdc++.h> #define ll long long #define ld long double #define mk make_pair #define fi first #define se second #define vll vector<ll> #define pii pair<ll, ll> #define vvll vector<vector<ll>> #define pb push_back #define sz(v) (ll)(v).size() #define inf 1e18 #define md 1e9 + 7 #define all(v) (v).begin(), (...
replace
78
79
78
79
TLE
p02644
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define _USE_MATH_DEFINES using namespace std; #define ll long long int #define pb push_back #define rep(i, j, n) for (ll i = j; i < n; i++) #define per(i, j, n) for (ll i = j; i >= n; i--) #define all(x) x.begin(), x.end() typedef pair<int, int> pii; typedef pair<ll, ll> pl; typedef vector<in...
#include <bits/stdc++.h> #define _USE_MATH_DEFINES using namespace std; #define ll long long int #define pb push_back #define rep(i, j, n) for (ll i = j; i < n; i++) #define per(i, j, n) for (ll i = j; i >= n; i--) #define all(x) x.begin(), x.end() typedef pair<int, int> pii; typedef pair<ll, ll> pl; typedef vector<in...
insert
43
43
43
45
TLE
p02644
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rrep(i, n) for (int i = (int)(n - 1); i >= 0; i--) #define all(x) (x).begin(), (x).end() #define sz(x) int(x.size()) #define get_unique(x) x.erase(unique(all(x)), x.end()); typedef long long ll; typedef complex<do...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rrep(i, n) for (int i = (int)(n - 1); i >= 0; i--) #define all(x) (x).begin(), (x).end() #define sz(x) int(x.size()) #define get_unique(x) x.erase(unique(all(x)), x.end()); typedef long long ll; typedef complex<do...
replace
66
68
66
70
TLE
p02644
C++
Time Limit Exceeded
// https://atcoder.jp/contests/abc170/tasks/abc170_f #include <bits/stdc++.h> using namespace std; #define watch(x) cerr << (#x) << " is " << (x) << endl; #define endl '\n' #define ll long long #define pld pair<ld, ld> #define pii pair<int, int> #define fi first #define se second const vector<pii> dirs = {{1, 0}, {-1...
// https://atcoder.jp/contests/abc170/tasks/abc170_f #include <bits/stdc++.h> using namespace std; #define watch(x) cerr << (#x) << " is " << (x) << endl; #define endl '\n' #define ll long long #define pld pair<ld, ld> #define pii pair<int, int> #define fi first #define se second const vector<pii> dirs = {{1, 0}, {-1...
replace
34
35
34
35
TLE
p02644
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long i64; const int MAX = 1e6 + 10; const int MOD = 1e9 + 7; const int oo = 1e9; int main() { ios::sync_with_stdio(false); cin.tie(0); #define endl '\n' int h, w, k; cin >> h >> w >> k; int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2; vector<vect...
#include <bits/stdc++.h> using namespace std; typedef long long i64; const int MAX = 1e6 + 10; const int MOD = 1e9 + 7; const int oo = 1e9; int main() { ios::sync_with_stdio(false); cin.tie(0); #define endl '\n' int h, w, k; cin >> h >> w >> k; int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2; vector<vect...
insert
47
47
47
49
TLE
p02644
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int H, W, K; int sx, sy, ex, ey; int dx[] = {1, -1, 0, 0}; int dy[] = {0, 0, 1, -1}; int main(void) { cin >> H >> W >> K; vector<vector<char>> c(H, vector<char>(W)); vector<vector<int>> dp(H, vector<int>(W)); for (int i = 0; i < H; i++) { for (int j = 0; j < W;...
#include <bits/stdc++.h> using namespace std; int H, W, K; int sx, sy, ex, ey; int dx[] = {1, -1, 0, 0}; int dy[] = {0, 0, 1, -1}; int main(void) { cin >> H >> W >> K; vector<vector<char>> c(H, vector<char>(W)); vector<vector<int>> dp(H, vector<int>(W)); for (int i = 0; i < H; i++) { for (int j = 0; j < W;...
replace
38
39
38
39
TLE
p02644
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; #define DUMP(x) cout << #x << " = " << (x) << endl; #define FOR(i, m, n) for (ll i = m; i < n; i++) #define IFOR(i, m, n) for (ll i = n - 1; i >= m; i--) #define REP(i, n) FOR(i, 0, n) #define IREP(i, n) IFOR(i, 0, n) #define FO...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; #define DUMP(x) cout << #x << " = " << (x) << endl; #define FOR(i, m, n) for (ll i = m; i < n; i++) #define IFOR(i, m, n) for (ll i = n - 1; i >= m; i--) #define REP(i, n) FOR(i, 0, n) #define IREP(i, n) IFOR(i, 0, n) #define FO...
replace
44
46
44
49
TLE
p02644
C++
Time Limit Exceeded
#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 ll long long #define X first #define Y second #define all(x) x.begin(), x.end() #define ordered_set ...
#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 ll long long #define X first #define Y second #define all(x) x.begin(), x.end() #define ordered_set ...
insert
101
101
101
105
TLE
p02644
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; const int dx[4] = {-1, 1, 0, 0}, dy[4] = {0, 0, -1, 1}; int n, m, k, x1, x2, h1, y2; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> n >> m >> k >> x1 >> h1 >> x2 >> y2; x1--; h1--; x2--; y2--; char grid[n + 10][m + 10]; int dis...
#include <bits/stdc++.h> using namespace std; const int dx[4] = {-1, 1, 0, 0}, dy[4] = {0, 0, -1, 1}; int n, m, k, x1, x2, h1, y2; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> n >> m >> k >> x1 >> h1 >> x2 >> y2; x1--; h1--; x2--; y2--; char grid[n + 10][m + 10]; int dis...
insert
41
41
41
43
TLE
p02644
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define debug(n) cerr << #n << ':' << n << endl; #define dline cerr << __LINE__ << endl; using ll = long long; template <class T, class U> using P = pair<T, U>; template <class T> using Heap = priority_queue<T>; template <class T> using heaP = priority_queue<T, vector<T>...
#include <bits/stdc++.h> using namespace std; #define debug(n) cerr << #n << ':' << n << endl; #define dline cerr << __LINE__ << endl; using ll = long long; template <class T, class U> using P = pair<T, U>; template <class T> using Heap = priority_queue<T>; template <class T> using heaP = priority_queue<T, vector<T>...
insert
67
67
67
69
TLE
p02644
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, n, m) for (int i = (int)(n); i <= (int)(m); i++) #define RFOR(i, n, m) for (int i = (int)(n); i >= (int)(m); i--) #define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++) #define RITR(x, c) for (__typeof(c....
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, n, m) for (int i = (int)(n); i <= (int)(m); i++) #define RFOR(i, n, m) for (int i = (int)(n); i >= (int)(m); i--) #define ITR(x, c) for (__typeof(c.begin()) x = c.begin(); x != c.end(); x++) #define RITR(x, c) for (__typeof(c....
replace
71
72
71
73
TLE
p02644
C++
Time Limit Exceeded
#include <cstdio> #include <iostream> #include <vector> using namespace std; int H, w, k, X, Y, xx, yy, maxx = 23333333; int q[4] = {-1, 0, 1, 0}; int p[4] = {0, 1, 0, -1}; vector<int> l[3]; int main(void) { cin >> H >> w >> k >> xx >> yy >> X >> Y; xx--; yy--; X--; Y--; char c[H][w]; int f[H][w]; for (...
#include <cstdio> #include <iostream> #include <vector> using namespace std; int H, w, k, X, Y, xx, yy, maxx = 23333333; int q[4] = {-1, 0, 1, 0}; int p[4] = {0, 1, 0, -1}; vector<int> l[3]; int main(void) { cin >> H >> w >> k >> xx >> yy >> X >> Y; xx--; yy--; X--; Y--; char c[H][w]; int f[H][w]; for (...
replace
36
41
36
43
TLE
p02644
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; template <typename T1, typename T2> bool chmin(T1 &a, T2 b) { if (a <= b) return 0; a = b; return 1; } template <typename T1, typename T2> bool chmax(T1 &a, T2 b) { if (a >= b) return 0; a = b; return 1; } int dx[4] = {0, 1, -1, 0};...
#include <bits/stdc++.h> using namespace std; typedef long long ll; template <typename T1, typename T2> bool chmin(T1 &a, T2 b) { if (a <= b) return 0; a = b; return 1; } template <typename T1, typename T2> bool chmax(T1 &a, T2 b) { if (a >= b) return 0; a = b; return 1; } int dx[4] = {0, 1, -1, 0};...
replace
117
118
117
118
TLE
p02644
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <queue> #include <vector> using namespace std; using piii = pair<int, pair<int, int>>; const int N = 1000005; char g[N]; // char g[N][N]; int dx[] = {-1, 1, 0, 0}; int dy[] = {0, 0, -1, 1}; bool check(vector<vector<int>> &g, int y...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #include <queue> #include <vector> using namespace std; using piii = pair<int, pair<int, int>>; const int N = 1000005; char g[N]; // char g[N][N]; int dx[] = {-1, 1, 0, 0}; int dy[] = {0, 0, -1, 1}; bool check(vector<vector<int>> &g, int y...
replace
78
79
78
79
-11
p02644
C++
Time Limit Exceeded
// #include <bits/stdc++.h> #include <algorithm> #include <cstdio> #include <cstdlib> #include <iostream> #include <map> #include <queue> #include <string> #include <vector> using namespace std; typedef long long ll; typedef vector<int> vint; typedef vector<vector<int>> vvint; typedef vector<long long> vll, vLL; type...
// #include <bits/stdc++.h> #include <algorithm> #include <cstdio> #include <cstdlib> #include <iostream> #include <map> #include <queue> #include <string> #include <vector> using namespace std; typedef long long ll; typedef vector<int> vint; typedef vector<vector<int>> vvint; typedef vector<long long> vll, vLL; type...
replace
87
88
87
89
TLE
p02644
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define For(i, a, b) for (int(i) = (int)(a); (i) < (int)(b); ++(i)) #define rFor(i, a, b) for (int(i) = (int)(a)-1; (i) >= (int)(b); --(i)) #define rep(i, n) For((i), 0, (n)) #define rrep(i, n) rFor((i), (n), 0) #define fi first #define se second using namespace std; typedef long long lint; typ...
#include <bits/stdc++.h> #define For(i, a, b) for (int(i) = (int)(a); (i) < (int)(b); ++(i)) #define rFor(i, a, b) for (int(i) = (int)(a)-1; (i) >= (int)(b); --(i)) #define rep(i, n) For((i), 0, (n)) #define rrep(i, n) rFor((i), (n), 0) #define fi first #define se second using namespace std; typedef long long lint; typ...
replace
68
70
68
70
TLE
p02644
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; const int INF = 1001001001001001001; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; int main() { int H, W; long long K; cin >> H >> W >> K; int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2; --x1; --y1; --x2; --y2; vector<vector<char>> c(H, vecto...
#include <bits/stdc++.h> using namespace std; const int INF = 1001001001001001001; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; int main() { int H, W; long long K; cin >> H >> W >> K; int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2; --x1; --y1; --x2; --y2; vector<vector<char>> c(H, vecto...
replace
38
40
38
42
TLE
p02644
C++
Time Limit Exceeded
#include <bits/stdc++.h> using ll = long long; using ull = unsigned long long; using namespace std; constexpr int MAX = 1000000; constexpr int inf = 1 << 30; int h, w, k; int main() { cin.tie(nullptr); std::ios::sync_with_stdio(false); cin >> h >> w >> k; vector<string> m(h); int sx, sy, gx, gy; cin >> s...
#include <bits/stdc++.h> using ll = long long; using ull = unsigned long long; using namespace std; constexpr int MAX = 1000000; constexpr int inf = 1 << 30; int h, w, k; int main() { cin.tie(nullptr); std::ios::sync_with_stdio(false); cin >> h >> w >> k; vector<string> m(h); int sx, sy, gx, gy; cin >> s...
replace
43
44
43
45
TLE
p02644
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; const int INF = 1 << 30; const vector<int> dx = {1, -1, 0, 0}, dy = {0, 0, 1, -1}; template <typename T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; } int main() { ios::sync_with_stdio(false); cin.tie(0); int H, W,...
#include <bits/stdc++.h> using namespace std; const int INF = 1 << 30; const vector<int> dx = {1, -1, 0, 0}, dy = {0, 0, 1, -1}; template <typename T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; } int main() { ios::sync_with_stdio(false); cin.tie(0); int H, W,...
insert
48
48
48
50
TLE
p02644
C++
Time Limit Exceeded
/* * Author: heyuhhh * Created Time: 2020/6/22 14:05:49 */ #include <algorithm> #include <assert.h> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <vector> #define MP make_...
/* * Author: heyuhhh * Created Time: 2020/6/22 14:05:49 */ #include <algorithm> #include <assert.h> #include <cmath> #include <cstdio> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <vector> #define MP make_...
delete
106
110
106
106
TLE
p02644
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } using ll = long long; const int dx[4] = {1, 0, -1, 0}; ...
#include <bits/stdc++.h> using namespace std; template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } using ll = long long; const int dx[4] = {1, 0, -1, 0}; ...
replace
39
40
39
40
TLE
p02644
C++
Time Limit Exceeded
#include <algorithm> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <memory> #include <queue> #include <set> #include <sstream> #include <stack> #include...
#include <algorithm> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <memory> #include <queue> #include <set> #include <sstream> #include <stack> #include...
insert
66
66
66
69
TLE
p02644
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; typedef u...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; typedef u...
insert
80
80
80
82
TLE
p02644
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int N = 200005; int n, m, k; vector<vector<char>> mat; vector<vector<int>> dist; set<int> r[N], c[N]; void bfs(int x1, int y1, int x2, int y2) { dist.assign(n, vector<int>(m, -1)); dist[x1][y1] = 0; queue<pair<int, int>> q; r[x1].erase(y1); c[y1].erase(...
#include <bits/stdc++.h> using namespace std; const int N = 1000006; int n, m, k; vector<vector<char>> mat; vector<vector<int>> dist; set<int> r[N], c[N]; void bfs(int x1, int y1, int x2, int y2) { dist.assign(n, vector<int>(m, -1)); dist[x1][y1] = 0; queue<pair<int, int>> q; r[x1].erase(y1); c[y1].erase...
replace
4
5
4
5
0
p02644
C++
Time Limit Exceeded
// header{{{ #pragma GCC optimize("Ofast") #include <bits/stdc++.h> // #include<boost/multiprecision/cpp_int.hpp> // #include<boost/math/common_factor_rt.hpp> // #include<boost/multiprecision/cpp_dec_float.hpp> using namespace std; // using namespace boost; // using namespace multiprecision; #define rep(i, n) for (in...
// header{{{ #pragma GCC optimize("Ofast") #include <bits/stdc++.h> // #include<boost/multiprecision/cpp_int.hpp> // #include<boost/math/common_factor_rt.hpp> // #include<boost/multiprecision/cpp_dec_float.hpp> using namespace std; // using namespace boost; // using namespace multiprecision; #define rep(i, n) for (in...
insert
89
89
89
91
TLE
p02644
C++
Time Limit Exceeded
/*input 1 6 4 1 1 1 6 ...... */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <unistd.h> #define rep(i, j, n) for (i = j; i < n; i++) #define repi(i, j, n) for (i = j; i > n; i--) #define inf 1e9 #define M 1000000007 #define pie 3.141592653589793238 #d...
/*input 1 6 4 1 1 1 6 ...... */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <unistd.h> #define rep(i, j, n) for (i = j; i < n; i++) #define repi(i, j, n) for (i = j; i > n; i--) #define inf 1e9 #define M 1000000007 #define pie 3.141592653589793238 #d...
insert
93
93
93
95
TLE
p02644
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; // template {{{ #define range(i, l, r) for (int i = (int)(l); i < (int)(r); (i) += 1) #define rrange(i, l, r) for (int i = (int)(r)-1; i >= (int)(l); (i) -= 1) #define whole(f, x, ...) \ ([&](decltype((x)) container)...
#include <bits/stdc++.h> using namespace std; // template {{{ #define range(i, l, r) for (int i = (int)(l); i < (int)(r); (i) += 1) #define rrange(i, l, r) for (int i = (int)(r)-1; i >= (int)(l); (i) -= 1) #define whole(f, x, ...) \ ([&](decltype((x)) container)...
replace
120
122
120
124
TLE
p02644
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define __ \ ios_base::sync_with_stdio(0); \ cin.tie(0); #define fi first #define se second #define pb push_back #define all(x) x.begin()...
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define __ \ ios_base::sync_with_stdio(0); \ cin.tie(0); #define fi first #define se second #define pb push_back #define all(x) x.begin()...
replace
67
68
67
68
TLE
p02644
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <queue> #include <vector> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int h, w, k; cin >> h >> w >> k; ++k; int xb, yb, xe, ye; cin >> xb >> yb >> xe >> ye; --xb; --yb; --xe; --ye; vector<vector<char>> rec(h, ...
#include <algorithm> #include <iostream> #include <queue> #include <vector> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int h, w, k; cin >> h >> w >> k; ++k; int xb, yb, xe, ye; cin >> xb >> yb >> xe >> ye; --xb; --yb; --xe; --ye; vector<vector<char>> rec(h, ...
insert
41
41
41
43
TLE
p02644
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; const int inf = 1e9; int h, w, k, x1, Y1, x2, y2, mx[] = {0, 1, 0, -1}, my[] = {1, 0, -1, 0}; string mp[100005]; struct node { int x, y, v; } q[5000005]; int main() { cin >> h >> w >> k >> x1 >> Y1 >> x2 >> y2; for (int i = 1; i <= h; i++) cin >> mp[i]; int ...
#include <bits/stdc++.h> using namespace std; const int inf = 1e9; int h, w, k, x1, Y1, x2, y2, mx[] = {0, 1, 0, -1}, my[] = {1, 0, -1, 0}; string mp[100005]; struct node { int x, y, v; } q[5000005]; int main() { cin >> h >> w >> k >> x1 >> Y1 >> x2 >> y2; for (int i = 1; i <= h; i++) cin >> mp[i]; int ...
replace
47
48
47
48
TLE
p02645
C++
Runtime Error
#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() { int n, m; cin >> n >> m; vector<vector<int>> a(n + 1); int b, c; rep(i, m) { cin >> b >> c; a[b].push_back(c); a[c].push_back(b); } vector...
#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; cin >> s; string s2; s2 = s.substr(0, 3); cout << s2 << endl; return 0; }
replace
7
49
7
12
0
p02645
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int main() { int n, k; cin >> n >> k; vector<int> d(k); int tmp; vector<int> a(n); rep(i, k) { cin >> d.at(i); rep(j, d.at(i)) { cin >> tmp; a.at((int)tmp - 1) = 1; } } int count =...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int main() { string s; cin >> s; cout << s[0] << s[1] << s[2] << endl; }
replace
5
24
5
8
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p02645
Python
Runtime Error
import random S = input() A = random.randint(0, len(S) - 2) print(S[A] + S[A + 1] + S[A + 2])
import random S = input() A = random.randint(0, len(S) - 3) print(S[A] + S[A + 1] + S[A + 2])
replace
4
5
4
5
0
p02645
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define _CRT_SECURE_NO_DEPRECATE #define ll long long #define nl '\n' // NL - sign of new line #define upc(str, c) str[c] = toupper(str[c]); // make single char uppercase #define lowerc(str, c) str[c] = tolower(str[c]); // make single char lowercase #define ups(str) ...
#include <bits/stdc++.h> using namespace std; #define _CRT_SECURE_NO_DEPRECATE #define ll long long #define nl '\n' // NL - sign of new line #define upc(str, c) str[c] = toupper(str[c]); // make single char uppercase #define lowerc(str, c) str[c] = tolower(str[c]); // make single char lowercase #define ups(str) ...
replace
51
52
51
52
0
p02645
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; cout << S.at(1) << S.at(2) << S.at(3) << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; cout << S.at(0) << S.at(1) << S.at(2) << endl; }
replace
5
6
5
6
0
p02645
Python
Runtime Error
import random S = input() rand = random.randrange(0, len(S) - 1) print(S[rand] + S[rand + 1] + S[rand + 2])
import random S = input() rand = random.randrange(0, len(S) - 2) print(S[rand] + S[rand + 1] + S[rand + 2])
replace
3
4
3
4
0
p02645
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main() { string s; cin >> s; string k; int N = s.size(); int p = rand() % N; k = s.at(p) + s.at(p + 1) + s.at(p + 2); cout << k << endl; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main() { string s; cin >> s; string a, b, c; a = s.at(0); b = s.at(1); c = s.at(2); cout << a << b << c << endl; }
replace
7
12
7
13
0
p02645
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string s; int n; cin >> s >> n; cout << s.substr(n, 3) << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s; int n; cin >> s >> n; cout << s.substr(0, 3) << endl; return 0; }
replace
7
8
7
8
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::substr: __pos (which is 18446744072974021345) > this->size() (which is 9)
p02645
C++
Runtime Error
#include <iostream> using namespace std; int main(void) { char s[3]; cin >> s; cout << s[0] << s[1] << s[2] << endl; }
#include <iostream> using namespace std; int main(void) { char s[20]; cin >> s; cout << s[0] << s[1] << s[2] << endl; }
replace
3
4
3
4
-6
*** stack smashing detected ***: terminated
p02645
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; string ans = 0; for (int i = 0; i < s.length() - 2; i++) { if (s[i] != s[i + 1] and s[i + 1] != s[i + 2] and s[i] != s[i + 2]) { ans += s[i]; ans += s[i + 1]; ans += s[i + 2]; break; } } if (ans....
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; string ans = ""; for (int i = 0; i < s.length() - 2; i++) { if (s[i] != s[i + 1] and s[i + 1] != s[i + 2] and s[i] != s[i + 2]) { ans += s[i]; ans += s[i + 1]; ans += s[i + 2]; break; } } if (ans...
replace
7
8
7
8
-6
terminate called after throwing an instance of 'std::logic_error' what(): basic_string: construction from null is not valid
p02645
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <complex> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_s...
#include <algorithm> #include <bitset> #include <cmath> #include <complex> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_s...
replace
50
51
50
54
0
p02645
Python
Runtime Error
s = input() print(s[3])
s = input() print(s[:3])
replace
1
2
1
2
0
p02645
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #include <random> #include <string> int main() { string s, ans; getline(cin, s); int a = s.size(); int i = rand() % a - 2; ans = s.substr(i, 3); cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; #include <random> #include <string> int main() { string s, ans; getline(cin, s); int a = s.size(); int i = rand() % (a - 2); ans = s.substr(i, 3); cout << ans << endl; }
replace
9
10
9
10
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::substr: __pos (which is 18446744073709551615) > this->size() (which is 9)
p02645
Python
Runtime Error
print(input().split().index("0") + 1)
print(input()[:3])
replace
0
1
0
1
ValueError: '0' is not in list
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02645/Python/s112750711.py", line 1, in <module> print(input().split().index("0") + 1) ValueError: '0' is not in list
p02646
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define Pb push_back #define Mp make_pair #define ff first #define ss second #define Max(x, y, z) max(x, max(y, z)) #define Min(x, y, z) min(x, min(y, z)) #define INF LONG_LONG_MAX #define MINF LONG_LONG_MIN #define endl "\n" #define IOS ...
#include <bits/stdc++.h> using namespace std; #define Pb push_back #define Mp make_pair #define ff first #define ss second #define Max(x, y, z) max(x, max(y, z)) #define Min(x, y, z) min(x, min(y, z)) #define INF LONG_LONG_MAX #define MINF LONG_LONG_MIN #define endl "\n" #define IOS ...
replace
33
39
33
36
0
p02646
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; int main() { ll a, b, v, w, t; cin >> a >> v >> b >> w >> t; ll dist = max(a - b, b - a); ll sekkin = v - w; bool kotae = false; if (dist % sekkin == 0) { for (int i = 0; i < t; i++)...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; int main() { ll a, b, v, w, t; cin >> a >> v >> b >> w >> t; ll dist = max(a - b, b - a); ll sekkin = v - w; bool kotae = false; for (int i = 0; i < t; i++) { dist -= sekkin; if (...
replace
15
23
15
19
0
p02646
C++
Runtime Error
#include <bits/stdc++.h> #pragma GCC optimize("O2") using namespace std; #define F first #define S second #define migmig \ ios::sync_with_stdio(false); \ cin.tie(0); ...
#include <bits/stdc++.h> #pragma GCC optimize("O2") using namespace std; #define F first #define S second #define migmig \ ios::sync_with_stdio(false); \ cin.tie(0); ...
replace
35
36
35
38
0
p02646
C++
Runtime Error
#include <bits/stdc++.h> #include <iostream> #include <math.h> using namespace std; typedef long long ll; int main(void) { ll a, b, v, w, t; cin >> a >> v >> b >> w >> t; cout << (abs(a - b) / (v - w) <= t ? "YES" : "NO") << endl; return 0; }
#include <bits/stdc++.h> #include <iostream> #include <math.h> using namespace std; typedef long long ll; int main(void) { ll a, b, v, w, t; cin >> a >> v >> b >> w >> t; cout << (abs(a - b) <= (v - w) * t ? "YES" : "NO") << endl; return 0; }
replace
10
11
10
11
0
p02646
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int A, V, B, W, T = 0; cin >> A >> V >> B >> W >> T; int X = B - A; if (B > A && V >= W && (B - A) / (V - W) <= T) { cout << "YES" << endl; } else if (X == 0) { cout << "YES" << endl; } else if (B > A && W >= V && (B - A) / (V - W) <= T) { ...
#include <bits/stdc++.h> using namespace std; int main() { long long a, v, b, w, p; cin >> a >> v >> b >> w >> p; long long wdnmd = abs(b - a); long long xswl = (v - w) * p; if (wdnmd <= xswl) { cout << "YES" << endl; } else { cout << "NO" << endl; } }
replace
4
12
4
9
0
p02646
C++
Runtime Error
/* ***** @Author: Harith Insider ***** */ #include <bits/stdc++.h> typedef long long int ll; typedef long double ld; #define pb push_back #define ff first #define ss second #define fastio \ ios::sync_with_stdio(0); ...
/* ***** @Author: Harith Insider ***** */ #include <bits/stdc++.h> typedef long long int ll; typedef long double ld; #define pb push_back #define ff first #define ss second #define fastio \ ios::sync_with_stdio(0); ...
replace
19
21
19
22
0
p02646
C++
Runtime Error
/* * author :Sadik Hassan * */ #include "bits/stdc++.h" using namespace std; #define ll long long #define nl "\n" #define pb push_back #define fi first #define se second #define PI (acos(-1.0)) #define _SAD() \ ios::sync_with_stdio(0), cin.tie(0), cou...
/* * author :Sadik Hassan * */ #include "bits/stdc++.h" using namespace std; #define ll long long #define nl "\n" #define pb push_back #define fi first #define se second #define PI (acos(-1.0)) #define _SAD() \ ios::sync_with_stdio(0), cin.tie(0), cou...
replace
42
43
42
45
0
p02646
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; bool solve() { int a, v, b, w, t; cin >> a >> v >> b >> w >> t; int dist = abs(b - a); int dv = (v - w); if (dv < 0) return false; int steps = dist / dv; if (dist % dv) ++steps; if (steps <= t) return true; return false; } int main() { ios:...
#include <bits/stdc++.h> using namespace std; bool solve() { int a, v, b, w, t; cin >> a >> v >> b >> w >> t; int dist = abs(b - a); int dv = (v - w); if (dv <= 0) return false; int steps = dist / dv; if (dist % dv) ++steps; if (steps <= t) return true; return false; } int main() { ios...
replace
8
9
8
9
0
p02646
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; #define pri(str) cout << str << endl using ll = long long; using P = pair<int, int>; const ll MX = 1e18; const long double PI = acos(-1); int main() { ll a, b, v, w, t; cin >> a >> v >> b >> w >> t; ll ans = (a - b) / ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; #define pri(str) cout << str << endl using ll = long long; using P = pair<int, int>; const ll MX = 1e18; const long double PI = acos(-1); int main() { ll a, b, v, w, t; cin >> a >> v >> b >> w >> t; if (abs(a - b) <= t...
replace
13
15
13
14
0
p02646
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main() { ll a, b; ll v, w; cin >> a >> v; cin >> b >> w; ll t; cin >> t; puts((abs(a - b) / (v - w)) <= t ? "YES" : "NO"); return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main() { ll a, b; ll v, w; cin >> a >> v; cin >> b >> w; ll t; cin >> t; ll t1 = abs(a - b); ll t2 = (v - w) * t; if (t1 <= t2) { cout << "YES"; } else { cout << "NO"; } return 0; }
replace
11
12
11
18
0
p02646
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 1e7 + 5; const int maxm = 5e5 + 5; const ll inf = 2147483647; int main() { ll a, v, b, w, t; int f = 0; cin >> a >> v >> b >> w >> t; ll d = abs(a - b); ll k = abs(v - w); if (d / k <= t) { cout << "YES"; return 0;...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 1e7 + 5; const int maxm = 5e5 + 5; const ll inf = 2147483647; int main() { ll a, v, b, w, t; int f = 0; cin >> a >> v >> b >> w >> t; if (abs(a - b) <= (v - w) * t) { cout << "YES"; return 0; } cout << "NO"; ret...
replace
11
14
11
13
0
p02646
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long LL; #define fi first #define se second #define pb push_back #define forn(i, n) for (int i = 0; i < (n); i++) #define for1(i, n) for (int i = 1; i <= n; i++) #define forr(i, n) for (int i = n; i >= 0; i--) #define all(x) x.begin(), x.end() const int MAXN = ...
#include <bits/stdc++.h> using namespace std; typedef long long LL; #define fi first #define se second #define pb push_back #define forn(i, n) for (int i = 0; i < (n); i++) #define for1(i, n) for (int i = 1; i <= n; i++) #define forr(i, n) for (int i = n; i >= 0; i--) #define all(x) x.begin(), x.end() const int MAXN = ...
replace
24
35
24
26
0
p02646
C++
Runtime Error
#pragma GCC optimize("-Ofast", "-funroll-all-loops") #include <bits/stdc++.h> // #define int long long using namespace std; int a, b, v, w, t; signed main() { cin >> a >> v >> b >> w >> t; if (w >= v) puts("NO"); else if (abs(a - b) <= 1LL * t * (v - w)) return puts("YES"); else puts("NO"); return...
#pragma GCC optimize("-Ofast", "-funroll-all-loops") #include <bits/stdc++.h> // #define int long long using namespace std; int a, b, v, w, t; signed main() { cin >> a >> v >> b >> w >> t; if (w >= v) puts("NO"); else if (abs(a - b) <= 1LL * t * (v - w)) puts("YES"); else puts("NO"); return 0; }
replace
10
11
10
11
4
p02646
C++
Runtime Error
#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>; const int MOD = 1000000007; int main() { ll a, v, b, w, t; cin >> a >> v >> b >> w >> t; ll T = (b - a + v - w - 1) / (v - w); if (T > 0 && T <= t) cout << "YES" << ...
#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>; const int MOD = 1000000007; int main() { ll a, v, b, w, t; cin >> a >> v >> b >> w >> t; ll dis; if (a < b) dis = b - a + (w - v) * t; else dis = a - b + (w - ...
replace
10
12
10
16
0
p02646
C++
Runtime Error
/** * Coded by : lucky_21 * --------Lokesh Singh **/ #include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template <class T> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_stat...
/** * Coded by : lucky_21 * --------Lokesh Singh **/ #include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; template <class T> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_stat...
replace
38
41
38
42
0
p02646
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { long long a, v, b, w, t; cin >> a >> v >> b >> w >> t; long long x = a - b; if (x < 0) { x *= -1; } if (((x / (v - w)) <= t) && (x / (v - w)) > 0) cout << "YES"; else { cout << "NO"; } }
#include <bits/stdc++.h> using namespace std; int main() { long long a, v, b, w, t; cin >> a >> v >> b >> w >> t; long long x = a - b; if (x < 0) { x *= -1; } if ((x <= t * (v - w)) && (v - w) > 0) cout << "YES"; else { cout << "NO"; } }
replace
9
10
9
10
0
p02646
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll a, v; cin >> a >> v; ll b, w; cin >> b >> w; ll t; cin >> t; if (abs(a - b) / (v - w) <= t) cout << "YES" << endl; else cout << "NO" << endl; }
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll a, v; cin >> a >> v; ll b, w; cin >> b >> w; ll t; cin >> t; if (abs(a - b) <= (v - w) * t) cout << "YES" << endl; else cout << "NO" << endl; }
replace
13
14
13
14
0
p02646
C++
Runtime Error
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #define inf 0x3f3f3f3f const int maxn = 3000050; using namespace std; typedef long long ll; int main() { ll a, b, v, w, t; cin >> a >> v >> b >> w >> t; if (a == b) { cout << "Yes"; retu...
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #define inf 0x3f3f3f3f const int maxn = 3000050; using namespace std; typedef long long ll; int main() { ll A, V; cin >> A >> V; ll B, W; cin >> B >> W; ll T; cin >> T; ll D = abs(A - B)...
replace
11
26
11
20
0
p02646
C++
Runtime Error
#include <algorithm> #include <cstdio> using namespace std; int main() { int A, V, B, W, T; scanf("%lld%lld%lld%lld%lld", &A, &V, &B, &W, &T); if (abs(A - B) > (V - W) * T) { printf("NO\n"); } else printf("YES\n"); }
#include <algorithm> #include <cstdio> using namespace std; int main() { long long A, V, B, W, T; scanf("%lld%lld%lld%lld%lld", &A, &V, &B, &W, &T); if (abs(A - B) > (V - W) * T) { printf("NO\n"); } else printf("YES\n"); }
replace
4
5
4
5
-6
*** stack smashing detected ***: terminated
p02646
Python
Time Limit Exceeded
a, v = map(int, input().split()) b, w = map(int, input().split()) t = int(input()) ans = "NO" for i in range(t): if a < b: a += v b += w else: a -= v b -= w if a == b: ans = "YES" break print(ans)
a, v = map(int, input().split()) b, w = map(int, input().split()) t = int(input()) if abs(a - b) <= (v - w) * t: print("YES") else: print("NO")
replace
3
15
3
7
TLE
p02647
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n, k; cin >> n >> k; vector<int> a(n); rep(i, n) cin >> a[i]; rep(j, k) { vector<int> b(n + 1); rep(i, n) { int l, r; l = max(0, i - a[i]); r =...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n, k; cin >> n >> k; vector<int> a(n); rep(i, n) cin >> a[i]; rep(j, k) { vector<int> b(n + 1); rep(i, n) { int l, r; l = max(0, i - a[i]); r =...
replace
17
18
17
18
0
p02647
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define ll long long #define rint register int #define re register #define pb(x) push_back(x); #define ce(x) cout << x << '\n'; using db = long double; using pll = pair<ll, ll>; #define scan(a, n) ...
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define ll long long #define rint register int #define re register #define pb(x) push_back(x); #define ce(x) cout << x << '\n'; using db = long double; using pll = pair<ll, ll>; #define scan(a, n) ...
replace
51
52
51
52
TLE
p02647
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define ll long long #define rint register int #define re register #define pb(x) push_back(x); #define ce(x) cout << x << '\n'; using db = long double; using pll = pair<ll, ll>; #define scan(a, n) ...
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define ll long long #define rint register int #define re register #define pb(x) push_back(x); #define ce(x) cout << x << '\n'; using db = long double; using pll = pair<ll, ll>; #define scan(a, n) ...
replace
54
55
54
55
TLE
p02647
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } for (int i = 0; i < min(k, 50); i++) { vector<int> imos(n); // I'll begin the imos method for (int j = 0; j < n; j++) { int l = max(0, j - a[...
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } for (int i = 0; i < min(k, 50); i++) { vector<int> imos(n); // I'll begin the imos method for (int j = 0; j < n; j++) { int l = max(0, j - a[...
replace
17
20
17
20
0
p02647
C++
Runtime Error
#include <bits/stdc++.h> using ll = long long; using namespace std; const int INFint = 1e9 + 1; const ll INFll = (ll)1e18 + 1; ll MOD = 1e9 + 7; int main() { int N, K; cin >> N >> K; vector<int> A(N); for (int i(0); i < N; i++) { cin >> A[i]; } vector<int> now = A; for (int i(0); i < K; i++) { v...
#include <bits/stdc++.h> using ll = long long; using namespace std; const int INFint = 1e9 + 1; const ll INFll = (ll)1e18 + 1; ll MOD = 1e9 + 7; int main() { int N, K; cin >> N >> K; vector<int> A(N); for (int i(0); i < N; i++) { cin >> A[i]; } vector<int> now = A; for (int i(0); i < K; i++) { v...
replace
20
21
20
21
0
p02647
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; // #define int long long typedef long long ll; // const int INF = 2e9; // const ll INF = 9e18; signed main() { ios::sync_with_stdio(false); cin.tie(0); int N, K; cin >> N >> K; vector<int> A(N); for (int i = 0; i < N; i++) cin >> A[i]; vector<int> state(...
#include <bits/stdc++.h> using namespace std; // #define int long long typedef long long ll; // const int INF = 2e9; // const ll INF = 9e18; signed main() { ios::sync_with_stdio(false); cin.tie(0); int N, K; cin >> N >> K; vector<int> A(N); for (int i = 0; i < N; i++) cin >> A[i]; vector<int> state(...
replace
17
18
17
18
TLE
p02647
C++
Runtime Error
#include <iostream> #define DIM 100005 using namespace std; int n, i, k, ok; int a[DIM], b[DIM]; int main() { cin >> n >> k; for (i = 1; i <= n; i++) { cin >> a[i]; } for (; k; k--) { for (i = 1; i <= n; i++) { b[max(1, i - a[i])]++; b[min(n + 1, i + a[i] + 1)]--; } for (i = 1; i <= ...
#include <iostream> #define DIM 200005 using namespace std; int n, i, k, ok; int a[DIM], b[DIM]; int main() { cin >> n >> k; for (i = 1; i <= n; i++) { cin >> a[i]; } for (; k; k--) { for (i = 1; i <= n; i++) { b[max(1, i - a[i])]++; b[min(n + 1, i + a[i] + 1)]--; } for (i = 1; i <= ...
replace
1
2
1
2
0
p02647
C++
Time Limit Exceeded
// #define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define endl '\n' #define lfs cout << fixed << setprecision(10) #define ALL(a) (a).begin(), (a).end() #define ALLR(a) (a).rbegin(), (a).rend() #define spa << " " << #define fi first #define se second #define MP make_pair #define MT make_tuple #de...
// #define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define endl '\n' #define lfs cout << fixed << setprecision(10) #define ALL(a) (a).begin(), (a).end() #define ALLR(a) (a).rbegin(), (a).rend() #define spa << " " << #define fi first #define se second #define MP make_pair #define MT make_tuple #de...
replace
123
125
123
131
TLE
p02647
C++
Time Limit Exceeded
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdint> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <regex> #include ...
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdint> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <regex> #include ...
insert
261
261
261
263
TLE
p02647
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; #define _overload3(_1, _2, _3, name, ...) name #define _rep(i, n) repi(i, 0, n) #define repi(i, a, b) for (int i = int(a); i < int(b); ++i) #define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__) #define VIEW(x) ...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define _overload3(_1, _2, _3, name, ...) name #define _rep(i, n) repi(i, 0, n) #define repi(i, a, b) for (int i = int(a); i < int(b); ++i) #define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__) #define VIEW(x) ...
replace
64
65
64
65
0
p02647
C++
Runtime Error
// Date: 2020-06-13 #include <bits/stdc++.h> using namespace std; typedef long long LL; typedef long double LD; typedef vector<int> VI; typedef pair<LL, LL> pll; typedef pair<int, int> pii; #define IO \ freopen("in.txt", "r", stdin); ...
// Date: 2020-06-13 #include <bits/stdc++.h> using namespace std; typedef long long LL; typedef long double LD; typedef vector<int> VI; typedef pair<LL, LL> pll; typedef pair<int, int> pii; #define IO \ freopen("in.txt", "r", stdin); ...
replace
54
56
54
56
0
p02647
C++
Time Limit Exceeded
#if 1 #include <algorithm> #include <array> #include <assert.h> #include <bitset> #include <cmath> #include <cstdint> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #incl...
#if 1 #include <algorithm> #include <array> #include <assert.h> #include <bitset> #include <cmath> #include <cstdint> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #incl...
replace
84
85
84
85
TLE
p02647
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int N, K; cin >> N >> K; vector<int> A(N); for (auto &a : A) cin >> a; for (int i = 0; i < K; i++) { vector<int> B(N + 1); for (int j = 0; j < N; j++) { B[max(j - A[j], 0)]++; B[min(j + A[j] + 1, N)]--; } for (int j = ...
#include <bits/stdc++.h> using namespace std; int main() { int N, K; cin >> N >> K; vector<int> A(N); for (auto &a : A) cin >> a; for (int i = 0; i < K; i++) { vector<int> B(N + 1); for (int j = 0; j < N; j++) { B[max(j - A[j], 0)]++; B[min(j + A[j] + 1, N)]--; } for (int j = ...
insert
18
18
18
19
TLE
p02647
C++
Time Limit Exceeded
#include <algorithm> #include <array> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <stack> #include <string> #include <vector> using namespace std; int gcd(int a, int b) { if (a % b == 0) { return (b); } else { return (gcd(b, a % b)); } } int mod = 1000000000 + 7; vec...
#include <algorithm> #include <array> #include <cmath> #include <cstdio> #include <iomanip> #include <iostream> #include <stack> #include <string> #include <vector> using namespace std; int gcd(int a, int b) { if (a % b == 0) { return (b); } else { return (gcd(b, a % b)); } } int mod = 1000000000 + 7; vec...
insert
74
74
74
77
TLE
p02647
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define all(n) begin(n), end(n) const long long INF = numeric_limits<long long>::max(); typedef long long ll; typedef vector<int> vint; typedef vector<vector<int>> vvint; typedef vector<ll> vll; typedef vector<vector<ll>> vvll; typedef unsigned long long ull; template <clas...
#include <bits/stdc++.h> using namespace std; #define all(n) begin(n), end(n) const long long INF = numeric_limits<long long>::max(); typedef long long ll; typedef vector<int> vint; typedef vector<vector<int>> vvint; typedef vector<ll> vll; typedef vector<vector<ll>> vvll; typedef unsigned long long ull; template <clas...
insert
83
83
83
84
TLE
p02647
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int N, K; cin >> N >> K; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A[i]; } vector<int> b(N, N); vector<int> B(N); while (1) { for (int i = 0; i < N; i++) { int a = A[i]; for (int j = max(0, i - a); j <= min(N -...
#include <bits/stdc++.h> using namespace std; int main() { int N, K; cin >> N >> K; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A[i]; } vector<int> b(N, N); vector<int> B(N); while (1) { for (int i = 0; i < N; i++) { int l = max(0, i - A[i]); int r = min(N - 1, i + A[i])...
replace
15
19
15
23
TLE
p02647
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define repn(i, n) for (int i = 1; i <= n; i++) #define LL long long #define pii pair<int, int> #define fi first #define se second #define pb push_back #define mpr make_pair using namespace std; const LL MOD = 1e9 + 7; int n, k, a[100010], b[100...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define repn(i, n) for (int i = 1; i <= n; i++) #define LL long long #define pii pair<int, int> #define fi first #define se second #define pb push_back #define mpr make_pair using namespace std; const LL MOD = 1e9 + 7; int n, k, a[200010], b[200...
replace
15
16
15
16
0
p02647
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <numeric> #include <vector> using namespace std; int main(void) { int N, K; cin >> N >> K; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A[i]; } while (K--) { if (count(A.begin(), A.end() - 1, N) == N) break; vector<int> tmp(N +...
#include <algorithm> #include <iostream> #include <numeric> #include <vector> using namespace std; int main(void) { int N, K; cin >> N >> K; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A[i]; } while (K--) { if (count(A.begin(), A.end(), N) == N) break; vector<int> tmp(N + 1);...
replace
16
17
16
17
TLE
p02647
C++
Runtime Error
#include <algorithm> #include <iostream> #include <numeric> #include <vector> using namespace std; int main(void) { int N, K; cin >> N >> K; vector<int> A(N + 1); for (int i = 0; i < N; i++) { cin >> A[i]; } while (K--) { vector<int> tmp(N + 1); for (int i = 0; i < N; i++) { tmp[max(0, ...
#include <algorithm> #include <iostream> #include <numeric> #include <vector> using namespace std; int main(void) { int N, K; cin >> N >> K; vector<int> A(N + 1); for (int i = 0; i < N; i++) { cin >> A[i]; } while (K--) { vector<int> tmp(N + 1); for (int i = 0; i < N; i++) { tmp[max(0, ...
replace
19
20
19
20
0
p02647
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } using ll = long long; using P = pair<int, in...
#include <bits/stdc++.h> using namespace std; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } using ll = long long; using P = pair<int, in...
replace
30
31
30
31
TLE
p02647
C++
Runtime Error
// raja1999 // #pragma comment(linker, "/stack:200000000") // #pragma GCC optimize("Ofast") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2") #include <algorithm> #include <bits/stdc++.h> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <ext/pb_ds/assoc_container.hpp> #includ...
// raja1999 // #pragma comment(linker, "/stack:200000000") // #pragma GCC optimize("Ofast") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2") #include <algorithm> #include <bits/stdc++.h> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <ext/pb_ds/assoc_container.hpp> #includ...
replace
58
59
58
59
0
p02647
Python
Time Limit Exceeded
import sys import numpy as np from numba import njit read = sys.stdin.read readline = sys.stdin.buffer.readline sys.setrecursionlimit(10**8) INF = float("inf") MOD = 10**9 + 7 @njit("i8[:](i8,i8,i8[:])", cache=True) def func(n, k, A): for _ in range(k): B = np.zeros(n + 1, np.int64) for i, a in e...
import sys import numpy as np from numba import njit read = sys.stdin.read readline = sys.stdin.buffer.readline sys.setrecursionlimit(10**8) INF = float("inf") MOD = 10**9 + 7 @njit("i8[:](i8,i8,i8[:])", cache=True) def func(n, k, A): for _ in range(k): B = np.zeros(n + 1, np.int64) for i, a in e...
insert
19
19
19
21
TLE
p02647
Python
Time Limit Exceeded
import sys sys.setrecursionlimit(10**7) read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N, K = map(int, input().split()) A = list(map(int, input().split())) K = min(K, 50) for _ in range(K): imos = [0] * (N + 1) for i in range(N): a = A[i] ...
import sys sys.setrecursionlimit(10**7) read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N, K = map(int, input().split()) A = list(map(int, input().split())) K = min(K, 100) for _ in range(K): imos = [0] * (N + 1) for i in range(N): a = A[i] ...
replace
11
12
11
12
TLE
p02647
C++
Runtime Error
/* * じょえチャンネル * 高評価・チャンネル登録よろしくおねがいします! * https://www.youtube.com/channel/UCRXsI3FL_kvaVL9zoolBfbQ */ #include <bits/stdc++.h> // GCC #define _GLIBCXX_DEBUG // Clang // #define _LIBCPP_DEBUG 0 // #pragma GCC target("avx2") // #pragma GCC optimize("O3") // #pragma GCC optimize("unroll-loops") #define f(i, n) for ...
/* * じょえチャンネル * 高評価・チャンネル登録よろしくおねがいします! * https://www.youtube.com/channel/UCRXsI3FL_kvaVL9zoolBfbQ */ #include <bits/stdc++.h> // GCC #define _GLIBCXX_DEBUG // Clang // #define _LIBCPP_DEBUG 0 // #pragma GCC target("avx2") // #pragma GCC optimize("O3") // #pragma GCC optimize("unroll-loops") #define f(i, n) for ...
replace
740
741
740
741
-11
p02647
Python
Runtime Error
N, K = map(int, input().split()) A = list(map(int, input().split())) for _ in range(min(K, 50)): lamp = [0 for i in range(N + 1)] for i in range(N): lamp[max(0, i - A[i])] += 1 lamp[min(N, i + A[i] + 1)] -= 1 for i in range(N): lamp[i] += lamp[i - 1] A = lamp [print(A[i], end=...
N, K = map(int, input().split()) A = list(map(int, input().split())) for _ in range(min(K, 50)): lamp = [0 for i in range(N + 1)] for i in range(N): lamp[max(0, i - A[i])] += 1 lamp[min(N, i + A[i] + 1)] -= 1 for i in range(1, N + 1): lamp[i] += lamp[i - 1] A = lamp [print(A[i...
replace
9
10
9
10
0
p02647
C++
Time Limit Exceeded
#pragma region header #include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) #define rev(i, n) for (int i = (int)(n - 1); i >= 0; i--) #define rev1(i, n) for (int i = (int)(n); i > 0; i--) #define pb...
#pragma region header #include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) #define rev(i, n) for (int i = (int)(n - 1); i >= 0; i--) #define rev1(i, n) for (int i = (int)(n); i > 0; i--) #define pb...
insert
92
92
92
93
TLE
p02647
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cassert> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <unordered_map> #include <unordered_set> #include <vector> #define FOR(i, n, m) for (ll i = (n); i < (ll)(m); i++) #define REP(i, n)...
#include <algorithm> #include <bitset> #include <cassert> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <unordered_map> #include <unordered_set> #include <vector> #define FOR(i, n, m) for (ll i = (n); i < (ll)(m); i++) #define REP(i, n)...
replace
229
230
229
230
TLE
p02647
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <unordered_map> #include <unordered_set> using namespace std; #define endl "\n" #define ll long long #define sz(s) (int)(s.size()) #define INF 0x3f3f3f3f3f3f3f3fLL #define all(v) v.begin(), v.end() #define watch(x) cout << (#x) << " = " << x << endl const int dr[]{-1, -1, 0, 1, 1, 1, 0...
#include <bits/stdc++.h> #include <unordered_map> #include <unordered_set> using namespace std; #define endl "\n" #define ll long long #define sz(s) (int)(s.size()) #define INF 0x3f3f3f3f3f3f3f3fLL #define all(v) v.begin(), v.end() #define watch(x) cout << (#x) << " = " << x << endl const int dr[]{-1, -1, 0, 1, 1, 1, 0...
replace
33
34
33
34
TLE
p02647
C++
Time Limit Exceeded
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) using ll = long long; const ll MOD = 1000000007; const double pi = acos(-1); int main() { ll N, K; cin >> N >> K; vector<ll> A(N); rep(i, N) { cin >> A.at(i); } rep(i, min(K, (ll)1000)) { ...
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) using ll = long long; const ll MOD = 1000000007; const double pi = acos(-1); int main() { ll N, K; cin >> N >> K; vector<ll> A(N); rep(i, N) { cin >> A.at(i); } rep(i, min(K, (ll)100)) { v...
replace
13
14
13
14
TLE