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
p02965
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define mod 998244353 #define MN 1500000 inline int read() { int x = 0, f = 1; char ch = getchar(); while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); } while (ch >= '0' && ch <= '9') { x = x * 10 + ch - '0'; ch = getchar()...
#include <bits/stdc++.h> using namespace std; #define mod 998244353 #define MN 2500000 inline int read() { int x = 0, f = 1; char ch = getchar(); while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); } while (ch >= '0' && ch <= '9') { x = x * 10 + ch - '0'; ch = getchar()...
replace
3
4
3
4
0
p02965
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using i64 = long long; template <i64 M> constexpr i64 euinv(i64 val) { i64 a = M, b = val; i64 x = 0, u = 1; while (b) { i64 t = a / b; swap(a -= t * b, b); swap(x -= t * u, u); } return x < 0 ? x + M : x; } template <i64 M> struct modint { i64 a; ...
#include <bits/stdc++.h> using namespace std; using i64 = long long; template <i64 M> constexpr i64 euinv(i64 val) { i64 a = M, b = val; i64 x = 0, u = 1; while (b) { i64 t = a / b; swap(a -= t * b, b); swap(x -= t * u, u); } return x < 0 ? x + M : x; } template <i64 M> struct modint { i64 a; ...
replace
145
148
145
148
0
p02965
C++
Runtime Error
#include <bits/stdc++.h> using ll = long long; using namespace std; const ll MAX = 1500100, MOD = 998244353; ll fac[MAX], finv[MAX], inv[MAX]; // 前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % MOD; inv[i] = MOD - in...
#include <bits/stdc++.h> using ll = long long; using namespace std; const ll MAX = 3500100, MOD = 998244353; ll fac[MAX], finv[MAX], inv[MAX]; // 前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % MOD; inv[i] = MOD - in...
replace
4
5
4
5
0
p02965
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...
replace
24
25
24
25
0
p02965
C++
Runtime Error
#include <cstdio> const int MAX = 1500000; const int MOD = 998244353; int add(int a, int b) { return (a + b) % MOD; } int mul(int a, int b) { return 1LL * a * b % MOD; } int sub(int a, int b) { return add(a, MOD - b); } int pow_mod(int b, int p) { int ret = 1; while (p) { if (p & 1) ret = mul(ret, b); ...
#include <cstdio> const int MAX = 3000000; const int MOD = 998244353; int add(int a, int b) { return (a + b) % MOD; } int mul(int a, int b) { return 1LL * a * b % MOD; } int sub(int a, int b) { return add(a, MOD - b); } int pow_mod(int b, int p) { int ret = 1; while (p) { if (p & 1) ret = mul(ret, b); ...
replace
1
2
1
2
0
p02965
C++
Runtime Error
// C - GP 2 #include <bits/stdc++.h> using namespace std; #define MOD 998244353 struct FactTable { vector<long long> a; FactTable(int n) : a(n + 1, 1) { for (int i = 2; i < a.size(); i++) a[i] = a[i - 1] * i % MOD; } inline long long operator()(int n) { return a[n]; } } fact(1000000); long long mi...
// C - GP 2 #include <bits/stdc++.h> using namespace std; #define MOD 998244353 struct FactTable { vector<long long> a; FactTable(int n) : a(n + 1, 1) { for (int i = 2; i < a.size(); i++) a[i] = a[i - 1] * i % MOD; } inline long long operator()(int n) { return a[n]; } } fact(2000000); long long mi...
replace
14
15
14
15
0
p02965
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) #define rrep(i, n) for (int i = 1; i <= (n); ++i) #define drep(i, n) for (int i = (n)-1; i >= 0; --i) #define foreach(it, v) \ for (typeof(v.begin()) it = v.begin(); i...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) #define rrep(i, n) for (int i = 1; i <= (n); ++i) #define drep(i, n) for (int i = (n)-1; i >= 0; --i) #define foreach(it, v) \ for (typeof(v.begin()) it = v.begin(); i...
replace
20
21
20
21
0
p02965
C++
Runtime Error
#include <cstdio> #define RI register int #define CI const int & using namespace std; const int N = 3000005, mod = 998244353; int n, m, fact[N], inv[N], ans, tp; inline void inc(int &x, CI y) { if ((x += y) >= mod) x -= mod; } inline void dec(int &x, CI y) { if ((x -= y) < 0) x += mod; } inline int quick_po...
#include <cstdio> #define RI register int #define CI const int & using namespace std; const int N = 3000005, mod = 998244353; int n, m, fact[N], inv[N], ans, tp; inline void inc(int &x, CI y) { if ((x += y) >= mod) x -= mod; } inline void dec(int &x, CI y) { if ((x -= y) < 0) x += mod; } inline int quick_po...
insert
21
21
21
23
0
p02965
C++
Runtime Error
// Words are flowing out like endless rain into a paper cup // They slither while they pass they slip away across the universe // Pools of sorrow, waves of joy are drifting through my open mind // Possessing and caressing me #include <bits/stdc++.h> using namespace std; using LL = long long; namespace _buff { const...
// Words are flowing out like endless rain into a paper cup // They slither while they pass they slip away across the universe // Pools of sorrow, waves of joy are drifting through my open mind // Possessing and caressing me #include <bits/stdc++.h> using namespace std; using LL = long long; namespace _buff { const...
replace
42
43
42
43
0
p02965
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long const int N = 1000005, M = 998244353; int fac[N], inv[N], n, m, ans; int ksm(int x, int y) { int ans = 1; for (; y; y >>= 1, x = x * x % M) if (y & 1) (ans *= x) %= M; return ans; } int C(int x, int y) { if (x < y) return 0; ret...
#include <bits/stdc++.h> using namespace std; #define int long long const int N = 3000005, M = 998244353; int fac[N], inv[N], n, m, ans; int ksm(int x, int y) { int ans = 1; for (; y; y >>= 1, x = x * x % M) if (y & 1) (ans *= x) %= M; return ans; } int C(int x, int y) { if (x < y) return 0; ret...
replace
3
4
3
4
0
p02965
C++
Runtime Error
// #include <bits/stdc++.h> #include "bits/stdc++.h" using namespace std; typedef long long ll; // #include "boost/multiprecision/cpp_int.hpp" // typedef boost::multiprecision::cpp_int ll; typedef long double dd; // #define i_7 (ll)(1E9+7) #define i_7 998244353 #define i_5 i_7 - 2 ll mod(ll a) { ll c = a % i_7; if...
// #include <bits/stdc++.h> #include "bits/stdc++.h" using namespace std; typedef long long ll; // #include "boost/multiprecision/cpp_int.hpp" // typedef boost::multiprecision::cpp_int ll; typedef long double dd; // #define i_7 (ll)(1E9+7) #define i_7 998244353 #define i_5 i_7 - 2 ll mod(ll a) { ll c = a % i_7; if...
replace
70
71
70
71
0
p02965
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; const int N = (int)1e6 + 5, M = (int)5e5 + 5, mod = 998244353; int n, m, fact[4 * M], inv_fact[4 * M], ans; int add(int _a, int _b) { _a += _b; if (_a >= mod) _a -= mod; return _a; } int multi(int _a, int _b) { return (int)((ll)_a * _b %...
#include <bits/stdc++.h> using namespace std; using ll = long long; const int N = (int)1e6 + 5, M = (int)5e5 + 5, mod = 998244353; int n, m, fact[4 * M], inv_fact[4 * M], ans; int add(int _a, int _b) { _a += _b; if (_a >= mod) _a -= mod; return _a; } int multi(int _a, int _b) { return (int)((ll)_a * _b %...
insert
27
27
27
29
0
p02965
C++
Runtime Error
#include <bits/stdc++.h> #define Tp template <typename Ty> #define Ts template <typename Ty, typename... Ar> #define Reg register #define RI Reg int #define Con const #define CI Con int & #define I inline #define W while #define SZ 5000000 #define X 998244353 #define Qinv(x) Qpow(x, X - 2) #define Inc(x, y) ((x += (y))...
#include <bits/stdc++.h> #define Tp template <typename Ty> #define Ts template <typename Ty, typename... Ar> #define Reg register #define RI Reg int #define Con const #define CI Con int & #define I inline #define W while #define SZ 5000000 #define X 998244353 #define Qinv(x) Qpow(x, X - 2) #define Inc(x, y) ((x += (y))...
replace
13
14
13
15
0
p02965
C++
Runtime Error
// #define NDEBUG #include <cstddef> #include <cstdint> #include <iostream> #include <vector> namespace n91 { using i8 = std::int_fast8_t; using i32 = std::int_fast32_t; using i64 = std::int_fast64_t; using u8 = std::uint_fast8_t; using u32 = std::uint_fast32_t; using u64 = std::uint_fast64_t; using isize = std::ptrd...
// #define NDEBUG #include <cstddef> #include <cstdint> #include <iostream> #include <vector> namespace n91 { using i8 = std::int_fast8_t; using i32 = std::int_fast32_t; using i64 = std::int_fast64_t; using u8 = std::uint_fast8_t; using u32 = std::uint_fast32_t; using u64 = std::uint_fast64_t; using isize = std::ptrd...
insert
236
236
236
239
0
p02965
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long const int MAX = 200000; const int MOD = 998244353; // int fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % MOD; ...
#include <bits/stdc++.h> using namespace std; #define int long long const int MAX = 2000000; const int MOD = 998244353; // int fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % MOD;...
replace
3
4
3
4
0
p02965
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> #define MOD 998244353 #define mkp make_pair typedef long long ll; using namespace std; #define MAX_N 200020 ll inv[MAX_N + 10], fac[MAX_N + 10], ifac[MAX_N + 1...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> #define MOD 998244353 #define mkp make_pair typedef long long ll; using namespace std; #define MAX_N 4000040 ll inv[MAX_N + 10], fac[MAX_N + 10], ifac[MAX_N + ...
replace
14
15
14
15
0
p02965
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; template <class T> inline T updmax(T &a, T b) { return a = max(a, b); } template <class T> inline T updmin(T &a, T b) { return a = min(a, b); } template <unsigned long long mod> class modint { public: unsigned long long v; modint(const long long x = 0) : v(x % mod) {...
#include <bits/stdc++.h> using namespace std; template <class T> inline T updmax(T &a, T b) { return a = max(a, b); } template <class T> inline T updmin(T &a, T b) { return a = min(a, b); } template <unsigned long long mod> class modint { public: unsigned long long v; modint(const long long x = 0) : v(x % mod) {...
replace
61
62
61
62
0
p02965
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <complex> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> using namespace std; typedef long long...
#include <algorithm> #include <bitset> #include <cassert> #include <complex> #include <cstdio> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> using namespace std; typedef long long...
replace
30
31
30
31
0
p02965
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; using vi = vector<int>; using vl = vector<ll>; using vvi = vector<vi>; using vvl = vector<vl>; const ll INF = 1LL << 60; const ll MOD = 998244353; template <class T> bool chmax(T &a, const T &b) { ...
#include "bits/stdc++.h" using namespace std; using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; using vi = vector<int>; using vl = vector<ll>; using vvi = vector<vi>; using vvl = vector<vl>; const ll INF = 1LL << 60; const ll MOD = 998244353; template <class T> bool chmax(T &a, const T &b) { ...
replace
152
153
152
153
0
p02966
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstring> #define ll long long using namespace std; int n; ll a[305][305], sum[305][305], f[305][305], s[305][305]; int main() { scanf("%d", &n); for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) { if (i != j) scanf("%lld", &a[i][j]); s...
#include <algorithm> #include <cstdio> #include <cstring> #define ll long long using namespace std; int n; ll a[505][505], sum[505][505], f[505][505], s[505][505]; int main() { scanf("%d", &n); for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) { if (i != j) scanf("%lld", &a[i][j]); s...
replace
6
7
6
7
0
p02966
C++
Memory Limit Exceeded
#include <bits/stdc++.h> using namespace std; const int maxn = 510; int n, a[maxn][maxn]; long long from[maxn][maxn], to[maxn][maxn], dp[maxn][maxn][maxn], ans; void cmin(long long &x, long long y) { x = min(x, y); } int main() { scanf("%d", &n); for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) ...
#include <bits/stdc++.h> using namespace std; const int maxn = 500; int n, a[maxn][maxn]; long long from[maxn][maxn], to[maxn][maxn], dp[maxn][maxn][maxn], ans; void cmin(long long &x, long long y) { x = min(x, y); } int main() { scanf("%d", &n); for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) ...
replace
3
4
3
4
MLE
p02967
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int N = 1e6 + 10; int le[N], ri[N], a[N], n; int A, B, C, cnt[4], h[4]; char e; void del(int x) { le[ri[x]] = le[x]; ri[le[x]] = ri[x]; h[a[x]]--; } int getmin() { int g = -1; for (int i = 0; i < 3; i++) if (cnt[i] != -1 && (g == -1 || cnt[g] > cnt[i])) ...
#include <bits/stdc++.h> using namespace std; const int N = 1e6 + 10; int le[N], ri[N], a[N], n; int A, B, C, cnt[4], h[4]; char e; void del(int x) { le[ri[x]] = le[x]; ri[le[x]] = ri[x]; h[a[x]]--; } int getmin() { int g = -1; for (int i = 0; i < 3; i++) if (cnt[i] != -1 && (g == -1 || cnt[g] > cnt[i])) ...
insert
38
38
38
40
0
p02967
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int _ = 1e6 + 7; char str[_], tmp[_]; int L, cnt[3], id[3]; void change() { for (int i = 0; i < 3; ++i) id[i] = i; for (int i = 1; i <= L; ++i) ++cnt[str[i] - 'A']; sort(id, id + 3, [&](int x, int y) { return cnt[x] < cnt[y]; }); for (int i = 1; i <=...
#include <bits/stdc++.h> using namespace std; const int _ = 1e6 + 7; char str[_], tmp[_]; int L, cnt[3], id[3]; void change() { for (int i = 0; i < 3; ++i) id[i] = i; for (int i = 1; i <= L; ++i) ++cnt[str[i] - 'A']; sort(id, id + 3, [&](int x, int y) { return cnt[x] < cnt[y]; }); for (int i = 1; i <=...
replace
123
124
123
125
0
p02968
C++
Runtime Error
#include <bits/stdc++.h> #define reg register #define pr std::pair<int, int> #define fi first #define se second #define FIN(s) freopen(s, "r", stdin) #define FOUT(s) freopen(s, "w", stdout) #define debug(...) fprintf(stderr, __VA_ARGS__) #define rep(i, l, r) for (int i = l; i <= r; ++i) #define lep(i, l, r) for (int i...
#include <bits/stdc++.h> #define reg register #define pr std::pair<int, int> #define fi first #define se second #define FIN(s) freopen(s, "r", stdin) #define FOUT(s) freopen(s, "w", stdout) #define debug(...) fprintf(stderr, __VA_ARGS__) #define rep(i, l, r) for (int i = l; i <= r; ++i) #define lep(i, l, r) for (int i...
replace
57
58
57
58
0
p02968
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define re register #define ull unsigned ll using namespace std; inline int read() { int s = 0, t = 1; char ch = getchar(); while (ch < '0' || ch > '9') { if (ch == '-') t = -1; ch = getchar(); } while (ch >= '0' && ch <= '9') s = (s << 3) + (s <...
#include <bits/stdc++.h> #define ll long long #define re register #define ull unsigned ll using namespace std; inline int read() { int s = 0, t = 1; char ch = getchar(); while (ch < '0' || ch > '9') { if (ch == '-') t = -1; ch = getchar(); } while (ch >= '0' && ch <= '9') s = (s << 3) + (s <...
replace
17
18
17
18
0
p02968
C++
Runtime Error
/*Lucky_Glass*/ #include <algorithm> #include <cstdio> #include <cstring> #include <vector> using namespace std; const int N = 300; int n, mod, Nf, Ng; vector<pair<int, int>> Epr; int Ef[N + 3][N + 3]; int main() { scanf("%d%d", &n, &mod); Nf = 2 * n - 1; Ng = 2 * n - 1; for (int i = 0; i < 2 * n; i++) { ...
/*Lucky_Glass*/ #include <algorithm> #include <cstdio> #include <cstring> #include <vector> using namespace std; const int N = 700; int n, mod, Nf, Ng; vector<pair<int, int>> Epr; int Ef[N + 3][N + 3]; int main() { scanf("%d%d", &n, &mod); Nf = 2 * n - 1; Ng = 2 * n - 1; for (int i = 0; i < 2 * n; i++) { ...
replace
7
8
7
8
0
p02968
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--) #define REP(i, n) for (int i = (0); i < (n); i++) #define fi first #define se second #define pb push_back #define mp make_pair #define clr(x) memset(x, 0, sizeof x) using namespace std; t...
#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--) #define REP(i, n) for (int i = (0); i < (n); i++) #define fi first #define se second #define pb push_back #define mp make_pair #define clr(x) memset(x, 0, sizeof x) using namespace std; t...
replace
27
28
27
28
0
p02968
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <queue> #include <vector> #define LL long long #define LD long double using namespace std; const int NN = 400 + 117; const int MM = 200 + 117; int read() { int fl = 1, x; char c; for (c = get...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <queue> #include <vector> #define LL long long #define LD long double using namespace std; const int NN = 400 + 117; const int MM = 200 + 117; int read() { int fl = 1, x; char c; for (c = get...
replace
82
83
82
83
TLE
p02969
C++
Runtime Error
#include <bits/stdc++.h> // #include<unordered_map> #define debug(x) (cout << "#x = " << (x) << endl) #define ls(x) (x << 1) #define rs(x) (x << 1 | 1) // #define mid (l + r >> 1) #define lowbit(x) (x & -x) #define Set(x, i) memset(x, i, sizeof x) #define R register #define For(i, j, k) for (R int i = (j); i <= (k); ++...
#include <bits/stdc++.h> // #include<unordered_map> #define debug(x) (cout << "#x = " << (x) << endl) #define ls(x) (x << 1) #define rs(x) (x << 1 | 1) // #define mid (l + r >> 1) #define lowbit(x) (x & -x) #define Set(x, i) memset(x, i, sizeof x) #define R register #define For(i, j, k) for (R int i = (j); i <= (k); ++...
replace
65
66
65
66
10
p02969
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define int lon...
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define int lon...
replace
12
16
12
13
0
p02969
C++
Runtime Error
#include <iostream> int main(void) { int r; std::cin >> r; std::cout << 3 * (r * r); return true; }
#include <iostream> int main(void) { int r; std::cin >> r; std::cout << 3 * (r * r); return 0; }
replace
6
7
6
7
1
p02969
C++
Runtime Error
/**akshaykumar99**/ #include <bits/stdc++.h> using namespace std; #define F first #define S second #define pp pop_back() #define pu(x) push_back(x) #define eb(x) emplace_back(x) #define mp(a, b) make_pair(a, b) #define all(v) v.begin(), v.end() #define f(i, x, n) for (i = x; i < n; i++) #define rall(v) v.rbegin(), v....
/**akshaykumar99**/ #include <bits/stdc++.h> using namespace std; #define F first #define S second #define pp pop_back() #define pu(x) push_back(x) #define eb(x) emplace_back(x) #define mp(a, b) make_pair(a, b) #define all(v) v.begin(), v.end() #define f(i, x, n) for (i = x; i < n; i++) #define rall(v) v.rbegin(), v....
delete
27
31
27
27
0
p02969
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define PI 3.14159265 #define ll long long #define vi vector<int> #define pb push_back #define vll vector<ll> #define vvi vector<vi> #define pii pair<int, int> #define pll pair<long long, long long> #define mod 100000000 #define inf 1000000000000000001; #define all(c) c.beg...
#include <bits/stdc++.h> using namespace std; #define PI 3.14159265 #define ll long long #define vi vector<int> #define pb push_back #define vll vector<ll> #define vvi vector<vi> #define pii pair<int, int> #define pll pair<long long, long long> #define mod 100000000 #define inf 1000000000000000001; #define all(c) c.beg...
replace
36
40
36
40
0
p02969
C++
Runtime Error
#include <iostream> using namespace std; int main() { int i; cin >> i; cout << i << endl; return i * i * 3; }
#include <iostream> using namespace std; int main() { int i; cin >> i; cout << 3 * i * i << endl; // return 0; };
replace
5
8
5
8
48
p02969
C++
Runtime Error
#include <bits/stdc++.h> #define INF INT_MAX #define endl '\n' #define ll long long int #define N 1000005 using namespace std; inline int redi() { int ret = 0, f = 0; char ch = getchar_unlocked(); while (!isdigit(ch)) { if (ch == '-') f = 1; ch = getchar_unlocked(); } while (isdigit(ch)) { ...
#include <bits/stdc++.h> #define INF INT_MAX #define endl '\n' #define ll long long int #define N 1000005 using namespace std; inline int redi() { int ret = 0, f = 0; char ch = getchar_unlocked(); while (!isdigit(ch)) { if (ch == '-') f = 1; ch = getchar_unlocked(); } while (isdigit(ch)) { ...
replace
47
48
47
48
0
p02969
C++
Time Limit Exceeded
#include <algorithm> #include <bits/stdc++.h> #include <cstdlib> #include <iostream> #include <math.h> #include <string> #include <vector> using namespace std; template <class T> using V = vector<T>; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } tem...
#include <algorithm> #include <bits/stdc++.h> #include <cstdlib> #include <iostream> #include <math.h> #include <string> #include <vector> using namespace std; template <class T> using V = vector<T>; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } tem...
replace
111
112
111
112
TLE
p02969
C++
Time Limit Exceeded
#include <algorithm> #include <bits/stdc++.h> #include <cstdlib> #include <iostream> #include <math.h> #include <string> #include <vector> using namespace std; template <class T> using V = vector<T>; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } tem...
#include <algorithm> #include <bits/stdc++.h> #include <cstdlib> #include <iostream> #include <math.h> #include <string> #include <vector> using namespace std; template <class T> using V = vector<T>; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } tem...
replace
111
112
111
112
TLE
p02969
C++
Runtime Error
#include <bits/stdc++.h> #include <cmath> #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define SUBL \ freopen("/home/...
#include <bits/stdc++.h> #include <cmath> #define fastio \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define SUBL \ freopen("/home/...
replace
33
34
33
36
0
p02969
C++
Runtime Error
#include <bits/stdc++.h> #define int long long #define x first #define y second #define pb push_back #define speed \ ios_base::sync_with_stdio(0); \ cin.tie(0); using namespace std; signed main() { #ifnd...
#include <bits/stdc++.h> #define int long long #define x first #define y second #define pb push_back #define speed \ ios_base::sync_with_stdio(0); \ cin.tie(0); using namespace std; signed main() { spe...
delete
11
15
11
11
0
p02969
Python
Runtime Error
r = input() s = 3 * (r**2) print(s)
r = int(input()) s = 3 * (r**2) print(s)
replace
0
1
0
1
TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02969/Python/s133388758.py", line 2, in <module> s = 3 * (r ** 2) TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'
p02969
Python
Runtime Error
r = input() print(3 * r * r)
r = int(input()) print(3 * r * r)
replace
0
1
0
1
TypeError: can't multiply sequence by non-int of type 'str'
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02969/Python/s048208097.py", line 2, in <module> print(3 * r * r) TypeError: can't multiply sequence by non-int of type 'str'
p02969
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int a; cin >> a; a *= 3 * a; cout << a << endl; return a; }
#include <bits/stdc++.h> using namespace std; int main() { int a; cin >> a; a *= 3 * a; cout << a << endl; return 0; }
replace
8
9
8
9
48
p02970
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, d; cin >> n >> d; int ans = n / (2 * d + 1); if (n % (ans * (2 * d + 1)) != 0) { ans++; } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n, d; cin >> n >> d; int a = 2 * d + 1; int ans = n / a; if (ans * a != n) { ans++; } cout << ans << endl; }
replace
7
9
7
10
0
p02970
C++
Runtime Error
// include,using,define等 #pragma region header #include <algorithm> #include <assert.h> #include <bitset> #include <cassert> #include <cctype> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdint> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <...
// include,using,define等 #pragma region header #include <algorithm> #include <assert.h> #include <bitset> #include <cassert> #include <cctype> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdint> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <...
replace
201
202
201
202
0
p02970
C++
Runtime Error
//----------BHAVIK DIWANI(PICT_COMP)--------------- #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define test \ ll t; \ c...
//----------BHAVIK DIWANI(PICT_COMP)--------------- #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define test \ ll t; \ c...
insert
102
102
102
103
0
p02970
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> using namespace std; #define rg register #define LL long long #define __space putchar(' ') #define __endl putchar('\n') template <typename qwq> inline void read(...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> using namespace std; #define rg register #define LL long long #define __space putchar(' ') #define __endl putchar('\n') template <typename qwq> inline void read(...
replace
42
43
42
45
0
p02970
C++
Runtime Error
#include <iostream> using namespace std; int main(void) { int n, d; cin >> n >> d; cout << n / (2 * d + 1) + (n % (2 * d + 1) == 0 ? 0 : 1) << endl; return 1; }
#include <iostream> using namespace std; int main(void) { int n, d; cin >> n >> d; cout << n / (2 * d + 1) + (n % (2 * d + 1) == 0 ? 0 : 1) << endl; return 0; }
replace
9
10
9
10
1
p02970
C++
Runtime Error
#include <bits/stdc++.h> #include <string> #include <vector> using namespace std; int main() { int n, d; cin >> n >> d; int count = 0; int tree[20]; for (int i = 0; i < n; i++) { tree[i] = 0; } for (int i = 0; i < n; i++) { if (tree[i] == 0) { for (int j = i; j <= i + 2 * d; j++) { ...
#include <bits/stdc++.h> #include <string> #include <vector> using namespace std; int main() { int n, d; cin >> n >> d; int count = 0; int tree[100]; for (int i = 0; i < n; i++) { tree[i] = 0; } for (int i = 0; i < n; i++) { if (tree[i] == 0) { for (int j = i; j <= i + 2 * d; j++) { ...
replace
8
9
8
9
0
p02970
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define REPI(i, n) for (int i = 0; i < n; i++) #define REPJ(j, n) for (int j = 0; j < n; j++) using ll = long long; using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int n, d, ans = 0; cin >> n >> d; d = 2 * d + 1; for (; n > 0; ans++) d -= n; cout...
#include <bits/stdc++.h> #define REPI(i, n) for (int i = 0; i < n; i++) #define REPJ(j, n) for (int j = 0; j < n; j++) using ll = long long; using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int n, d, ans = 0; cin >> n >> d; d = 2 * d + 1; for (; n > 0; ans++) n -= d; cout...
replace
16
17
16
17
TLE
p02970
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int n; cin >> n; int d; cin >> d; d = d * 2; d++; d = n / d; if (n % d != 0) d++; cout << d << endl; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int n; cin >> n; int d; cin >> d; d = d * 2; d++; // cout<<d<<endl; int u = n / d; if (u == 0) u++; else { if (n % d != 0) u++; } cout << u << endl; }
replace
13
17
13
22
0
p02970
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, d, c = 0; cin >> n >> d; vector<int> v; int a = (d + 1); while (a <= n) { c++; v.push_back(a); a += (2 * d + 1); } if ((n - (*(v.end() - 1))) > d) c++; cout << c; }
#include <bits/stdc++.h> using namespace std; int main() { int n, d, c = 0; cin >> n >> d; vector<int> v; int a = (d + 1); while (a <= n) { c++; v.push_back(a); a += (2 * d + 1); } if (c == 0) { cout << "1"; return 0; } if ((n - (*(v.end() - 1))) > d) c++; cout << c; }
insert
13
13
13
17
0
p02970
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N, D; cin >> N >> D; int i = 1; int look = 0; while (1) { look += 2 * D + 1; if (look >= N) { return i; } i++; } cout << i << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N, D; cin >> N >> D; int i = 1; int look = 0; while (1) { look += 2 * D + 1; if (look >= N) { break; } i++; } cout << i << endl; }
replace
11
12
11
12
2
p02970
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int main() { long long n, m, sum = 0, mod = 2019; cin >> n, m; cout << n / (2 * m) + 1 << endl; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int main() { long long n, m, sum = 0, mod = 2019; cin >> n >> m; if (n % (2 * m + 1) == 0) cout << n / (2 * m + 1) << endl; else cout << n / (2 * m + 1) + 1 << endl; }
replace
6
9
6
11
0
p02970
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define int lon...
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0); #define int lon...
replace
12
16
12
13
0
p02970
C++
Runtime Error
#include <bits/stdc++.h> #define int long long #define x first #define y second #define pb push_back #define speed \ ios_base::sync_with_stdio(0); \ cin.tie(0); using namespace std; signed main() { #ifnd...
#include <bits/stdc++.h> #define int long long #define x first #define y second #define pb push_back #define speed \ ios_base::sync_with_stdio(0); \ cin.tie(0); using namespace std; signed main() { spe...
delete
11
15
11
11
0
p02970
Python
Runtime Error
n, d = map(int, input()) print(-(-n // (1 + d * 2)))
n, d = map(int, input().split()) print(-(-n // (1 + d * 2)))
replace
0
1
0
1
ValueError: invalid literal for int() with base 10: ' '
Traceback (most recent call last): File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02970/Python/s626799708.py", line 1, in <module> n, d = map(int, input()) ValueError: invalid literal for int() with base 10: ' '
p02971
C++
Runtime Error
#include <bits/stdc++.h> typedef long long ll; #define mod 1000000007 #define pb push_back #define mp(a, b) make_pair(a, b) #define pii pair<int, int> #define pll pair<ll, ll> #define vll vector<ll> #define vii vector<int> #define vpii vector<pii> #define vpll vector<pll> #define ff first #define ss second #define matr...
#include <bits/stdc++.h> typedef long long ll; #define mod 1000000007 #define pb push_back #define mp(a, b) make_pair(a, b) #define pii pair<int, int> #define pll pair<ll, ll> #define vll vector<ll> #define vii vector<int> #define vpii vector<pii> #define vpll vector<pll> #define ff first #define ss second #define matr...
replace
39
40
39
40
0
p02971
C++
Time Limit Exceeded
#include <bits/stdc++.h> #include <math.h> #include <stdio.h> using namespace std; using vi = vector<int>; using vvi = vector<vector<int>>; using ll = long long int; int main() { int N; cin >> N; vi vec(N); for (int i = 0; i < N; i++) { cin >> vec[i]; } for (int i = 0; i < N; i++) { vi v = vec; ...
#include <bits/stdc++.h> #include <math.h> #include <stdio.h> using namespace std; using vi = vector<int>; using vvi = vector<vector<int>>; using ll = long long int; int main() { int N; cin >> N; vi vec(N); for (int i = 0; i < N; i++) { cin >> vec[i]; } vi v = vec; int num = v.size(); sort(v.begin(...
replace
15
20
15
43
TLE
p02971
C++
Runtime Error
#include <iostream> using namespace std; const int N = 20000; int main() { int n, array[N], max_value1 = -1, max_value2 = -1, max_index = 0; cin >> n; for (int i = 0; i < n; i++) { cin >> array[i]; } for (int i = 0; i < n; i++) { if (max_value1 < array[i]) { max_value1 = array[i]; max_...
#include <iostream> using namespace std; const int N = 200000; int main() { int n, array[N], max_value1 = -1, max_value2 = -1, max_index = 0; cin >> n; for (int i = 0; i < n; i++) { cin >> array[i]; } for (int i = 0; i < n; i++) { if (max_value1 < array[i]) { max_value1 = array[i]; max...
replace
4
5
4
5
0
p02971
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int max = 0, max_second = 0; vector<int> data(n); vector<int> dp(200001); for (int i = 0; i < n; i++) { cin >> data.at(i); dp.at(data.at(i))++; if (max < data.at(i)) max = data.at(i); } for (int i = max - 1;;...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int max = 0, max_second = 0; vector<int> data(n); vector<int> dp(200001); for (int i = 0; i < n; i++) { cin >> data.at(i); dp.at(data.at(i))++; if (max < data.at(i)) max = data.at(i); } for (int i = max - 1; ...
replace
16
17
16
17
0
p02971
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> a(N); int MAX = 0, MAXi; for (int i = 0; i < N; i++) { cin >> a.at(i); if (a.at(i) > MAX) { MAX = a.at(i); MAXi = i; } } for (int i = 0; i < N; i++) { if (i == MAXi) { int MAX2 = 0...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> a(N); int MAX = 0, MAXi; for (int i = 0; i < N; i++) { cin >> a.at(i); if (a.at(i) > MAX) { MAX = a.at(i); MAXi = i; } } for (int i = 0; i < N; i++) { if (i == MAXi) { int MAX2 = 0...
replace
21
22
21
22
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 3) >= this->size() (which is 3)
p02971
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <string> #include <vector> using namespace std; typedef unsigned long ulint; const int mod = 2019; int main() { int n; cin >> n; int a[n]; int maxall = 0; int maxnum = -1; for (int i = 0; i < n; i++) { cin >> a[i]; ...
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <string> #include <vector> using namespace std; typedef unsigned long ulint; const int mod = 2019; int main() { int n; cin >> n; int a[n]; int maxall = 0; int maxnum = -1; for (int i = 0; i < n; i++) { cin >> a[i]; ...
replace
27
28
27
28
TLE
p02971
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #ifdef LOCAL #...
#include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #ifdef LOCAL #...
replace
67
68
67
68
0
p02971
C++
Runtime Error
#include <algorithm> #include <cmath> #include <cstdlib> #include <cstring> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <set> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; typedef long long ll; #define forn(i, n) for ...
#include <algorithm> #include <cmath> #include <cstdlib> #include <cstring> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <set> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; typedef long long ll; #define forn(i, n) for ...
replace
62
63
62
63
0
p02971
C++
Runtime Error
#include <iostream> using namespace std; const int N = 1e5 + 5; int a[N]; int main() { int n, i, max1 = 0, max2 = 0, p; cin >> n; for (i = 1; i <= n; i++) { cin >> a[i]; if (a[i] > max1) { max1 = a[i]; p = i; } } for (i = 1; i <= n; i++) if (i != p && a[i] > max2) max2 = a[i...
#include <iostream> using namespace std; const int N = 2e5 + 5; int a[N]; int main() { int n, i, max1 = 0, max2 = 0, p; cin >> n; for (i = 1; i <= n; i++) { cin >> a[i]; if (a[i] > max1) { max1 = a[i]; p = i; } } for (i = 1; i <= n; i++) if (i != p && a[i] > max2) max2 = a[i...
replace
2
3
2
3
0
p02971
C++
Time Limit Exceeded
#include <iostream> using namespace std; int main() { int N, A[200000], sA[200000]; cin >> N; for (int i = 0; i < N; i++) { cin >> A[i]; sA[i] = A[i]; } for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { if (sA[i] < sA[j]) { int tmp = sA[i]; sA[i] = sA[j]; ...
#include <iostream> using namespace std; int main() { int N, A[200000], sA[200000]; cin >> N; for (int i = 0; i < N; i++) { cin >> A[i]; sA[i] = A[i]; } sort(sA, sA + N, greater<int>()); for (int i = 0; i < N; i++) { int j = 0; if (A[i] == sA[0]) cout << sA[1] << endl; else c...
replace
9
18
9
10
TLE
p02971
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int N = 100010, Mod = 998244353; const double pi = acos(-1.0); typedef long long int ll; typedef pair<int, int> pii; int n, a[N], b[N]; int main() { cin >> n; for (int i = 1; i <= n; i++) cin >> a[i], b[i] = a[i]; sort(b + 1, b + n + 1); int mx = b[n], mx2...
#include <bits/stdc++.h> using namespace std; const int N = 200010, Mod = 998244353; const double pi = acos(-1.0); typedef long long int ll; typedef pair<int, int> pii; int n, a[N], b[N]; int main() { cin >> n; for (int i = 1; i <= n; i++) cin >> a[i], b[i] = a[i]; sort(b + 1, b + n + 1); int mx = b[n], mx2...
replace
2
3
2
3
0
p02971
C++
Runtime Error
#pragma region #include <bits/stdc++.h> using namespace std; inline void ci(void) { return; } template <typename First, typename... Rest> void ci(First &first, Rest &...rest) { cin >> first; ci(rest...); return; } inline void co(void) { cout << "\n"; return; } template <typename First, typename... Rest> void ...
#pragma region #include <bits/stdc++.h> using namespace std; inline void ci(void) { return; } template <typename First, typename... Rest> void ci(First &first, Rest &...rest) { cin >> first; ci(rest...); return; } inline void co(void) { cout << "\n"; return; } template <typename First, typename... Rest> void ...
replace
59
60
59
60
-6
terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 3) >= this->size() (which is 3)
p02971
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <math.h> #include <string> using namespace std; int main() { int n, a[20005]; pair<int, int> p[20005]; cin >> n; int max1 = -1, max2 = -1, ind1, ind2; for (int i = 0; i < n; i++) { cin >> a[i]; p[i] = make_pair(a[i], i); } sort(p...
#include <algorithm> #include <cmath> #include <iostream> #include <math.h> #include <string> using namespace std; int main() { int n, a[200005]; pair<int, int> p[200005]; cin >> n; int max1 = -1, max2 = -1, ind1, ind2; for (int i = 0; i < n; i++) { cin >> a[i]; p[i] = make_pair(a[i], i); } sort...
replace
8
10
8
10
0
p02971
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <vector> int main(int argc, char *argv[]) { unsigned int N; std::cin >> N; std::vector<unsigned int> A(N); for (auto &a : A) { std::cin >> a; } unsigned int a; for (int i = 0; i < N; ++i) { a = A[i]; A.erase(A.begin() + i); std::cout << *s...
#include <algorithm> #include <iostream> #include <vector> int main(int argc, char *argv[]) { unsigned int N; std::cin >> N; std::vector<unsigned int> A(N); for (auto &a : A) { std::cin >> a; } auto globalMaxIter = std::max_element(A.begin(), A.end()); unsigned int globalMax = *globalMaxIter; A.er...
replace
11
17
11
19
TLE
p02971
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; using P = pair<string, int>; const double PI = acos(-1); int main() { int n; cin >> n; vector<int> a(n); rep(i, n) cin >> a.at(i); rep(i, n) { vector<int> b = a; b.at(i) = -1; ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) using ll = long long; using P = pair<string, int>; const double PI = acos(-1); int main() { int n; cin >> n; vector<int> b(n); rep(i, n) cin >> b.at(i); vector<int> a = b; sort(a.begin(), a.end()); if (a.at...
replace
10
17
10
23
TLE
p02971
C++
Time Limit Exceeded
#include <algorithm> #include <cinttypes> #include <cmath> #include <cstdint> #include <cstdio> #include <iomanip> #include <iostream> #include <numeric> #include <string> #include <vector> using namespace std; static const long k10E7 = 1000000007; int main() { long n; cin >> n; vector<long> an(n); for (long...
#include <algorithm> #include <cinttypes> #include <cmath> #include <cstdint> #include <cstdio> #include <iomanip> #include <iostream> #include <numeric> #include <string> #include <vector> using namespace std; static const long k10E7 = 1000000007; int main() { long n; cin >> n; vector<long> an(n); for (long...
replace
23
28
23
38
TLE
p02971
C++
Runtime Error
#include <algorithm> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; #define INF 1000000007 #define LINF 1000000000000000007 typedef long long i64; typedef pair<i64, i64> P; int n, a[101010]; int main() { cin >> n; i64 ans = 0, ans2 = ...
#include <algorithm> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; #define INF 1000000007 #define LINF 1000000000000000007 typedef long long i64; typedef pair<i64, i64> P; int n, a[202020]; int main() { cin >> n; i64 ans = 0, ans2 = ...
replace
16
17
16
17
0
p02971
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <numeric> #include <queue> #include <string> #include <tuple> #include <vector> template <typename T> bool chmax(T &a, const T &b) { if (a <= b) { a = b; return (true); } else { return...
#include <algorithm> #include <bitset> #include <cmath> #include <cstring> #include <iostream> #include <map> #include <numeric> #include <queue> #include <string> #include <tuple> #include <vector> template <typename T> bool chmax(T &a, const T &b) { if (a <= b) { a = b; return (true); } else { return...
replace
151
152
151
152
0
p02971
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n, i, ar[i]; cin >> n; int max = 0, smax = 0; for (i = 0; i < n; i++) { cin >> ar[i]; if (max < ar[i]) { smax = max; max = ar[i]; } else if (ar[i] >= smax) { smax = ar[i]; } } for (i = 0; i < n; i++) { if ...
#include <bits/stdc++.h> using namespace std; int main() { int n, i, ar[200005]; cin >> n; int max = 0, smax = 0; for (i = 0; i < n; i++) { cin >> ar[i]; if (max < ar[i]) { smax = max; max = ar[i]; } else if (ar[i] >= smax) { smax = ar[i]; } } for (i = 0; i < n; i++) { ...
replace
4
5
4
5
0
p02971
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; const int maxn = 1e5 + 10; int a[maxn], first = 0, second = 0; int main() { int n; cin >> n; for (int i = 0; i < n; i++) { cin >> a[i]; if (a[i] >= first) { second = first; first = a[i]; } e...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; const int maxn = 1e6 + 10; int a[maxn], first = 0, second = 0; int main() { int n; cin >> n; for (int i = 0; i < n; i++) { cin >> a[i]; if (a[i] >= first) { second = first; first = a[i]; } e...
replace
5
6
5
6
0
p02971
C++
Runtime Error
// #include<bits/stdc++.h> #include <algorithm> #include <cstdio> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i <= (n); i++) #define co(x) cout << (x) << "\n" #define cosp(x) cout << (x) << " " #define ce(x) cerr << (x) << "\n" #define ce...
// #include<bits/stdc++.h> #include <algorithm> #include <cstdio> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i <= (n); i++) #define co(x) cout << (x) << "\n" #define cosp(x) cout << (x) << " " #define ce(x) cerr << (x) << "\n" #define ce...
replace
34
35
34
35
0
p02971
C++
Runtime Error
#include <bits/stdc++.h> #include <unordered_map> #define lli long long int using namespace std; int main() { std::ios::sync_with_stdio(0); std::cin.tie(0); // freopen("text.in", "r", stdin); // freopen("text.out", "w", stdout); int a[(int)1e5 + 1], n; cin >> n; int max = 0, place = 0; for (int i = ...
#include <bits/stdc++.h> #include <unordered_map> #define lli long long int using namespace std; int main() { std::ios::sync_with_stdio(0); std::cin.tie(0); // freopen("text.in", "r", stdin); // freopen("text.out", "w", stdout); int a[(int)2e5 + 1], n; cin >> n; int max = 0, place = 0; for (int i = ...
replace
13
14
13
14
0
p02971
C++
Runtime Error
#include <cstdio> using namespace std; const int maxn = 100000; int N, A[maxn], mx1, mx2; int main() { scanf("%d", &N); for (int i = 0; i < N; i++) scanf("%d", &A[i]); for (int i = 0; i < N; i++) { if (A[i] > mx1) mx2 = mx1, mx1 = A[i]; else if (A[i] > mx2) mx2 = A[i]; } for (int i = 0...
#include <cstdio> using namespace std; const int maxn = 200000; int N, A[maxn], mx1, mx2; int main() { scanf("%d", &N); for (int i = 0; i < N; i++) scanf("%d", &A[i]); for (int i = 0; i < N; i++) { if (A[i] > mx1) mx2 = mx1, mx1 = A[i]; else if (A[i] > mx2) mx2 = A[i]; } for (int i = 0...
replace
2
3
2
3
0
p02971
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; typedef vector<ll> vl; typedef long double ld; typedef vector<ld> vd; typedef bool bl; typedef vector<bl> vb; const ll e5 = 1 << 20; const ll mod = 998244353; const ll e3 = 1 << 13; const ll INF = 1ll <<...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; typedef vector<ll> vl; typedef long double ld; typedef vector<ld> vd; typedef bool bl; typedef vector<bl> vb; const ll e5 = 1 << 20; const ll mod = 998244353; const ll e3 = 1 << 13; const ll INF = 1ll <<...
replace
22
23
22
23
0
p02971
C++
Runtime Error
#include <stdio.h> int main() { int n; int a[100000]; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%d", &a[i]); } int no1; int no2; for (int i = 0; i < n; i++) { if (a[i] > no1) { no2 = no1; no1 = a[i]; } else if (a[i] > no2) { no2 = a[i]; } } for (int ...
#include <stdio.h> int main() { int n; int a[200000]; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%d", &a[i]); } int no1; int no2; for (int i = 0; i < n; i++) { if (a[i] > no1) { no2 = no1; no1 = a[i]; } else if (a[i] > no2) { no2 = a[i]; } } for (int ...
replace
4
5
4
5
0
p02971
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; int main() { int N; cin >> N; vector<int> A(N); rep(i, N) cin >> A[i]; rep(i, N) { int tmp; tmp = A[i]; A[i] = 0; int m = *max_element(A.begin(), A.end()); cout << m << end...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; int main() { int N; cin >> N; vector<int> A(N); rep(i, N) cin >> A[i]; auto iter1 = max_element(A.begin(), A.end()); int m1 = *iter1; A[iter1 - A.begin()] = 0; auto iter2 = max_element(A...
replace
11
19
11
19
TLE
p02971
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int N; vector<int> A(N); for (int i = 0; i < N; i++) cin >> A.at(i); vector<int> B(N); for (int i = 0; i < N; i++) B.at(i) = A.at(i); sort(B.begin(), B.end()); reverse(B.begin(), B.end()); int Max = B.at(0); int Max1 = B.at(1); for (...
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> A(N); for (int i = 0; i < N; i++) cin >> A.at(i); vector<int> B(N); for (int i = 0; i < N; i++) B.at(i) = A.at(i); sort(B.begin(), B.end()); reverse(B.begin(), B.end()); int Max = B.at(0); int Max1 = B.at...
insert
4
4
4
5
0
p02971
C++
Time Limit Exceeded
// </> : towhid1zaman #include "bits/stdc++.h" using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vll; typedef pair<int, int> pii; typedef pair<pii, int> ppi; #define fill(a, b) memset(a, b, sizeof(a)) #define all(v) (v).begin(), (v).end() #define sp(k) cout << setprecision(k) << fi...
// </> : towhid1zaman #include "bits/stdc++.h" using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vll; typedef pair<int, int> pii; typedef pair<pii, int> ppi; #define fill(a, b) memset(a, b, sizeof(a)) #define all(v) (v).begin(), (v).end() #define sp(k) cout << setprecision(k) << fi...
replace
45
46
45
46
TLE
p02971
C++
Runtime Error
// #pragma GCC optimize("Ofast") #include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> #define endl '\n' #define fast ios::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define zy 2333333 #define bql...
// #pragma GCC optimize("Ofast") #include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <vector> #define endl '\n' #define fast ios::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define zy 2333333 #define bql...
replace
19
20
19
20
0
p02971
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define REPR(i, n) for (int i = (int)(n)-1; i >= 0; --i) #define FOR(i, c) \ for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define ALL(c) (...
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (int i = 0; i < (int)(n); ++i) #define REPR(i, n) for (int i = (int)(n)-1; i >= 0; --i) #define FOR(i, c) \ for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define ALL(c) (...
replace
96
97
96
97
0
p02971
C++
Runtime Error
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> #define int long long #define endl '\n' #define null nullptr #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define pb push_back #...
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> #define int long long #define endl '\n' #define null nullptr #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define pb push_back #...
delete
34
39
34
34
-6
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
p02971
C++
Runtime Error
#include <bits/stdc++.h> #define nmax 100005 using namespace std; int main() { int a[nmax] = {}, n, max1 = -1, max2 = -1, x; cin >> n; for (int i = 1; i <= n; i++) { cin >> x; a[i] = x; if (x > max1) { max2 = max1; max1 = x; } else { if (max1 == x) { max2 = x; } el...
#include <bits/stdc++.h> #define nmax 200005 using namespace std; int main() { int a[nmax] = {}, n, max1 = -1, max2 = -1, x; cin >> n; for (int i = 1; i <= n; i++) { cin >> x; a[i] = x; if (x > max1) { max2 = max1; max1 = x; } else { if (max1 == x) { max2 = x; } el...
replace
1
2
1
2
0
p02971
C++
Runtime Error
#include <bits/stdc++.h> #define pb push_back #define ll long long #define f first #define s second #define ld long double #define fa fflush(stdout); using namespace std; void data() { #ifdef NURS freopen("main.in", "r", stdin); freopen("main.out", "w", stdout); #endif } const int N = 5e5 + 100; const ll mod = 1e...
#include <bits/stdc++.h> #define pb push_back #define ll long long #define f first #define s second #define ld long double #define fa fflush(stdout); using namespace std; void data() { #ifdef NURS freopen("main.in", "r", stdin); freopen("main.out", "w", stdout); #endif } const int N = 5e5 + 100; const ll mod = 1e...
replace
33
34
33
37
0
p02971
C++
Runtime Error
#include <bits/stdc++.h> #include <iostream> using namespace std; #define CIN ios_base::sync_with_stdio(0) #define mx 100007 #define i64 long long i64 arr[mx], tree[3 * mx], lazy[3 * mx]; void BuildTree(i64 node, i64 b, i64 e) { if (b == e) { tree[node] = arr[b]; return; } i64 mid = (b + e) / 2; i64...
#include <bits/stdc++.h> #include <iostream> using namespace std; #define CIN ios_base::sync_with_stdio(0) #define mx 200007 #define i64 long long i64 arr[mx], tree[3 * mx], lazy[3 * mx]; void BuildTree(i64 node, i64 b, i64 e) { if (b == e) { tree[node] = arr[b]; return; } i64 mid = (b + e) / 2; i64...
replace
5
6
5
6
0
p02971
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; signed main() { int a, d; int b[100000], c[100000]; ; cin.tie(NULL); ios::sync_with_stdio(false); cin >> a; for (int i = 0; i < a; i++) { cin >> b[i]; c[i] = b[i]; } sort(b, b + a, greater<int>()); for (int i = 0; i < a; i++) { d = 0; if ...
#include <bits/stdc++.h> using namespace std; signed main() { int a, d; int b[1000000], c[1000000]; cin.tie(NULL); ios::sync_with_stdio(false); cin >> a; for (int i = 0; i < a; i++) { cin >> b[i]; c[i] = b[i]; } sort(b, b + a, greater<int>()); for (int i = 0; i < a; i++) { d = 0; if (b...
replace
4
6
4
5
0
p02971
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define FOR(i, o, n) for (long long i = o; i < n; i++) #define oneforall \ ios::sync_with_stdio(false); \ cin.tie(0); #define all(v) (v).begin(), (v).end() #defi...
#include <bits/stdc++.h> using namespace std; #define FOR(i, o, n) for (long long i = o; i < n; i++) #define oneforall \ ios::sync_with_stdio(false); \ cin.tie(0); #define all(v) (v).begin(), (v).end() #defi...
replace
38
39
38
39
0
p02971
C++
Runtime Error
#include "bits/stdc++.h" #define FOR(i, a, b) for (int i = a; i < b; i++) #define mFOR(i, a, b) for (int i = a; i > b; i--) #define MP make_pair #define PB push_back #define ALL(v) v.begin(), v.end() #define N 100007 #define INF 1000000007 using namespace std; typedef long long ll; ll gcd(ll a, ll b) { return b == 0 ...
#include "bits/stdc++.h" #define FOR(i, a, b) for (int i = a; i < b; i++) #define mFOR(i, a, b) for (int i = a; i > b; i--) #define MP make_pair #define PB push_back #define ALL(v) v.begin(), v.end() #define N 200007 #define INF 1000000007 using namespace std; typedef long long ll; ll gcd(ll a, ll b) { return b == 0 ...
replace
6
7
6
7
0
p02971
C++
Runtime Error
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> #define pb push_back #define mk make_pair #define eb emplace_back #define eps 1e-8 #define fi first #def...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstdio> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> #define pb push_back #define mk make_pair #define eb emplace_back #define eps 1e-8 #define fi first #def...
replace
37
39
37
39
-11
p02971
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; multiset<int> s; vector<int> v(n); int m = n; for (auto &i : v) { cin >> i; s.insert(i); } for (auto i : v) { s.erase(i); cout << *s.rbegin() << "\n"; s.insert(i); } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; multiset<int> s; vector<int> v(n); int m = n; for (auto &i : v) { cin >> i; s.insert(i); } for (auto i : v) { s.erase(s.find(i)); cout << *s.rbegin() << "\n"; s.insert(i); } return 0; }
replace
14
15
14
15
0
p02971
C++
Runtime Error
// Exception Handling - atcoder.cpp : This file contains the 'main' function. // Program execution begins and ends there. // #include <algorithm> #include <iostream> using namespace std; const int N = 1e5; int arr[N], tempp[N], n; int main() { cin >> n; int prevMax = 0, curMax = 0; for (int i = 0; i < n; i++) ...
// Exception Handling - atcoder.cpp : This file contains the 'main' function. // Program execution begins and ends there. // #include <algorithm> #include <iostream> using namespace std; const int N = 2e5 + 6; int arr[N], tempp[N], n; int main() { cin >> n; int prevMax = 0, curMax = 0; for (int i = 0; i < n; i...
replace
8
9
8
9
0
p02971
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int N; cin >> N; long a[110000]; int z = 0, in; for (int i = 0; i < N; i++) { cin >> a[i]; if (z < a[i]) { in = i; z = a[i]; } } sort(a, a + N); if (a[N - 1] == a[N - 2]) { ...
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int N; cin >> N; long a[210000]; int z = 0, in; for (int i = 0; i < N; i++) { cin >> a[i]; if (z < a[i]) { in = i; z = a[i]; } } sort(a, a + N); if (a[N - 1] == a[N - 2]) { ...
replace
9
10
9
10
0
p02971
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vll; #define pb push_back #define mp make_pair #define eps 1e-9 #define INF 2000000000 #define sz(x) ((int)(x).size()) #define fi first #define sec second #define all(x) (x).begin(), (x).end() #define sq(x) ((...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vll; #define pb push_back #define mp make_pair #define eps 1e-9 #define INF 2000000000 #define sz(x) ((int)(x).size()) #define fi first #define sec second #define all(x) (x).begin(), (x).end() #define sq(x) ((...
replace
29
30
29
30
0
p02971
Python
Time Limit Exceeded
n = int(input()) semi_max = 0 aa = [] for i in range(n): a = int(input()) if i > 0: if a >= semi_max and a < max(aa): semi_max = a elif a == max(aa): semi_max = max(aa) aa.append(a) # print(semi_max) for each in aa: print(max(aa) if each <= semi_max else semi_...
n = int(input()) aa = [int(input()) for _ in range(n)] aho = sorted(aa) for a in aa: print(aho[-1] if a < aho[-1] else aho[-2])
replace
1
14
1
5
TLE
p02971
C++
Runtime Error
#include <bits/stdc++.h> #define int long long #define fastio \ ios::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); using namespace...
#include <bits/stdc++.h> #define int long long #define fastio \ ios::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); using namespace...
replace
8
9
8
9
0