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
p02537
C++
Runtime Error
// Problem : D - Flat Subsequence // Contest : AtCoder - ACL Beginner Contest // URL : https://atcoder.jp/contests/abl/tasks/abl_d // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) // $%U%$ // Mere bas ka nahi hai // still i'm trying // apna time aayega /...
// Problem : D - Flat Subsequence // Contest : AtCoder - ACL Beginner Contest // URL : https://atcoder.jp/contests/abl/tasks/abl_d // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) // $%U%$ // Mere bas ka nahi hai // still i'm trying // apna time aayega /...
replace
92
93
92
94
0
p02537
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <vector> using namespace std; vector<int> T[20]; int query(int h, int k, int i, int j) { int m = (k << h) + (1 << h - 1); if (i == (k << h) && j == (k + 1 << h) - 1) return T[h][k]; if (j < m) return query(h - 1, k << 1, i, j); if (i >=...
#include <algorithm> #include <cmath> #include <cstdio> #include <vector> using namespace std; vector<int> T[20]; int query(int h, int k, int i, int j) { int m = (k << h) + (1 << h - 1); if (i == (k << h) && j == (k + 1 << h) - 1) return T[h][k]; if (j < m) return query(h - 1, k << 1, i, j); if (i >=...
replace
23
24
23
24
0
p02537
C++
Runtime Error
// One Batch Two Batch Penny and Dime #include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ll long long #define hii cout << "hii" << endl #define int long long #define endl '\n' #define all(s) s.begin(), s.end() ...
// One Batch Two Batch Penny and Dime #include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ll long long #define hii cout << "hii" << endl #define int long long #define endl '\n' #define all(s) s.begin(), s.end() ...
replace
55
56
55
56
0
p02537
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, a, b) for (ll i = ll(a); i < ll(b); i++) #define irep(i, a, b) for (ll i = ll(a); i >= ll(b); i--) 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) { ...
#include <bits/stdc++.h> #define rep(i, a, b) for (ll i = ll(a); i < ll(b); i++) #define irep(i, a, b) for (ll i = ll(a); i >= ll(b); i--) 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) { ...
replace
160
161
160
161
0
p02537
C++
Runtime Error
#include <bits/stdc++.h> #define watch(x) std::cout << (#x) << " is " << (x) << std::endl #define print(x) std::cout << (x) << std::endl #define println std::cout << std::endl; using LL = long long; #define lrt rt << 1 #define rrt rt << 1 | 1 #define lson l, m, lrt #define rson m + 1, r, rrt const int N = 3e5 + 2; int ...
#include <bits/stdc++.h> #define watch(x) std::cout << (#x) << " is " << (x) << std::endl #define print(x) std::cout << (x) << std::endl #define println std::cout << std::endl; using LL = long long; #define lrt rt << 1 #define rrt rt << 1 | 1 #define lson l, m, lrt #define rson m + 1, r, rrt const int N = 3e5 + 2; int ...
replace
10
11
10
11
0
p02537
C++
Time Limit Exceeded
#pragma GCC target("sse4.2") #include <bits/stdc++.h> using namespace std; #define F first #define S second #define PB push_back #define ln "\n" #define forn(i, e) for (ll i = 0; i < e; i++) #define forsn(i, s, e) for (ll i = s; i < e; i++) #define rforn(i, e) for (ll i = e; i >= 0; i--) #define rforsn(i, e, s) for (...
#pragma GCC target("sse4.2") #include <bits/stdc++.h> using namespace std; #define F first #define S second #define PB push_back #define ln "\n" #define forn(i, e) for (ll i = 0; i < e; i++) #define forsn(i, s, e) for (ll i = s; i < e; i++) #define rforn(i, e) for (ll i = e; i >= 0; i--) #define rforsn(i, e, s) for (...
replace
647
651
647
650
TLE
p02537
C++
Runtime Error
// #pragma GCC optimize("Ofast") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma") // #pragma GCC optimize("unroll-loops") #include "bits/stdc++.h" using namespace std; #define PI 3.1415926535897932384626433832795l #define pb push_back #define mp make_pair #define lb lower_bound // First...
// #pragma GCC optimize("Ofast") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma") // #pragma GCC optimize("unroll-loops") #include "bits/stdc++.h" using namespace std; #define PI 3.1415926535897932384626433832795l #define pb push_back #define mp make_pair #define lb lower_bound // First...
replace
75
76
75
76
0
p02537
C++
Runtime Error
// includes #include <bits/stdc++.h> using namespace std; // macros #define pb emplace_back #define mk make_pair #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) FOR(i, 0, n) #define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--) #define irep(itr, st) for (auto itr = (st).begin(); itr != (st)...
// includes #include <bits/stdc++.h> using namespace std; // macros #define pb emplace_back #define mk make_pair #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) FOR(i, 0, n) #define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--) #define irep(itr, st) for (auto itr = (st).begin(); itr != (st)...
replace
191
192
191
192
0
p02537
C++
Runtime Error
#include <algorithm> #include <iostream> #include <map> #include <set> #include <vector> // #include <numeric> //iota // #include <sstream> // #include <cstring> // #include <tuple> // #include <random> // #include <string> // #include <unordered_set> // #include <bitset> // #include <unordered_map> // #include <stack>...
#include <algorithm> #include <iostream> #include <map> #include <set> #include <vector> // #include <numeric> //iota // #include <sstream> // #include <cstring> // #include <tuple> // #include <random> // #include <string> // #include <unordered_set> // #include <bitset> // #include <unordered_map> // #include <stack>...
replace
175
176
175
176
0
p02537
C++
Runtime Error
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; #define pb push_back #define fi first #define se second #define sz(a) a.size() #define all(a) a.begin(), a.end() #define lb lower_bound #define ub upper_bound #define owo \ io...
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; #define pb push_back #define fi first #define se second #define sz(a) a.size() #define all(a) a.begin(), a.end() #define lb lower_bound #define ub upper_bound #define owo \ io...
replace
102
103
102
103
0
p02537
C++
Runtime Error
#include <bits/stdc++.h> // #include <set> // #include <vector> // #include <ostream> // #include <atcoder/notall> using namespace std; using ll = long long; using VI = vector<int>; using VL = vector<ll>; using VD = vector<double>; using VS = vector<string>; using VB = vector<bool>; using VVB = vector<vector<bool>>; u...
#include <bits/stdc++.h> // #include <set> // #include <vector> // #include <ostream> // #include <atcoder/notall> using namespace std; using ll = long long; using VI = vector<int>; using VL = vector<ll>; using VD = vector<double>; using VS = vector<string>; using VB = vector<bool>; using VVB = vector<vector<bool>>; u...
replace
507
508
507
508
0
p02537
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; typedef long long LL; #define N 100010 struct Data { LL val, idx; }; LL a[N], c[N], q[N]; LL Maxn[N * 4]; Data b[N]; int n; LL ans, d; bool cmp(Data x, Data y) { return (x.val < y.val); } void update(int o, int l...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; typedef long long LL; #define N 1000010 struct Data { LL val, idx; }; LL a[N], c[N], q[N]; LL Maxn[N * 4]; Data b[N]; int n; LL ans, d; bool cmp(Data x, Data y) { return (x.val < y.val); } void update(int o, int ...
replace
9
10
9
10
0
p02537
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define mod 1000000007LL; #define speed \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) //______________________________________________...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define mod 1000000007LL; #define speed \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) //______________________________________________...
replace
9
10
9
10
0
p02537
C++
Runtime Error
/* Created by Rahul Goel. */ #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,...
/* Created by Rahul Goel. */ #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,...
replace
106
108
106
108
0
p02537
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define ll long long #define pb push_back #define fi first #define se second using namespace std; ll c[600005] = {0}, tree[1200005] = {0}; ll query(ll ql, ll qr, ll s, ll e, ll in) { if (ql > e || qr < s || s > e) return -1; if (ql <= s && qr >= e) { return tree[in]; } int mid ...
#include <bits/stdc++.h> #define ll long long #define pb push_back #define fi first #define se second using namespace std; ll c[600005] = {0}, tree[1200005] = {0}; ll query(ll ql, ll qr, ll s, ll e, ll in) { if (ql > e || qr < s || s > e) return -1; if (ql <= s && qr >= e) { return tree[in]; } int mid ...
replace
29
32
29
33
TLE
p02537
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define NMAX 300005 using namespace std; typedef long long ll; ll segmTree[NMAX * 4], l[NMAX * 4], r[NMAX * 4], leaves[NMAX]; void init(size_t nd) { if (nd == 0) l[0] = 0, r[0] = NMAX - 1; else { if (nd & 1) l[nd] = l[nd / 2], r[nd] = (l[nd / 2] + r[nd / 2]) / 2; else ...
#include <bits/stdc++.h> #define NMAX 300005 using namespace std; typedef long long ll; ll segmTree[NMAX * 4], l[NMAX * 4], r[NMAX * 4], leaves[NMAX]; void init(size_t nd) { if (nd == 0) l[0] = 0, r[0] = NMAX - 1; else { if (nd & 1) l[nd] = l[nd / 2], r[nd] = (l[nd / 2] + r[nd / 2]) / 2; else ...
replace
53
54
53
54
TLE
p02537
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; vector<int> sgt; int sz{1}; void g() { while (sz < 3e4) sz *= 2; sgt.resize(2 * sz); } int f(int l, int r) { int ans{}; l += sz, r += sz; while (l <= r) { if (l & 1) ans = max(ans, sgt[l++]); if (!(r & 1)) ans = max(ans, sgt[r--]); l...
#include "bits/stdc++.h" using namespace std; vector<int> sgt; int sz{1}; void g() { while (sz < 3e5) sz *= 2; sgt.resize(2 * sz); } int f(int l, int r) { int ans{}; l += sz, r += sz; while (l <= r) { if (l & 1) ans = max(ans, sgt[l++]); if (!(r & 1)) ans = max(ans, sgt[r--]); l...
replace
7
8
7
8
0
p02537
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define ll long long int #define lld long double #define pb push_back #define pii pair<ll, ll> #define mi map<ll, ll> #define vec vector<ll> #define all(a) (a).begin(), (a).end() #define F first #define S second #define mod 1000000007 #define rep(i, a, b) for (ll i = a; i < b; i++) #define repi...
#include <bits/stdc++.h> #define ll long long int #define lld long double #define pb push_back #define pii pair<ll, ll> #define mi map<ll, ll> #define vec vector<ll> #define all(a) (a).begin(), (a).end() #define F first #define S second #define mod 1000000007 #define rep(i, a, b) for (ll i = a; i < b; i++) #define repi...
replace
68
69
68
69
TLE
p02537
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; const int N = 3e5 + 5; int n, k, a[N], f[N << 2]; void pushup(int o) { f[o] = max(f[o << 1], f[o << 1 | 1]); } int ask(int l, int r, int o, int ld, int rd) { if (l == r) return f[o]; int mid = l + r >> 1, ans = 0; if (rd > mid) ans = max(ans, ask(mid + 1, r, ...
#include <bits/stdc++.h> using namespace std; const int N = 3e5 + 5; int n, k, a[N], f[N << 2]; void pushup(int o) { f[o] = max(f[o << 1], f[o << 1 | 1]); } int ask(int l, int r, int o, int ld, int rd) { if (l == r) return f[o]; if (ld <= l && rd >= r) return f[o]; int mid = l + r >> 1, ans = 0; if (rd...
insert
8
8
8
10
TLE
p02537
C++
Runtime Error
// #pragma GCC optimize ("Ofast") // #pragma GCC target // ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include "bits/stdc++.h" using namespace std; #define ll long long #define pb push_back #define all(_obj) _obj.begin(), _obj.end() #define F first #define S second #define INF 1e18 #define pll pair<ll,...
// #pragma GCC optimize ("Ofast") // #pragma GCC target // ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include "bits/stdc++.h" using namespace std; #define ll long long #define pb push_back #define all(_obj) _obj.begin(), _obj.end() #define F first #define S second #define INF 1e18 #define pll pair<ll,...
replace
24
25
24
25
0
p02537
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long int; ll mod2 = 998244353; ll mod = 1e9 + 7; vector<int> seg; vector<int> dp; void update(int v, int tl, int tr, int pos, int val) { if (tl == tr) seg[v] = val; else { int mid = (tl + tr) / 2; if (pos <= mid) update(2 * v, tl, mid, ...
#include <bits/stdc++.h> using namespace std; using ll = long long int; ll mod2 = 998244353; ll mod = 1e9 + 7; vector<int> seg; vector<int> dp; void update(int v, int tl, int tr, int pos, int val) { if (tl == tr) seg[v] = val; else { int mid = (tl + tr) / 2; if (pos <= mid) update(2 * v, tl, mid, ...
replace
34
36
34
36
0
p02537
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define endl "\n" #define LL long long #define ULL unsigned long long const LL INF = 1LL << 59; const double PI = 2.0 * acos(0.0); typedef pair<int, int> pii; typedef pair<LL, LL> pll; typedef vector<int> vi; typedef vector<LL> vl; typedef vector<pii> vii; typedef vector<...
#include <bits/stdc++.h> using namespace std; #define endl "\n" #define LL long long #define ULL unsigned long long const LL INF = 1LL << 59; const double PI = 2.0 * acos(0.0); typedef pair<int, int> pii; typedef pair<LL, LL> pll; typedef vector<int> vi; typedef vector<LL> vl; typedef vector<pii> vii; typedef vector<...
replace
120
121
120
121
0
p02537
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> dp(N, 1); for (int i(0); i < N; i++) { ...
#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> dp(N, 1); for (int i(0); i < N; i++) { ...
replace
18
19
18
19
-6
malloc(): corrupted top size
p02537
C++
Time Limit Exceeded
// Problem : D - Flat Subsequence // Contest : AtCoder - ACL Beginner Contest // URL : https://atcoder.jp/contests/abl/tasks/abl_d // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) // #pragma GCC optimize "trapv"// WA to RE int!! #include <bits/stdc++.h>...
// Problem : D - Flat Subsequence // Contest : AtCoder - ACL Beginner Contest // URL : https://atcoder.jp/contests/abl/tasks/abl_d // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) // #pragma GCC optimize "trapv"// WA to RE int!! #include <bits/stdc++.h>...
replace
67
68
67
69
TLE
p02537
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> p_ll; template <class T> void debug(T itr1, T itr2) { auto now = itr1; while (now < itr2) { cout << *now << " "; now++; } cout << endl; } #define repr(i, from, to) for (ll i = (ll)from; i < (ll)to; i++) #define al...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> p_ll; template <class T> void debug(T itr1, T itr2) { auto now = itr1; while (now < itr2) { cout << *now << " "; now++; } cout << endl; } #define repr(i, from, to) for (ll i = (ll)from; i < (ll)to; i++) #define al...
replace
106
107
106
107
0
p02537
C++
Runtime Error
#include <bits/stdc++.h> #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()) using namespace std; typedef long long ll; const int INF = 1e9; const ll MOD = 1e9 + 7; const ll LINF = 1e18; templat...
#include <bits/stdc++.h> #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()) using namespace std; typedef long long ll; const int INF = 1e9; const ll MOD = 1e9 + 7; const ll LINF = 1e18; templat...
replace
165
166
165
166
0
p02537
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; const int N = 500100; #define lson rt << 1 // == rt * 2 左儿子 #define rson rt ...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; const int N = 500100; #define lson rt << 1 // == rt * 2 左儿子 #define rson rt ...
replace
121
122
121
122
0
p02537
C++
Runtime Error
#include <algorithm> #include <stdio.h> int n, k; int a[100010]; int DT[100010]; int ans; int max_a; int min(int a, int b) { return a < b ? a : b; } int max(int a, int b) { return a > b ? a : b; } struct seg { int tree[2000010], lim; void init(int n) { for (lim = 1; lim <= n; lim <<= 1) ; for (int i =...
#include <algorithm> #include <stdio.h> int n, k; int a[300010]; int ans; int max_a; int min(int a, int b) { return a < b ? a : b; } int max(int a, int b) { return a > b ? a : b; } struct seg { int tree[2000010], lim; void init(int n) { for (lim = 1; lim <= n; lim <<= 1) ; for (int i = 0; i < 2 * lim;...
replace
3
5
3
4
0
p02537
C++
Runtime Error
#include <bits/stdc++.h> #define ls ch[x][0] #define rs ch[x][1] #define ll long long using namespace std; inline ll read() { ll num = 0, neg = 1; char c = getchar(); while (!isdigit(c)) { if (c == '-') neg = -1; c = getchar(); } while (isdigit(c)) { num = (num << 3) + (num << 1) + c - '0';...
#include <bits/stdc++.h> #define ls ch[x][0] #define rs ch[x][1] #define ll long long using namespace std; inline ll read() { ll num = 0, neg = 1; char c = getchar(); while (!isdigit(c)) { if (c == '-') neg = -1; c = getchar(); } while (isdigit(c)) { num = (num << 3) + (num << 1) + c - '0';...
replace
53
55
53
55
0
p02537
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, x, y) for (int i = x, i##end = y; i <= i##end; ++i) #define _rep(i, x, y) for (int i = x, i##end = y; i >= i##end; --i) #define ll long long typedef std::pair<int, int> pii; inline bool up(int &x, const int y) { return x < y ? x = y, 1 : 0; } inline bool down(int &x, const int y)...
#include <bits/stdc++.h> #define rep(i, x, y) for (int i = x, i##end = y; i <= i##end; ++i) #define _rep(i, x, y) for (int i = x, i##end = y; i >= i##end; --i) #define ll long long typedef std::pair<int, int> pii; inline bool up(int &x, const int y) { return x < y ? x = y, 1 : 0; } inline bool down(int &x, const int y)...
replace
15
16
15
16
0
p02537
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); i++) using namespace std; int main() { int n, k; cin >> n >> k; vector<int> a(n); REP(i, n) cin >> a[i]; vector<int> dp(n, 0); REP(i, n) REP(j, i) { if (abs(a[i] - a[j]) <= k) dp[i] = max(dp[i], dp[j] + 1); } int res = 0; R...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); i++) using namespace std; int main() { int n, k; cin >> n >> k; vector<int> a(n); REP(i, n) cin >> a[i]; vector<int> dp(n, 0); REP(i, n) for (int j = max(0, i - 100); j < i; j++) { if (abs(a[i] - a[j]) <= k) dp[i] = max(dp[i], dp...
replace
10
11
10
11
TLE
p02537
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; template <typename T> struct SegmentTree { // 1-indexed T m_id; T op(const T &a, const T &b) const { return max(a, b); } vector<T> m_SegT; SegmentTree(int N) : m_id(0), m_SegT(2 * N, m_id) {} SegmentTree(const vector<T> &data) : m_id(0), m_SegT(2 * data.size()) ...
#include <bits/stdc++.h> using namespace std; template <typename T> struct SegmentTree { // 1-indexed T m_id; T op(const T &a, const T &b) const { return max(a, b); } vector<T> m_SegT; SegmentTree(int N) : m_id(0), m_SegT(2 * N, m_id) {} SegmentTree(const vector<T> &data) : m_id(0), m_SegT(2 * data.size()) ...
replace
61
62
61
62
0
p02537
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define F first #define S second #define _IO \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define F first #define S second #define _IO \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
replace
11
13
11
13
0
p02537
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rrep(ri, n) for (int ri = (int)(n - 1); ri >= 0; ri--) #define rep2(i, x, n) for (int i = (int)(x); i < (int)(n); i++) #define rrep2(ri, x, n) for (int ri = (int)(n - 1); ri >= (int)(x); ri--) #define repit(itr, x) for (auto itr = x.b...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rrep(ri, n) for (int ri = (int)(n - 1); ri >= 0; ri--) #define rep2(i, x, n) for (int i = (int)(x); i < (int)(n); i++) #define rrep2(ri, x, n) for (int ri = (int)(n - 1); ri >= (int)(x); ri--) #define repit(itr, x) for (auto itr = x.b...
delete
2,174
2,175
2,174
2,174
0
p02537
Python
Runtime Error
# 0-index segment tree class SegmentTree: """ init(init_val, ide_ele): 配列init_valで初期化 O(N) update(k, x): k番目の値をxに更新 O(logN) query(l, r): 区間[l, r)をsegfuncしたものを返す O(logN) """ def __init__(self, init_val, segfunc, ide_ele): """ init_val: 配列の初期値 segfunc: ...
# 0-index segment tree class SegmentTree: """ init(init_val, ide_ele): 配列init_valで初期化 O(N) update(k, x): k番目の値をxに更新 O(logN) query(l, r): 区間[l, r)をsegfuncしたものを返す O(logN) """ def __init__(self, init_val, segfunc, ide_ele): """ init_val: 配列の初期値 segfunc: ...
replace
74
75
74
75
0
p02538
C++
Runtime Error
// Problem : E - Replace Digits // Contest : AtCoder - ACL Beginner Contest // URL : https://atcoder.jp/contests/abl/tasks/abl_e // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <...
// Problem : E - Replace Digits // Contest : AtCoder - ACL Beginner Contest // URL : https://atcoder.jp/contests/abl/tasks/abl_e // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <...
replace
37
38
37
38
0
p02538
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define re register #define ls (o << 1) #define m (l + r) / 2 #define rs (o << 1 | 1) #define pb push_back const double PI = acos(-1.0); const int M = 1e5 + 7; /* int head[M],cnt=1; void init(int n){cnt=1;for(int i=0;i<=n;i++)head[i]=0;} struct EDGE{in...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define re register #define ls (o << 1) #define m (l + r) / 2 #define rs (o << 1 | 1) #define pb push_back const double PI = acos(-1.0); const int M = 1e6 + 7; /* int head[M],cnt=1; void init(int n){cnt=1;for(int i=0;i<=n;i++)head[i]=0;} struct EDGE{in...
replace
9
10
9
10
0
p02538
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long using namespace std; const int N = 2e5 + 10; const int mod = 998244353; ll n, q, l, r, k; ll num[N], all_1[N]; struct A { ll l, r, num, lazy; } a[4 * N]; void f(int root, int k) { a[root].lazy = k; a[root].num = (k * all_1[a[root].r - a[root].l + 1]) % mod; } void pus...
#include <bits/stdc++.h> #define ll long long using namespace std; const int N = 2e5 + 10; const int mod = 998244353; ll n, q, l, r, k; ll num[N], all_1[N]; struct A { ll l, r, num, lazy; } a[2000005]; void f(int root, int k) { a[root].lazy = k; a[root].num = (k * all_1[a[root].r - a[root].l + 1]) % mod; } void p...
replace
9
10
9
10
0
p02538
C++
Runtime Error
// Problem : E - Replace Digits // Contest : AtCoder - ACL Beginner Contest // URL : https://atcoder.jp/contests/abl/tasks/abl_e // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <...
// Problem : E - Replace Digits // Contest : AtCoder - ACL Beginner Contest // URL : https://atcoder.jp/contests/abl/tasks/abl_e // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <...
replace
22
23
22
23
0
p02538
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rp1(i, n) for ((i) = 1; (i) <= (n); (i)++) #define rp0(i, n) for ((i) = 0; (i) < (n); (i)++) using namespace std; const int mod = 998244353; int n, q, f[800005], tag[800005], s[800005], lst = 1; void build(int x, int l, int r) { tag[x] = 0; if (l == r) { f[x] = s[x] = lst; l...
#include <bits/stdc++.h> #define rp1(i, n) for ((i) = 1; (i) <= (n); (i)++) #define rp0(i, n) for ((i) = 0; (i) < (n); (i)++) using namespace std; const int mod = 998244353; int n, q, f[800005], tag[800005], s[800005], lst = 1; void build(int x, int l, int r) { tag[x] = 0; if (l == r) { f[x] = s[x] = lst; l...
replace
19
20
19
20
TLE
p02538
C++
Time Limit Exceeded
#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
165
166
165
166
TLE
p02538
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long using namespace std; const int N = 2e5 + 3; const int mod = 998244353; ll n, q, l, r, k; ll num[N], all_1[N]; struct A { ll l, r, num, lazy; } a[N]; void f(int root, int k) { a[root].lazy = k; a[root].num = (k * all_1[a[root].r - a[root].l + 1]) % mod; } void pushback...
#include <bits/stdc++.h> #define ll long long using namespace std; const int N = 2e6 + 3; const int mod = 998244353; ll n, q, l, r, k; ll num[N], all_1[N]; struct A { ll l, r, num, lazy; } a[N]; void f(int root, int k) { a[root].lazy = k; a[root].num = (k * all_1[a[root].r - a[root].l + 1]) % mod; } void pushback...
replace
3
4
3
4
0
p02538
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "debug.h" #else #define dump(...) #endif #define endl '\n' // #define int long long #define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define REP(i, x) for (int i = 0; i < (int)(x); i++) #define REPS(i, x) for (int i = 1; i <= (int)(x); i+...
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "debug.h" #else #define dump(...) #endif #define endl '\n' // #define int long long #define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define REP(i, x) for (int i = 0; i < (int)(x); i++) #define REPS(i, x) for (int i = 1; i <= (int)(x); i+...
replace
328
329
328
329
0
p02538
C++
Time Limit Exceeded
#ifdef LOCAL #define _GLIBCXX_DEBUG #endif // #pragma GCC target("avx512f,avx512dq,avx512cd,avx512bw,avx512vl") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; typedef pair<int, int> Pi; typedef vector<ll> Vec; ...
#ifdef LOCAL #define _GLIBCXX_DEBUG #endif // #pragma GCC target("avx512f,avx512dq,avx512cd,avx512bw,avx512vl") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; typedef pair<int, int> Pi; typedef vector<ll> Vec; ...
replace
142
150
142
151
TLE
p02538
C++
Runtime Error
#include <bits/stdc++.h> #include <queue> using namespace std; #define what_is(x) cout << #x << " is " << x << endl; #define PI acos(-1) #define hell 1000000007 #define HELL 998244353 #define io \ ios_base::sync_with_stdio(false); ...
#include <bits/stdc++.h> #include <queue> using namespace std; #define what_is(x) cout << #x << " is " << x << endl; #define PI acos(-1) #define hell 1000000007 #define HELL 998244353 #define io \ ios_base::sync_with_stdio(false); ...
replace
46
47
46
47
-11
p02538
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <map> #include <queue> #define N1 200005 #define ll long long #define inf 0x3f3f3f3f #define mod 998244353 using namespace std; int n, Q; ll val[10][N1], m10[N1]; struct SEG { ll sum[N1 << 2]; int tag[N1]; void pushup(int len, i...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <map> #include <queue> #define N1 200005 #define ll long long #define inf 0x3f3f3f3f #define mod 998244353 using namespace std; int n, Q; ll val[10][N1], m10[N1]; struct SEG { ll sum[N1 << 2]; int tag[N1 << 2]; void pushup(int l...
replace
17
18
17
18
0
p02538
C++
Time Limit Exceeded
#pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #include <bits/stdc++.h> using namespace std; #define mp make_pair #define INF 10000000 #define MOD 998244353 #define MID (l + r) / 2 #define HASHMOD 2305843009213693951 #define ll long long #define ull unsigned long long #define F first #define S second ...
#pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #include <bits/stdc++.h> using namespace std; #define mp make_pair #define INF 10000000 #define MOD 998244353 #define MID (l + r) / 2 #define HASHMOD 2305843009213693951 #define ll long long #define ull unsigned long long #define F first #define S second ...
replace
40
42
40
41
TLE
p02539
C++
Runtime Error
#include <bits/stdc++.h> #define F first #define S second using namespace std; const int MOD = 998244353; const int mod = MOD; typedef long long ll; typedef long long LL; const int maxn = 5e4 + 5; ll pre[maxn], inv[maxn], prei[maxn]; void build(int n) { pre[1] = pre[0] = inv[1] = inv[0] = prei[1] = prei[0] = 1; for...
#include <bits/stdc++.h> #define F first #define S second using namespace std; const int MOD = 998244353; const int mod = MOD; typedef long long ll; typedef long long LL; const int maxn = 2e5 + 5; ll pre[maxn], inv[maxn], prei[maxn]; void build(int n) { pre[1] = pre[0] = inv[1] = inv[0] = prei[1] = prei[0] = 1; for...
replace
8
9
8
9
0
p02539
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; // using namespace atcoder; struct fast_ios { fast_ios() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_; #define FOR(i, begin, end) for (int i = (begin); i < (end); i++) #define REP(i, n) FOR(i, 0, n) #define IFO...
#include <bits/stdc++.h> using namespace std; // using namespace atcoder; struct fast_ios { fast_ios() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_; #define FOR(i, begin, end) for (int i = (begin); i < (end); i++) #define REP(i, n) FOR(i, 0, n) #define IFO...
replace
352
358
352
362
0
p02539
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; #define ALL(obj) (obj).begin(), (obj).end() template <class T> using priority_queue_reverse = priority_queue<T, vector<T>, greater<T>>; constexpr long long MOD = 1'000'000'000LL + 7; constexpr long long MOD2 = 998244353; constexpr long long HIGHINF =...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define ALL(obj) (obj).begin(), (obj).end() template <class T> using priority_queue_reverse = priority_queue<T, vector<T>, greater<T>>; constexpr long long MOD = 1'000'000'000LL + 7; constexpr long long MOD2 = 998244353; constexpr long long HIGHINF =...
replace
553
556
553
557
0
p02539
C++
Runtime Error
#include <iostream> using i64 = long long; template <i64 M> struct modint { i64 a; constexpr modint(const i64 x = 0) : a((x % M + M) % M) {} constexpr i64 value() const { return a; } constexpr modint inv() const { return this->pow(M - 2); } constexpr modint pow(i64 r) const { modint ans(1); modint aa ...
#include <iostream> using i64 = long long; template <i64 M> struct modint { i64 a; constexpr modint(const i64 x = 0) : a((x % M + M) % M) {} constexpr i64 value() const { return a; } constexpr modint inv() const { return this->pow(M - 2); } constexpr modint pow(i64 r) const { modint ans(1); modint aa ...
replace
378
379
378
379
0
p02539
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; typedef pair<int, int> P; const int MOD = 998244353; const int INF = 0x3f3f3f3f; const ll INFL = 0x3f3f3f3f3f3f3f3f; /* #include <atcoder/segtree> using namespace atcoder; */ ll ppow(ll a, ll b) { a ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; typedef pair<int, int> P; const int MOD = 998244353; const int INF = 0x3f3f3f3f; const ll INFL = 0x3f3f3f3f3f3f3f3f; /* #include <atcoder/segtree> using namespace atcoder; */ ll ppow(ll a, ll b) { a ...
delete
127
128
127
127
TLE
p02539
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int P = 998244353; const int N = 100005; class Comb { public: vector<int> fac; vector<int> inv; vector<int> facinv; int P; Comb() {} Comb(int N, int P) : fac(N + 1), inv(N + 1), facinv(N + 1), P(P) { fac[0] = 1; for (int i = 1; i <= N; ++i) { ...
#include <bits/stdc++.h> using namespace std; const int P = 998244353; const int N = 100005; class Comb { public: vector<int> fac; vector<int> inv; vector<int> facinv; int P; Comb() {} Comb(int N, int P) : fac(N + 1), inv(N + 1), facinv(N + 1), P(P) { fac[0] = 1; for (int i = 1; i <= N; ++i) { ...
insert
199
199
199
204
0
p02539
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int N = 1 << 18; const int mod = 998244353; const int root = 3; int lim, rev[N], w[N], wn[N], inv_lim; void reduce(int &x) { x = (x + mod) % mod; } int POW(int x, int y, int ans = 1) { for (; y; y >>= 1, x = (long long)x * x % mod) if (y & 1) ans = (long ...
#include <bits/stdc++.h> using namespace std; const int N = 1 << 18; const int mod = 998244353; const int root = 3; int lim, rev[N], w[N], wn[N], inv_lim; void reduce(int &x) { x = (x + mod) % mod; } int POW(int x, int y, int ans = 1) { for (; y; y >>= 1, x = (long long)x * x % mod) if (y & 1) ans = (long ...
insert
46
46
46
50
0
p02539
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...
replace
185
186
185
186
0
p02539
C++
Time Limit Exceeded
#include <functional> #include <iostream> #include <queue> #include <vector> using namespace std; const int MOD = 998244353; long long modPow(long long a, long long p) { if (p == 0) return 1; auto res = modPow(a, p / 2); res = (res * res) % MOD; if (p % 2) res = (res * a) % MOD; return res; } long...
#include <functional> #include <iostream> #include <queue> #include <vector> using namespace std; const int MOD = 998244353; long long modPow(long long a, long long p) { if (p == 0) return 1; auto res = modPow(a, p / 2); res = (res * res) % MOD; if (p % 2) res = (res * a) % MOD; return res; } long...
replace
111
112
111
112
TLE
p02539
C++
Runtime Error
// #define LOCAL #define _USE_MATH_DEFINES #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <ctime> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #...
// #define LOCAL #define _USE_MATH_DEFINES #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <ctime> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #...
insert
221
221
221
223
0
p02539
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; template <typename T> struct Z_p { using Type = typename decay<decltype(T::value)>::type; static vector<Type> mod_inv; constexpr Z_p() : value() {} template <typename U> Z_p(const U &x) { value = normalize(x); } template <typename U> static Type normalize(const U...
#include <bits/stdc++.h> using namespace std; template <typename T> struct Z_p { using Type = typename decay<decltype(T::value)>::type; static vector<Type> mod_inv; constexpr Z_p() : value() {} template <typename U> Z_p(const U &x) { value = normalize(x); } template <typename U> static Type normalize(const U...
replace
463
464
463
464
TLE
p02539
C++
Runtime Error
#pragma region kyopro_template #define Nyaan_template #include <bits/stdc++.h> #include <immintrin.h> #define pb push_back #define eb emplace_back #define fi first #define se second #define each(x, v) for (auto &x : v) #define all(v) (v).begin(), (v).end() #define sz(v) ((int)(v).size()) #define mem(a, val) memset(a, v...
#pragma region kyopro_template #define Nyaan_template #include <bits/stdc++.h> #include <immintrin.h> #define pb push_back #define eb emplace_back #define fi first #define se second #define each(x, v) for (auto &x : v) #define all(v) (v).begin(), (v).end() #define sz(v) ((int)(v).size()) #define mem(a, val) memset(a, v...
replace
1,600
1,603
1,600
1,603
0
p02539
C++
Time Limit Exceeded
#pragma GCC optimize("Ofast", "unroll-loops") #include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double template <ll mod = 998244353LL, ll root = 3LL> void ntt(vector<ll> &a, bool rev = false) { auto modpow = [](ll p, int q) { ll res = 1LL; while (q) { if (q & 1) ...
#pragma GCC optimize("Ofast", "unroll-loops") #include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double template <ll mod = 998244353LL, ll root = 3LL> void ntt(vector<ll> &a, bool rev = false) { auto modpow = [](ll p, int q) { ll res = 1LL; while (q) { if (q & 1) ...
replace
134
138
134
144
TLE
p02539
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define F first #define S second using namespace std; typedef long long LL; namespace Math { const int MOD107 = 1e9 + 7; const int MOD998 = 998244353; const int INT_INF = 0x3f3f3f3f; const LL LL_INF = ((LL)INT_INF << 32) | INT_INF; struct Value { virtual ~Value() = default; }; template <const...
#include <bits/stdc++.h> #define F first #define S second using namespace std; typedef long long LL; namespace Math { const int MOD107 = 1e9 + 7; const int MOD998 = 998244353; const int INT_INF = 0x3f3f3f3f; const LL LL_INF = ((LL)INT_INF << 32) | INT_INF; struct Value { virtual ~Value() = default; }; template <const...
replace
122
123
122
123
TLE
p02539
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <ctime> #include <deque> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define llint long ...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <ctime> #include <deque> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define llint long ...
replace
219
221
219
220
0
p02539
C++
Runtime Error
#include <algorithm> #include <assert.h> #include <bitset> #include <complex> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #defin...
#include <algorithm> #include <assert.h> #include <bitset> #include <complex> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; #defin...
insert
175
175
175
176
0
p02540
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<ll, ll> pll; typedef vector<ll> vi; typedef vector<pll> vpll; const ll infl = 0x3f3f3f3f3f3f3f3fLL; const int infi = 0x3f3f3f3f; #define endl '\n' #define pb push_back #define all(a) (a).begin(), (a).end() #define ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<ll, ll> pll; typedef vector<ll> vi; typedef vector<pll> vpll; const ll infl = 0x3f3f3f3f3f3f3f3fLL; const int infi = 0x3f3f3f3f; #define endl '\n' #define pb push_back #define all(a) (a).begin(), (a).end() #define ...
replace
178
179
178
179
0
p02540
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using int64 = long long; constexpr int DEBUG = 0; // Verified: AOJ-DSL1A, AGC002D class UFSet { private: vector<int> ranks; vector<int> prevs; vector<int> sizes; public: UFSet(int n) : ranks(n), prevs(n), sizes(n) { for (int i = 0; i < n; i++) prevs[i]...
#include <bits/stdc++.h> using namespace std; using int64 = long long; constexpr int DEBUG = 0; // Verified: AOJ-DSL1A, AGC002D class UFSet { private: vector<int> ranks; vector<int> prevs; vector<int> sizes; public: UFSet(int n) : ranks(n), prevs(n), sizes(n) { for (int i = 0; i < n; i++) prevs[i]...
insert
83
83
83
85
TLE
p02540
C++
Time Limit Exceeded
#include <bits/stdc++.h> typedef long long lint; using namespace std; int n; vector<pair<pair<int, int>, int>> xy; // 素集合データ構造 // ref:https://ei1333.github.io/luzhiled/snippets/structure/union-find.html struct union_find { // parent[v]==w(>=0):vの親はw // parent[v]==k(<0):vは根&&vの属するグループの要素数は-k vector<long long in...
#include <bits/stdc++.h> typedef long long lint; using namespace std; int n; vector<pair<pair<int, int>, int>> xy; // 素集合データ構造 // ref:https://ei1333.github.io/luzhiled/snippets/structure/union-find.html struct union_find { // parent[v]==w(>=0):vの親はw // parent[v]==k(<0):vは根&&vの属するグループの要素数は-k vector<long long in...
insert
59
59
59
61
TLE
p02540
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, a, b) for (int i = a; i <= b; i++) #define per(i, a, b) for (int i = a; i >= b; i--) using namespace std; typedef unsigned long long ull; typedef pair<int, int> pii; typedef long long ll; template <typename _T> inline void read(_T &f) { f = 0; _T fu = 1; char c = getchar(...
#include <bits/stdc++.h> #define rep(i, a, b) for (int i = a; i <= b; i++) #define per(i, a, b) for (int i = a; i >= b; i--) using namespace std; typedef unsigned long long ull; typedef pair<int, int> pii; typedef long long ll; template <typename _T> inline void read(_T &f) { f = 0; _T fu = 1; char c = getchar(...
replace
40
41
40
41
0
p02540
C++
Time Limit Exceeded
#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
150
151
150
152
TLE
p02540
C++
Runtime Error
#include <algorithm> #include <cstring> #include <iostream> #include <stack> using namespace std; const int maxn = 15; int n, a[maxn], x[maxn], y[maxn], mx[maxn], mn[maxn], p[maxn]; bool cmp(int b, int c) { return x[b] < x[c]; } int f(int b) { if (p[b] < 0) return b; return p[b] = f(p[b]); } int main() { i...
#include <algorithm> #include <cstring> #include <iostream> #include <stack> using namespace std; const int maxn = 200005; int n, a[maxn], x[maxn], y[maxn], mx[maxn], mn[maxn], p[maxn]; bool cmp(int b, int c) { return x[b] < x[c]; } int f(int b) { if (p[b] < 0) return b; return p[b] = f(p[b]); } int main() {...
replace
6
7
6
7
0
p02540
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 par...
#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 par...
replace
22
23
22
23
0
p02540
C++
Time Limit Exceeded
#include "bits/stdc++.h" #include <algorithm> #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++; return x; } // @param n...
#include "bits/stdc++.h" #include <algorithm> #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++; return x; } // @param n...
insert
226
226
226
228
TLE
p02540
C++
Time Limit Exceeded
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <complex> #include <cstring> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limit...
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <complex> #include <cstring> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limit...
insert
169
169
169
187
TLE
p02541
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (long long i = 0; i < n; ++i) long long extend_gcd(long long a, long long b, long long &x, long long &y) { if (b == 0) { x = 1; y = 0; return a; } else { long long d = extend_gcd(b, a % b, y, x); y -= a / b * x; return d; ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (long long i = 0; i < n; ++i) long long extend_gcd(long long a, long long b, long long &x, long long &y) { if (b == 0) { x = 1; y = 0; return a; } else { long long d = extend_gcd(b, a % b, y, x); y -= a / b * x; return d; ...
insert
20
20
20
29
0
p02541
C++
Time Limit Exceeded
#include <bits/stdc++.h> #ifdef DEBUG #define PRINT(x) \ cout << "func " << __func__ << ": line " << __LINE__ << ": " << #x << " = " \ << (x) << endl; #define PRINTA(a, first, last) \ cout << "func...
#include <bits/stdc++.h> #ifdef DEBUG #define PRINT(x) \ cout << "func " << __func__ << ": line " << __LINE__ << ": " << #x << " = " \ << (x) << endl; #define PRINTA(a, first, last) \ cout << "func...
replace
136
140
136
139
TLE
p02541
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using ull = unsigned long long; using ll = long long; using ld = long double; const int mod = 1e9 + 7; const int inf = INT_MAX; vector<ll> prime_factorize(ll n) { vector<ll> res; for (int i = 2; i * i <= n; i++) { if (n % i == 0) { res.emplace_back(1); ...
#include <bits/stdc++.h> using namespace std; using ull = unsigned long long; using ll = long long; using ld = long double; const int mod = 1e9 + 7; const int inf = INT_MAX; vector<ll> prime_factorize(ll n) { vector<ll> res; for (int i = 2; (ll)i * i <= n; i++) { if (n % i == 0) { res.emplace_back(1); ...
replace
12
13
12
13
TLE
p02541
C++
Runtime Error
#ifdef DEBUG #define _GLIBCXX_DEBUG #endif // #pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; typedef long double ld; typedef long long ll; ll m; int k; mt19937_64 rnd(228); const int BUBEN = (int)1e6 + 228; const int BUBEN2 = 15; long long multModulo(long long a, long long b, long long m) { ...
#ifdef DEBUG #define _GLIBCXX_DEBUG #endif // #pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; typedef long double ld; typedef long long ll; ll m; int k; mt19937_64 rnd(228); const int BUBEN = (int)1e6 + 228; const int BUBEN2 = 15; long long multModulo(long long a, long long b, long long m) { ...
replace
202
204
202
204
0
p02541
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, n) for (int i = 0, _n = (int)(n); i < _n; ++i) #define ALL(v) (v).begin(), (v).end() #define CLR(t, v) memset(t, (v), sizeof(t)) template <class T1, class T2> ostream &operator<<(ostream &os, const pair<T1, T2> &a) { return os << "(" ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, n) for (int i = 0, _n = (int)(n); i < _n; ++i) #define ALL(v) (v).begin(), (v).end() #define CLR(t, v) memset(t, (v), sizeof(t)) template <class T1, class T2> ostream &operator<<(ostream &os, const pair<T1, T2> &a) { return os << "(" ...
replace
32
33
32
33
0
p02541
C++
Time Limit Exceeded
#include "bits/stdc++.h" #include <algorithm> #include <cassert> #include <tuple> #include <vector> #include <utility> namespace atcoder { namespace internal { // @param m `1 <= m` // @return x mod m constexpr long long safe_mod(long long x, long long m) { x %= m; if (x < 0) x += m; return x; } // Fast ...
#include "bits/stdc++.h" #include <algorithm> #include <cassert> #include <tuple> #include <vector> #include <utility> namespace atcoder { namespace internal { // @param m `1 <= m` // @return x mod m constexpr long long safe_mod(long long x, long long m) { x %= m; if (x < 0) x += m; return x; } // Fast ...
replace
302
303
302
303
TLE
p02542
Python
Runtime Error
import networkx as nx n, m = map(int, input().split()) S = [list(input()) for _ in range(n)] G = nx.DiGraph() start = (n, m) cnt = 0 goal = (n, m + 1) for i in range(n): for j in range(n): if S[i][j] != "#": if S[i][j] == "o": cnt += 1 G.add_edge(start, (i, j)...
import networkx as nx n, m = map(int, input().split()) S = [list(input()) for _ in range(n)] G = nx.DiGraph() start = (n, m) cnt = 0 goal = (n, m + 1) for i in range(n): for j in range(m): if S[i][j] != "#": if S[i][j] == "o": cnt += 1 G.add_edge(start, (i, j)...
replace
12
13
12
13
ModuleNotFoundError: No module named 'networkx'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02542/Python/s537202768.py", line 1, in <module> import networkx as nx ModuleNotFoundError: No module named 'networkx'
p02542
C++
Runtime Error
// This Code was made by Chinese_zjc_. #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <ve...
// This Code was made by Chinese_zjc_. #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <ve...
replace
39
40
39
40
0
p02542
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; // #pragma GCC optimize("Ofast") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #define ms(s, n) memset(s, n, sizeof(s)) #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define FORd(i, a, b) for (int i = (a)-1; i >= (b); --i) #define ...
#include <bits/stdc++.h> using namespace std; // #pragma GCC optimize("Ofast") // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #define ms(s, n) memset(s, n, sizeof(s)) #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define FORd(i, a, b) for (int i = (a)-1; i >= (b); --i) #define ...
replace
179
180
179
180
0
Time elapsed: 20ms
p02542
C++
Runtime Error
#include <iostream> #include <queue> #include <vector> #define INF 0x3f3f3f3f using namespace std; struct Edge { int u, v, c, w; Edge(int u, int v, int c, int w) : u(u), v(v), c(c), w(w) {} }; class Graph { int n, s, t; vector<int> flow, dist, pre, last; vector<bool> vis; vector<Edge> edges; vector<vect...
#include <iostream> #include <queue> #include <vector> #define INF 0x3f3f3f3f using namespace std; struct Edge { int u, v, c, w; Edge(int u, int v, int c, int w) : u(u), v(v), c(c), w(w) {} }; class Graph { int n, s, t; vector<int> flow, dist, pre, last; vector<bool> vis; vector<Edge> edges; vector<vect...
replace
114
115
114
115
0
p02542
C++
Runtime Error
#include <bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp>/ // #include <ext/pb_ds/tree_policy.hpp> #define pb push_back #define mp make_pair #define PI (acos(-1.0)) #define IN freopen("nocross.in", "r", stdin) #define OUT freopen("nocross.out", "w", stdout) #define FOR(i, a, b) for (i = a; i <= b; i++) #def...
#include <bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp>/ // #include <ext/pb_ds/tree_policy.hpp> #define pb push_back #define mp make_pair #define PI (acos(-1.0)) #define IN freopen("nocross.in", "r", stdin) #define OUT freopen("nocross.out", "w", stdout) #define FOR(i, a, b) for (i = a; i <= b; i++) #def...
replace
35
36
35
36
0
p02542
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, x, y) for (int i = x, i##end = y; i <= i##end; ++i) #define _rep(i, x, y) for (int i = x, i##end = y; i >= i##end; --i) #define ll long long #define pk push_back #define N 100005 typedef std::pair<int, int> pii; int s, t; int cnt = 1, head[N], to[N], flow[N], cost[N], nxt[N]; in...
#include <bits/stdc++.h> #define rep(i, x, y) for (int i = x, i##end = y; i <= i##end; ++i) #define _rep(i, x, y) for (int i = x, i##end = y; i >= i##end; --i) #define ll long long #define pk push_back #define N 100005 typedef std::pair<int, int> pii; int s, t; int cnt = 1, head[N], to[N], flow[N], cost[N], nxt[N]; in...
replace
56
57
56
57
TLE
p02543
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define INF 1234567890 #define ll long long int N, K, Q; int X[200201]; int L[20][101001], R[20][100101]; ll LS[20][100101], RS[20][100101]; // LS[i][j] : j를 포함해서 만나는 2^i개의 정점의 번호 합 int main() { scanf("%d %d", &N, &K); for (int i = 1; i <= N; i++) scanf("%d", &X[...
#include <bits/stdc++.h> using namespace std; #define INF 1234567890 #define ll long long int N, K, Q; int X[200201]; int L[20][200201], R[20][200201]; // ll LS[20][200201], RS[20][200201]; // // LS[i][j] : j를 포함해서 만나는 2^i개의 정점의 번호 합 int main() { scanf("%d %d", &N, &K); for (int i = 1; i <= N; i++) scanf("%...
replace
8
10
8
10
0
p02543
C++
Time Limit Exceeded
/* by Natsu Kinmoe */ #include <bits/stdc++.h> using namespace std; #define SZ(x) ((int)(x).size()) #define all(x) (x).begin(), (x).end() #define loop(i, n) for (int i = 0; i < (n); i++) #define cont(i, n) for (int i = 1; i <= (n); i++) #define circ(i, a, b) for (int i = (a); i <= (b); i++) #define range(i, a, b, c) ...
/* by Natsu Kinmoe */ #include <bits/stdc++.h> using namespace std; #define SZ(x) ((int)(x).size()) #define all(x) (x).begin(), (x).end() #define loop(i, n) for (int i = 0; i < (n); i++) #define cont(i, n) for (int i = 1; i <= (n); i++) #define circ(i, a, b) for (int i = (a); i <= (b); i++) #define range(i, a, b, c) ...
replace
57
58
57
58
TLE
p02544
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #includ...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <random> #includ...
replace
294
295
294
295
0
p02546
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int n = 0; n = S.size(); if (S.at(n) == 's') { cout << S + "es" << endl; } else { cout << S + 's' << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { string S; cin >> S; int n = 0; n = S.size(); if (S.at(n - 1) == 's') { cout << S + "es" << endl; } else { cout << S + 's' << endl; } }
replace
9
10
9
10
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 5) >= this->size() (which is 5)
p02546
Python
Runtime Error
N = input() if N[len(N) - 1] == "s": N += "es" else: N += "s" print(N) N = input() if N[len(N) - 1] == "s": N += "es" else: N += "s" print(N)
N = input() if N[len(N) - 1] == "s": N += "es" else: N += "s" print(N)
delete
7
14
7
7
EOFError: EOF when reading a line
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02546/Python/s030233294.py", line 8, in <module> N = input() EOFError: EOF when reading a line
p02546
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string s, c; cin >> s; c = s; if (s[s.length() - 1] != 's') c += "s"; else { c.erase(c.end()); c += "es"; } cout << c; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s, c; cin >> s; c = s; if (s[s.length() - 1] != 's') c += "s"; else { c += "es"; } cout << c; return 0; }
delete
9
10
9
9
0
p02546
C++
Runtime Error
#pragma warning(disable : 4996) #include <iostream> #include <stdio.h> #include <string.h> using namespace std; #define MAX 1001 char str[MAX]; int main() { scanf("%s", str); for (int i = 0; str[i] != '\0'; i++) { if (str[i + 1] == '\0') { if (str[i] == 's') strcat(str, "es"); else ...
#pragma warning(disable : 4996) #include <iostream> #include <stdio.h> #include <string.h> using namespace std; #define MAX 1010 char str[MAX]; int main() { scanf("%s", str); for (int i = 0; str[i] != '\0'; i++) { if (str[i + 1] == '\0') { if (str[i] == 's') strcat(str, "es"); else ...
replace
5
6
5
6
0
p02546
C++
Runtime Error
#include <iostream> #include <string> using namespace std; int main() { string a; string d = "es", e = "s"; int b = a.size(); char c = a.at(b - 1); if (c == 's') cout << a + d; else cout << a + e; return 0; }
#include <iostream> #include <string> using namespace std; int main() { string a; cin >> a; string d = "es", e = "s"; int b = a.size(); char c = a.at(b - 1); if (c == 's') cout << a + d; else cout << a + e; return 0; }
insert
5
5
5
6
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 18446744073709551615) >= this->size() (which is 0)
p02546
C++
Runtime Error
#include <iostream> #include <string> using namespace std; int main() { string s; if (s.at(s.size() - 1) == 's') { cout << s << "es"; } else { cout << s << "s"; } }
#include <iostream> #include <string> using namespace std; int main() { string s; int a; cin >> s; a = s.size(); if (s.at(a - 1) == 's') { cout << s << "es"; } else { cout << s << "s"; } }
replace
6
7
6
10
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 18446744073709551615) >= this->size() (which is 0)
p02546
C++
Runtime Error
#include <iostream> #include <string> using namespace std; int main() { int i; string str; cin >> str; int str1 = str.size(); if (str.at(str1) == 's') { cout << str + "es" << endl; } else { cout << str + "s" << endl; } }
#include <iostream> #include <string> using namespace std; int main() { int i; string str; cin >> str; int str1 = str.size(); if (str.at(str1 - 1) == 's') { cout << str + "es" << endl; } else { cout << str + "s" << endl; } }
replace
9
10
9
10
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 5) >= this->size() (which is 5)
p02546
C++
Runtime Error
#include <cstring> #include <iostream> #include <map> #include <math.h> #include <vector> typedef long long ll; // sort(rt,rt+sizeof(rt)/sizeof(rt[0]),greater<>()); using namespace std; #define rep(i, n) for (i = 0; i < n; i++) int main() { char n[100]; cin >> n; int a; a = (int)strlen(n); if (n[a - 1] == '...
#include <cstring> #include <iostream> #include <map> #include <math.h> #include <vector> typedef long long ll; // sort(rt,rt+sizeof(rt)/sizeof(rt[0]),greater<>()); using namespace std; #define rep(i, n) for (i = 0; i < n; i++) int main() { char n[1001]; cin >> n; int a; a = (int)strlen(n); if (n[a - 1] == ...
replace
12
13
12
13
0
p02546
C++
Runtime Error
#include <cstring> #include <iostream> using namespace std; int main() { char s[1000]; cin >> s; char s0[] = "es"; char s1[] = "s"; if (s[strlen(s) - 1] == 's') { strcat(s, s0); cout << s << endl; } else { strcat(s, s1); cout << s << endl; } }
#include <cstring> #include <iostream> using namespace std; int main() { char s[10000]; cin >> s; char s0[] = "es"; char s1[] = "s"; if (s[strlen(s) - 1] == 's') { strcat(s, s0); cout << s << endl; } else { strcat(s, s1); cout << s << endl; } }
replace
5
6
5
6
0
p02546
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstring> using namespace std; int main(void) { char s[103]; int i, len, k = 0; scanf("%s", s); len = strlen(s); if (s[len - 1] == 's') { s[len] = 'e'; s[len + 1] = 's'; k = 1; } else s[len] = 's'; if (k == 1) { for (i = 0; i < len + 2; i...
#include <algorithm> #include <cstdio> #include <cstring> using namespace std; int main(void) { char s[1003]; int i, len, k = 0; scanf("%s", s); len = strlen(s); if (s[len - 1] == 's') { s[len] = 'e'; s[len + 1] = 's'; k = 1; } else s[len] = 's'; if (k == 1) { for (i = 0; i < len + 2; ...
replace
5
6
5
6
0
p02546
C++
Runtime Error
#include <stdio.h> #include <string.h> int main() { char s[255]; scanf("%s", s); if (s[strlen(s) - 1] == 's') printf("%ses", s); else printf("%ss", s); return 0; }
#include <stdio.h> #include <string.h> int main() { char s[1005]; scanf("%s", s); if (s[strlen(s) - 1] == 's') printf("%ses", s); else printf("%ss", s); return 0; }
replace
4
5
4
5
0
p02546
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { string str; if (str.at(str.size() - 1) == 's') cout << str + "es" << endl; else cout << str + 's' << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string str; cin >> str; if (str.at(str.size() - 1) == 's') cout << str + "es" << endl; else cout << str + 's' << endl; }
insert
5
5
5
6
-6
terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::at: __n (which is 18446744073709551615) >= this->size() (which is 0)
p02546
C++
Runtime Error
#include <iostream> #include <string.h> using namespace std; int main() { char w[1000]; cin >> w; int l = strlen(w); if (w[l - 1] == 's') { char p[l + 1]; w[l] = 'e'; w[l + 1] = 's'; strcpy(p, w); for (int i = 0; i <= l + 1; i++) { cout << p[i]; } } else { w[l] = 's'; ...
#include <iostream> #include <string.h> using namespace std; int main() { char w[1000]; cin >> w; int l = strlen(w); if (w[l - 1] == 's') cout << w << "es"; else cout << w << 's'; }
replace
7
25
7
11
0