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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p02599 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
const int nmax = 5e5 + 3;
int n, q, usu[nmax], sol, v[nmax];
struct Query {
int l, r, idx;
inline pair<int, int> toPair() const { return make_pair(l / sqrt(n), r); }
} t[nmax];
int ap[nmax];
inline bool operator<(const Query &a, const Query &b) {
return a.toPair(... | #include <bits/stdc++.h>
using namespace std;
const int nmax = 5e5 + 3;
int n, q, usu[nmax], sol, v[nmax];
struct Query {
int l, r, idx;
inline pair<int, int> toPair() const {
int ceva;
if ((int)(l / sqrt(n)) % 2)
ceva = -r;
else
ceva = r;
return make_pair(l / sqrt(n), ceva);
}
} t... | replace | 9 | 10 | 9 | 18 | TLE | |
p02599 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define BLOCK 700
#define mxn 5000001
using namespace std;
struct query {
int l;
int r;
int i;
};
query Q[mxn];
int ar[mxn], ans[mxn];
int fre[mxn];
int cnt = 0;
bool comp(query a, query b) {
if (a.l / BLOCK != b.l / BLOCK)
return a.l / BLOC... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define BLOCK 750
#define mxn 5000001
using namespace std;
struct query {
int l;
int r;
int i;
};
query Q[mxn];
int ar[mxn], ans[mxn];
int fre[mxn];
int cnt = 0;
bool comp(query a, query b) {
if (a.l / BLOCK != b.l / BLOCK)
return a.l / BLOC... | replace | 3 | 4 | 3 | 4 | TLE | |
p02599 | C++ | Time Limit Exceeded | #ifndef _TEMPLATE_ROOT
#define _TEMPLATE_ROOT
#include "bits/stdc++.h"
using namespace std;
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define repl(i, a, b) for (ll i = a; i < (b); ++i)
#define repd(i, a, b) for (int i = b; i >= (a); --i)
#define repdl(i, a, b) for (ll i = b; i >= (a); --i)
#define all(x) begin... | #ifndef _TEMPLATE_ROOT
#define _TEMPLATE_ROOT
#include "bits/stdc++.h"
using namespace std;
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define repl(i, a, b) for (ll i = a; i < (b); ++i)
#define repd(i, a, b) for (int i = b; i >= (a); --i)
#define repdl(i, a, b) for (ll i = b; i >= (a); --i)
#define all(x) begin... | replace | 86 | 87 | 86 | 87 | TLE | |
p02599 | C++ | Runtime Error | #pragma GCC optimize("O3")
#pragma GCC target("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ld, ld> pd;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef vector<ld... | #pragma GCC optimize("O3")
#pragma GCC target("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ld, ld> pd;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef vector<ld... | replace | 43 | 44 | 43 | 44 | 0 | |
p02599 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <map>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
const int maxn = 10000;
int n = 0, q = 0;
struct Query {
int id, l, r;
bool operator<(Query a) const { return r < a.r; }
} query[maxn];
int v[... | #include <algorithm>
#include <iostream>
#include <map>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
const int maxn = 5e5 + 5;
int n = 0, q = 0;
struct Query {
int id, l, r;
bool operator<(Query a) const { return r < a.r; }
} query[maxn];
int ... | replace | 9 | 10 | 9 | 10 | 0 | |
p02599 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <map>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
const int maxn = 10000;
int n = 0, q = 0;
struct Query {
int id, l, r;
bool operator<(Query a) const { return r < a.r; }
} query[maxn];
int v[... | #include <algorithm>
#include <iostream>
#include <map>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
const int maxn = 5e5 + 5;
int n = 0, q = 0;
struct Query {
int id, l, r;
bool operator<(Query a) const { return r < a.r; }
} query[maxn];
int ... | replace | 9 | 10 | 9 | 10 | 0 | |
p02599 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int N = 500005;
// [1, n]
int bit[N], n, q;
int sum(int i) {
int s = 0;
while (i > 0) {
s += bit[i];
i -= i & -i;
}
return s;
}
int add(int i, int x) {
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int N = 500005;
// [1, n]
int bit[N], n, q;
int sum(int i) {
int s = 0;
while (i > 0) {
s += bit[i];
i -= i & -i;
}
return s;
}
void add(int i, int x) {... | replace | 20 | 21 | 20 | 21 | 0 | |
p02599 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e7, maxk = 1e7;
int root[maxn], L[maxn], R[maxn], sum[maxn];
int rt = 1, sz = 1;
int lpos[maxk];
int copy(int v, int &u) {
L[sz] = L[v];
R[sz] = R[v];
sum[sz] = sum[v];
return u = sz++;
}
void make_root() {
copy(root[rt - 1], root[rt]);
rt+... | #include <bits/stdc++.h>
using namespace std;
const int maxn = 15e5, maxk = 1e7;
int root[maxn], L[16 * maxn], R[16 * maxn], sum[16 * maxn];
int rt = 1, sz = 1;
int lpos[maxk];
int copy(int v, int &u) {
L[sz] = L[v];
R[sz] = R[v];
sum[sz] = sum[v];
return u = sz++;
}
void make_root() {
copy(root[rt - 1], ... | replace | 4 | 6 | 4 | 6 | -11 | |
p02599 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for (int i = a; i < b; i++)
#define repA(i, a, b) for (int i = a; i <= b; i++)
#define repD(i, b, a) for (int i = b; i >= a; i--)
#define fill(a, val) memset(a, val, sizeof(a))
#define f first
#define s second
t... | #include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for (int i = a; i < b; i++)
#define repA(i, a, b) for (int i = a; i <= b; i++)
#define repD(i, b, a) for (int i = b; i >= a; i--)
#define fill(a, val) memset(a, val, sizeof(a))
#define f first
#define s second
t... | replace | 14 | 15 | 14 | 15 | 0 | |
p02599 | C++ | Runtime Error | #ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
using namespace std;
#define rep(i, s, t) for (ll i = (ll)(s); i < (ll)(t); i++)
#define rrep(i, s, t) for (ll i = (ll)(s - 1); (ll)(t) <= i; i--)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> ... | #ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
using namespace std;
#define rep(i, s, t) for (ll i = (ll)(s); i < (ll)(t); i++)
#define rrep(i, s, t) for (ll i = (ll)(s - 1); (ll)(t) <= i; i--)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> ... | replace | 212 | 213 | 212 | 213 | 0 | |
p02599 | C++ | Time Limit Exceeded | // HEADER FILES AND NAMESPACES
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template <typename T>
using ordered_set =
tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <t... | // HEADER FILES AND NAMESPACES
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template <typename T>
using ordered_set =
tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <t... | replace | 166 | 167 | 166 | 167 | TLE | |
p02599 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define ALL(obj) (obj).begin(), (obj).end()
#define SPEED \
cin.tie(0); \
ios::sync_with_stdio(false);
template <cla... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define ALL(obj) (obj).begin(), (obj).end()
#define SPEED \
cin.tie(0); \
ios::sync_with_stdio(false);
template <cla... | replace | 98 | 99 | 98 | 99 | TLE | |
p02599 | C++ | Runtime Error | #include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define N (1000000000 + 7)
// #define N (998244353)
#define INF 1e16
typedef long long ll;
typedef ... | #include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define N (1000000000 + 7)
// #define N (998244353)
#define INF 1e16
typedef long long ll;
typedef ... | replace | 72 | 73 | 72 | 73 | 0 | |
p02599 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
// [a -> b-1]
#define reps(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
// [0 -> a-1]
#define rep(i, a) reps(i, 0, (a))
// [a-1 -> b]
#define rreps(i, a, b) for (int i = (int)((a)-1); i >= (int)(b); i--)
// [a-1 -> 0]
#define rrep(i, a) rreps(i... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
// [a -> b-1]
#define reps(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
// [0 -> a-1]
#define rep(i, a) reps(i, 0, (a))
// [a-1 -> b]
#define rreps(i, a, b) for (int i = (int)((a)-1); i >= (int)(b); i--)
// [a-1 -> 0]
#define rrep(i, a) rreps(i... | replace | 213 | 214 | 213 | 214 | 0 | |
p02599 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#define ll long long
using namespace std;
int read() {
int k = 0, f = 1;
char c = getchar();
for (; !isdigit(c); c = getchar())
if (c == '-')
f = -1;
for (; isdigit(c); c = getchar())
k = k * 10 + c - '0';... | #include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#define ll long long
using namespace std;
int read() {
int k = 0, f = 1;
char c = getchar();
for (; !isdigit(c); c = getchar())
if (c == '-')
f = -1;
for (; isdigit(c); c = getchar())
k = k * 10 + c - '0';... | replace | 17 | 18 | 17 | 18 | 0 | |
p02599 | C++ | Runtime Error | #pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
#include <cstdlib>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
using namespace std;
// using name... | #pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
#include <cstdlib>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
using namespace std;
// using name... | replace | 60 | 61 | 60 | 61 | 0 | |
p02599 | C++ | Time Limit Exceeded | #pragma GCC optimize("O3")
// #pragma GCC target ("avx")
#include <algorithm>
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <string>
#include <vector>
#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define NDEBUG
#define eprintf(...) ... | #pragma GCC optimize("O3")
// #pragma GCC target ("avx")
#include <algorithm>
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <string>
#include <vector>
#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define NDEBUG
#define eprintf(...) ... | replace | 57 | 58 | 57 | 58 | TLE | |
p02599 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int max_n = 5 * (int)1e5 + 5;
#define mp make_pair
#define pii pair<int, int>
/* Zero indexed FT */
class FenwickTree {
vector<int> ft;
public:
FenwickTree(int n) { ft.resize(n + 1); }
int rsq(int b);
int rsq(int a, int b);
void adjust(int ind, int to_ad... | #include <bits/stdc++.h>
using namespace std;
const int max_n = 5 * (int)1e5 + 5;
#define mp make_pair
#define pii pair<int, int>
/* Zero indexed FT */
class FenwickTree {
vector<int> ft;
public:
FenwickTree(int n) { ft.resize(n + 1); }
int rsq(int b);
int rsq(int a, int b);
void adjust(int ind, int to_ad... | replace | 56 | 57 | 56 | 57 | 0 | |
p02599 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>
// #pragma optimize GCC("O3")
typedef long long ll;
typedef long double ld;
using namespace std;
class query {
p... | #include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>
// #pragma optimize GCC("O3")
typedef long long ll;
typedef long double ld;
using namespace std;
class query {
p... | replace | 41 | 42 | 41 | 42 | 0 | |
p02599 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <map>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
const int maxn = 10000;
int n = 0, q = 0;
struct Query {
int id, l, r;
bool operator<(Query a) const { return r < a.r; }
} query[maxn];
int v[... | #include <algorithm>
#include <iostream>
#include <map>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
const int maxn = 500010;
int n = 0, q = 0;
struct Query {
int id, l, r;
bool operator<(Query a) const { return r < a.r; }
} query[maxn];
int v... | replace | 9 | 10 | 9 | 10 | 0 | |
p02599 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <stdio.h>
using namespace std;
#define mx 300008
#define pii pair<int, int>
#define pi acos(-1.0)
#define pb push_back
#define ss second
#define ff first
typedef long long int ll;
/// adjacent move
int fx[4] = {0, +1, 0, -1};
int fy[4] = {+1, 0, -1, 0};
/// knight
ll prime[mx];
ll a... | #include <bits/stdc++.h>
#include <stdio.h>
using namespace std;
#define mx 500008
#define pii pair<int, int>
#define pi acos(-1.0)
#define pb push_back
#define ss second
#define ff first
typedef long long int ll;
/// adjacent move
int fx[4] = {0, +1, 0, -1};
int fy[4] = {+1, 0, -1, 0};
/// knight
ll prime[mx];
ll a... | replace | 4 | 5 | 4 | 5 | 0 | |
p02599 | C++ | Runtime Error |
#include <bits/stdc++.h>
using namespace std;
const int Max = 1e5 + 5;
int K, ans[Max], arra[Max], sum, cnt, mp[Max];
struct Query {
int index, l, r;
};
bool cmp(Query a, Query b) {
if (a.l / K != b.l / K) {
return a.l / K < b.l / K;
} else if ((a.l / K) & 1)
return a.r < b.r;
return a.r > b.r;
}
Quer... |
#include <bits/stdc++.h>
using namespace std;
const int Max = 5e5 + 5;
int K, ans[Max], arra[Max], sum, cnt, mp[Max];
struct Query {
int index, l, r;
};
bool cmp(Query a, Query b) {
if (a.l / K != b.l / K) {
return a.l / K < b.l / K;
} else if ((a.l / K) & 1)
return a.r < b.r;
return a.r > b.r;
}
Quer... | replace | 3 | 4 | 3 | 4 | 0 | |
p02599 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
vector<vector<int>> seg;
int query(int l, int r, int u, int a, int b) {
if (l <= a && b <= r)
return lower_bound(seg[u].begin(), seg[u].end(), l) - seg[u].begin();
int res = 0;
if (l < (a + b) / 2)
res += qu... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
vector<vector<int>> seg;
int query(int l, int r, int u, int a, int b) {
if (l <= a && b <= r)
return lower_bound(seg[u].begin(), seg[u].end(), l) - seg[u].begin();
int res = 0;
if (l < (a + b) / 2)
res += qu... | replace | 26 | 27 | 26 | 27 | 0 | |
p02599 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define mp make_pair
#define pb(x) push_back(x)
#define vll vector<long long>
#define pll pair<long long, long long>
#define mll map<long long, long long>
#define sz(v)... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define mp make_pair
#define pb(x) push_back(x)
#define vll vector<long long>
#define pll pair<long long, long long>
#define mll map<long long, long long>
#define sz(v)... | replace | 24 | 25 | 24 | 25 | 0 | |
p02599 | 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;
typedef tuple<int, int, int> TU;
template <typename T> class BIT {
vector<T> array;
int n;
public:
BIT(int num) {
n = num;
array.resize(n + 1);
}
T sum(int i)... | #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;
typedef tuple<int, int, int> TU;
template <typename T> class BIT {
vector<T> array;
int n;
public:
BIT(int num) {
n = num;
array.resize(n + 1);
}
T sum(int i)... | insert | 60 | 60 | 60 | 61 | TLE | |
p02599 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define fr first
#define sc second
#define Fast \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); ... | #include <bits/stdc++.h>
using namespace std;
#define fr first
#define sc second
#define Fast \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); ... | replace | 17 | 19 | 17 | 19 | TLE | |
p02599 | Python | Time Limit Exceeded | # from sys import stdin
# input = stdin.readline
class Bit:
def __init__(self, n):
self.size = n
self.tree = [0] * (n + 1)
def sum(self, i):
s = 0
while i > 0:
s += self.tree[i]
i -= i & -i
return s
def add(self, i, x):
while i <= s... | from sys import stdin
input = stdin.readline
class Bit:
def __init__(self, n):
self.size = n
self.tree = [0] * (n + 1)
def sum(self, i):
s = 0
while i > 0:
s += self.tree[i]
i -= i & -i
return s
def add(self, i, x):
while i <= self... | replace | 0 | 2 | 0 | 3 | TLE | |
p02599 | C++ | Runtime Error | #define _CRT_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <... | #define _CRT_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <... | replace | 166 | 167 | 166 | 167 | 0 | |
p02599 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define PI acos(-1)
#define pb push_back
#define mp make_pair
#define int long long int
#define pi pair<int, int>
#define pii pair<int, pi>
#define fir first
#define sec second
#define MAXN 500001
#define MAXL 20
#define INF 200001
#define mod 1000000007
int n, q, block;
... | #include <bits/stdc++.h>
using namespace std;
#define PI acos(-1)
#define pb push_back
#define mp make_pair
#define pi pair<int, int>
#define pii pair<int, pi>
#define fir first
#define sec second
#define MAXN 500001
#define MAXL 20
#define INF 200001
#define mod 1000000007
int n, q, block;
int m[MAXN];
int v[MAXN];
... | delete | 6 | 7 | 6 | 6 | TLE | |
p02599 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define lli long long
#define all(i) i.begin(), i.end()
#define rall(i) i.rbegin(), i.rend()
#define rep0(i, j) for (int i = 0; i < j; i++)
#define rep1(i, j) for (int i = 1; i <= j; i++)
#define rep0d(i, j) for (int i = j - 1; i >= 0; i--)
#define MOD 1000000007
#define M... | #include <bits/stdc++.h>
using namespace std;
#define lli long long
#define all(i) i.begin(), i.end()
#define rall(i) i.rbegin(), i.rend()
#define rep0(i, j) for (int i = 0; i < j; i++)
#define rep1(i, j) for (int i = 1; i <= j; i++)
#define rep0d(i, j) for (int i = j - 1; i >= 0; i--)
#define MOD 1000000007
#define M... | replace | 207 | 208 | 207 | 208 | 0 | |
p02599 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define INF 0x7fffffff
typedef long long ll;
typedef long double ld;
#define fastIO \
ios_base::sync_with_stdio(false); \
cin.tie(0); ... | #include <bits/stdc++.h>
using namespace std;
#define INF 0x7fffffff
typedef long long ll;
typedef long double ld;
#define fastIO \
ios_base::sync_with_stdio(false); \
cin.tie(0); ... | replace | 20 | 21 | 20 | 21 | 0 | |
p02599 | C++ | Runtime Error | // #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define lfs cout << fixed << setprecision(10)
#define ALL(a) (a).begin(), (a).end()
#define ALLR(a) (a).rbegin(), (a).rend()
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#de... | // #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define lfs cout << fixed << setprecision(10)
#define ALL(a) (a).begin(), (a).end()
#define ALLR(a) (a).rbegin(), (a).rend()
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#de... | replace | 174 | 175 | 174 | 175 | 0 | |
p02599 | C++ | Time Limit Exceeded | #define taskname "test"
#include <bits/stdc++.h>
using namespace std;
#define sz(x) (int)x.size()
#define fi first
#define se second
typedef long long lli;
typedef pair<int, int> pii;
const int maxn = 5e5 + 5;
const int K = 710;
int n, Q;
int a[maxn];
pair<pii, int> query[maxn];
int cnt[maxn], ans[maxn];
templa... | #define taskname "test"
#include <bits/stdc++.h>
using namespace std;
#define sz(x) (int)x.size()
#define fi first
#define se second
typedef long long lli;
typedef pair<int, int> pii;
const int maxn = 5e5 + 5;
const int K = 710;
int n, Q;
int a[maxn];
pair<pii, int> query[maxn];
int cnt[maxn], ans[maxn];
templa... | replace | 63 | 64 | 63 | 64 | TLE | |
p02599 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 200200;
#include <iostream>
#include <map>
using namespace std;
#define N 500500
int t[N * 20];
int L[N * 20];
int R[N * 20];
int f[N];
#define next jklsjgklsjg
#define prev kfjgls
int prev[N];
int next[N];
int a[N];
int next_free = 1;
int n = N;
void buil... | #include <bits/stdc++.h>
using namespace std;
const int N = 200200;
#include <iostream>
#include <map>
using namespace std;
#define N 500500
int t[N * 25];
int L[N * 25];
int R[N * 25];
int f[N];
#define next jklsjgklsjg
#define prev kfjgls
int prev[N];
int next[N];
int a[N];
int next_free = 1;
int n = N;
void buil... | replace | 10 | 13 | 10 | 13 | -11 | |
p02599 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long int
#define PI acos(-1)
#define read freopen("in.txt", "r", stdin)
#define uu first
#define vv second
#define write freopen("out.txt", "w", stdout)
#define pii pair<int, int>
#define INF 1e9
#define EPS 1e-8
#define MAX 100005
#define MOD 1000000007
#define fastRead ... | #include <bits/stdc++.h>
#define MAX 500005
using namespace std;
int t, tst, n, m;
int tree[4 * MAX], ara[MAX], now[MAX], val[MAX], ans[MAX];
vector<int> edg[MAX];
struct info {
int uu, vv, id;
};
vector<info> range;
bool comp(info in1, info in2) {
if (in1.uu == in2.uu) {
if (in1.vv == in2.vv) {
return... | replace | 1 | 16 | 1 | 2 | 0 | |
p02599 | C++ | Time Limit Exceeded | // author: hitch_hiker42;
#include <bits/stdc++.h>
using namespace std;
// solution:
#define int int64_t
#define block(i) (i / B)
constexpr int N = 500001, A = 500'001, Q = 500'001;
int f[A], a[N], ans[Q], B = 707, answer;
struct query {
int lo, hi, idx;
query() {}
query(int lo, int hi, int idx) : lo(lo), hi(hi... | // author: hitch_hiker42;
#include <bits/stdc++.h>
using namespace std;
// solution:
#define block(i) (i / B)
constexpr int N = 500001, A = 500'001, Q = 500'001;
int f[A], a[N], ans[Q], B = 707, answer;
struct query {
int lo, hi, idx;
query() {}
query(int lo, int hi, int idx) : lo(lo), hi(hi), idx(idx) {}
boo... | delete | 5 | 6 | 5 | 5 | TLE | |
p02599 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep2(i, m, n) for (int i = m; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
inline int popcount(const int x) { return __builtin_popcount(x); }
template <class T> void chmin(T &a, const T &b)... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep2(i, m, n) for (int i = m; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
inline int popcount(const int x) { return __builtin_popcount(x); }
template <class T> void chmin(T &a, const T &b)... | insert | 106 | 106 | 106 | 107 | TLE | |
p02599 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int cnt[1000005];
#define ll long long
struct node {
int l, r;
int id;
} ask[1000005];
ll q[1000005];
ll Ans[1000005];
int block;
bool cmp(node a, node b) {
if (a.l / block == b.l / block) {
return a.r < b.r;
}
return a.l / block < b.l / block;
}
#define il in... | #include <bits/stdc++.h>
using namespace std;
int cnt[1000005];
#define ll long long
struct node {
int l, r;
int id;
} ask[1000005];
ll q[1000005];
ll Ans[1000005];
int block;
bool cmp(node a, node b) {
if (a.l / block == b.l / block) {
return a.r < b.r;
}
return a.l / block < b.l / block;
}
#define il in... | replace | 54 | 55 | 54 | 55 | TLE | |
p02599 | C++ | Runtime Error | // RAKSHIT KADAM
// -- Declare array globally...
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// #define ordered_set tree< int , null_type , less<int> , rb_tree_tag ,
// tree_order_statistics_node_update> find_by_order r... | // RAKSHIT KADAM
// -- Declare array globally...
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// #define ordered_set tree< int , null_type , less<int> , rb_tree_tag ,
// tree_order_statistics_node_update> find_by_order r... | replace | 74 | 75 | 74 | 75 | 0 | |
p02599 | C++ | Time Limit Exceeded | // Program to compute no. of different elements
// of ranges for different range queries
#include <bits/stdc++.h>
using namespace std;
// Used in frequency array (maximum value of an
// array element).
const int MAX = 1000000;
// Variable to represent block size. This is made
// global so compare() of sort can use it... | // Program to compute no. of different elements
// of ranges for different range queries
#include <bits/stdc++.h>
using namespace std;
// Used in frequency array (maximum value of an
// array element).
const int MAX = 1000000;
// Variable to represent block size. This is made
// global so compare() of sort can use it... | replace | 40 | 41 | 40 | 41 | TLE | |
p02599 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
using namespace std;
#define N 511111
#define A 1111111
#define block 200
struct node {
int L, R, i;
} q[N];
int v[N], cnt[A], ans[N], answer = 0;
bool _compare(node x, node y) {
if (x.L / block != y.L / block)
return x.L < y.L;
return x.R < y.R;
}
void _add(int... | #include <algorithm>
#include <iostream>
using namespace std;
#define N 511111
#define A 1111111
#define block 800
struct node {
int L, R, i;
} q[N];
int v[N], cnt[A], ans[N], answer = 0;
bool _compare(node x, node y) {
if (x.L / block != y.L / block)
return x.L < y.L;
return x.R < y.R;
}
void _add(int... | replace | 7 | 8 | 7 | 8 | TLE | |
p02599 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define debug(n) cerr << #n << ':' << n << endl;
#define dline cerr << __LINE__ << endl;
using ll = long long;
using ull = unsigned long long;
template <class T, class U> using P = pair<T, U>;
template <class T> using Heap = priority_queue<T>;
template <class T> using he... | #include <bits/stdc++.h>
using namespace std;
#define debug(n) cerr << #n << ':' << n << endl;
#define dline cerr << __LINE__ << endl;
using ll = long long;
using ull = unsigned long long;
template <class T, class U> using P = pair<T, U>;
template <class T> using Heap = priority_queue<T>;
template <class T> using he... | replace | 75 | 76 | 75 | 76 | TLE | |
p02599 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
#define F first
#define S second
#define pb push_back
mt19937 rnd;
const int maxn = 1e6, maxk = 1e6 + 1;
int root[maxn], L[16 * maxn], R[16 * maxn], sum[16 * maxn];
int rt = 1, sz = 1;
int lpos[maxk]... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
#define F first
#define S second
#define pb push_back
mt19937 rnd;
const int maxn = 5e6, maxk = 5e6 + 1;
int root[maxn], L[16 * maxn], R[16 * maxn], sum[16 * maxn];
int rt = 1, sz = 1;
int lpos[maxk]... | replace | 10 | 11 | 10 | 11 | -11 | |
p02599 | C++ | Runtime Error | #include <bits/stdc++.h>
// #define int long long
#define endl '\n'
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.ti... | #include <bits/stdc++.h>
// #define int long long
#define endl '\n'
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.ti... | replace | 9 | 10 | 9 | 10 | 0 | |
p02599 | C++ | Runtime Error | #include <algorithm>
#include <array>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdint>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <... | #include <algorithm>
#include <array>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdint>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <... | replace | 236 | 237 | 236 | 237 | 0 | |
p02599 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
con... | #include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
con... | replace | 77 | 78 | 77 | 78 | 0 | |
p02599 | C++ | Runtime Error | /*
Alfonso2 Peterssen (mukel)
8 - 1 - 2008
SPOJ "DQUERY"
Online algorithm
Preprocessing: O(n lg n)
Query: O(lg n)
Memory: O(n lg n)
*/
#include <cstdio>
#include <map>
using std::map;
const int MAXN = 40000, MAXLGN = 16;
int N, Q;
map<int, int> pos;
int tree[MAXN];
int cant;
struct node {
int val, L, R, size;
} bu... | /*
Alfonso2 Peterssen (mukel)
8 - 1 - 2008
SPOJ "DQUERY"
Online algorithm
Preprocessing: O(n lg n)
Query: O(lg n)
Memory: O(n lg n)
*/
#include <cstdio>
#include <map>
using std::map;
const int MAXN = 600000, MAXLGN = 16;
int N, Q;
map<int, int> pos;
int tree[MAXN];
int cant;
struct node {
int val, L, R, size;
} b... | replace | 14 | 15 | 14 | 15 | 0 | |
p02599 | C++ | Time Limit Exceeded | #include <algorithm>
#include <assert.h>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <time.h>
#include <un... | #include <algorithm>
#include <assert.h>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <time.h>
#include <un... | replace | 164 | 165 | 164 | 165 | TLE | |
p02599 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n - 1); i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) int(x.size())
#define get_unique(x) x.erase(unique(all(x)), x.end());
typedef long long ll;
typedef complex<do... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n - 1); i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) int(x.size())
#define get_unique(x) x.erase(unique(all(x)), x.end());
typedef long long ll;
typedef complex<do... | replace | 129 | 130 | 129 | 130 | TLE | |
p02599 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>
#define mkp make_pair
#define mkt make_tuple
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(v) v.begin(), v.end()
using namespace ... | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>
#define mkp make_pair
#define mkt make_tuple
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(v) v.begin(), v.end()
using namespace ... | replace | 26 | 27 | 26 | 27 | TLE | |
p02599 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
int n, q, x, y, arr[MAXN], ans[MAXN], t[MAXN], last[MAXN];
struct Q {
int x, y, i;
};
void update(int i, int v) {
for (; i <= n; i += i & -i)
t[i] += v;
}
int query(int r) {
int sum = 0;
for (; r > 0; r -= r & -r)
sum += t[r];
... | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 5 * 1e5 + 5;
int n, q, x, y, arr[MAXN], ans[MAXN], t[MAXN], last[MAXN];
struct Q {
int x, y, i;
};
void update(int i, int v) {
for (; i <= n; i += i & -i)
t[i] += v;
}
int query(int r) {
int sum = 0;
for (; r > 0; r -= r & -r)
sum += t[r... | replace | 3 | 4 | 3 | 4 | 0 | |
p02599 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
#define eps 1e-8
#define zero(x) (((x) > 0 ? (x) : -(x)) < eps)
#define pause cout << " press ansy key to continue...", cin >> chh
#define file_r(x) freopen(x,... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
#define eps 1e-8
#define zero(x) (((x) > 0 ? (x) : -(x)) < eps)
#define pause cout << " press ansy key to continue...", cin >> chh
#define file_r(x) freopen(x,... | replace | 74 | 75 | 74 | 75 | -11 | |
p02599 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <iostream>
#include <vector>
#define lli long long int
#define mod 1000000007
#define pb push_back
#define mk make_pair
#define fastio \
ios_base::sync_with_stdio(false); \
co... | #include <bits/stdc++.h>
#include <iostream>
#include <vector>
#define lli long long int
#define mod 1000000007
#define pb push_back
#define mk make_pair
#define fastio \
ios_base::sync_with_stdio(false); \
co... | replace | 12 | 14 | 12 | 14 | 0 | |
p02599 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define debug(var) \
do { ... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define debug(var) \
do { ... | replace | 67 | 69 | 67 | 68 | TLE | |
p02599 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
// typedef vector<vector<ll>> Graph;
const ll mod = 1e9 + 7;
// const ll mo... | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
// typedef vector<vector<ll>> Graph;
const ll mod = 1e9 + 7;
// const ll mo... | replace | 198 | 199 | 198 | 199 | 0 | |
p02599 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define llu unsigned long long int
#define sa(a, n, t) \
for (int ii = 0; ii < n; ii++) \
scanf("%" #t "", &(a)[ii])
#define rep(i, n) for ... | #include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define llu unsigned long long int
#define sa(a, n, t) \
for (int ii = 0; ii < n; ii++) \
scanf("%" #t "", &(a)[ii])
#define rep(i, n) for ... | replace | 73 | 74 | 73 | 74 | TLE | |
p02599 | C++ | Time Limit Exceeded | /*** 𝕒𝕜𝕤𝕙𝕒𝕪𝕜𝕦𝕞𝕒𝕣𝟡𝟡 ***/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
template <typename T>
using id_set =
tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define f(i, x, n) for (i = x; i < n; i++)
#de... | /*** 𝕒𝕜𝕤𝕙𝕒𝕪𝕜𝕦𝕞𝕒𝕣𝟡𝟡 ***/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
template <typename T>
using id_set =
tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define f(i, x, n) for (i = x; i < n; i++)
#de... | replace | 35 | 36 | 35 | 36 | TLE | |
p02599 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
typedef struct omaru {
ll l, r, id;
} polka;
#define FENWICK_NMAX 500010
struct fenwick_tree {
ll N;
ll bit[FENWICK_NMAX];
fenwick_tree(ll n) {
N = n;
for (... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
typedef struct omaru {
ll l, r, id;
} polka;
#define FENWICK_NMAX 500010
struct fenwick_tree {
ll N;
ll bit[FENWICK_NMAX];
fenwick_tree(ll n) {
N = n;
for (... | delete | 66 | 67 | 66 | 66 | TLE | |
p02599 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int ans = 0;
const int X = 333;
vector<int> a;
vector<int> cnt;
void add(int i) {
ans += (cnt[a[i]] == 0);
cnt[a[i]]++;
}
void del(int i) {
cnt[a[i]]--;
ans -= (cnt[a[i]] == 0);
}
int que(int oldL, int oldR, int L, int R) {
f... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int ans = 0;
const int X = 2000;
vector<int> a;
vector<int> cnt;
void add(int i) {
ans += (cnt[a[i]] == 0);
cnt[a[i]]++;
}
void del(int i) {
cnt[a[i]]--;
ans -= (cnt[a[i]] == 0);
}
int que(int oldL, int oldR, int L, int R) {
... | replace | 7 | 8 | 7 | 8 | TLE | |
p02599 | C++ | Time Limit Exceeded | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define pll pair<ll, ll>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define endl '\n'
#define ios ios_base::sync_with_stdio(0), cin.tie(0... | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define pll pair<ll, ll>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define endl '\n'
#define ios ios_base::sync_with_stdio(0), cin.tie(0... | insert | 76 | 76 | 76 | 77 | TLE | |
p02599 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep2(i, x, n) for (int i = x; i <= n; i++)
#define rep3(i, x, n) for (int i = x; i >= n; i--)
#define elif else if
#define sp(x) fixed << setprecision(x)
#define pb push_back
#define eb emplace_back
#define all(x) x.begi... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep2(i, x, n) for (int i = x; i <= n; i++)
#define rep3(i, x, n) for (int i = x; i >= n; i--)
#define elif else if
#define sp(x) fixed << setprecision(x)
#define pb push_back
#define eb emplace_back
#define all(x) x.begi... | replace | 72 | 73 | 72 | 76 | 0 | |
p02599 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int, int> pi;
#define f first
#define s second
#define FAST \
ios_base::sync_with_stdio(0); \
cin.tie(0);
const int maxn =... | #include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int, int> pi;
#define f first
#define s second
#define FAST \
ios_base::sync_with_stdio(0); \
cin.tie(0);
const int maxn =... | replace | 12 | 13 | 12 | 13 | TLE | |
p02599 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define r... | #include <algorithm>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define r... | insert | 83 | 83 | 83 | 84 | TLE | |
p02599 | C++ | Runtime Error | #pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize("unroll-loops")
// #pragma warning(disable : 4996)
#ifdef _MSC_VER
#include <intrin.h>
#define __builtin_popcount __popcnt
#define __builtin_popcountll __popcnt64
#endif
#include <limits.h>
#include <m... | #pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize("unroll-loops")
// #pragma warning(disable : 4996)
#ifdef _MSC_VER
#include <intrin.h>
#define __builtin_popcount __popcnt
#define __builtin_popcountll __popcnt64
#endif
#include <limits.h>
#include <m... | replace | 120 | 121 | 120 | 121 | 0 | |
p02599 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
int bl, t, n, m;
int res, a[N], cnt[N], ans[N];
int curR, curL;
struct node {
int l, r, p;
bool operator<(const node &W) const { return l < W.l; }
} e[N];
bool cmp(const node &a, const node &b) {
return (a.l / bl) == (b.l / bl) ? a.r < b.r : a.... | #pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
int bl, t, n, m;
int res, a[N], cnt[N], ans[N];
int curR, curL;
struct node {
int l, r, p;
bool operator<(const node &W) const { return l < W.l; }
} e[N];
bool cmp(const node &a, const node &b) {
retur... | insert | 0 | 0 | 0 | 1 | TLE | |
p02599 | C++ | Time Limit Exceeded |
#include <bits/stdc++.h>
using namespace std;
/**
******************* Author:Bisnu sarkar ****************************
**/
#define ull unsigned long long
#define ll long long
#define pii pair<int, int>
#define sit set<int>::iterator
#define vrit vector<int>::reverse iterator
#define ff first
#define ss second
#define ... |
#include <bits/stdc++.h>
using namespace std;
/**
******************* Author:Bisnu sarkar ****************************
**/
#define ull unsigned long long
#define ll long long
#define pii pair<int, int>
#define sit set<int>::iterator
#define vrit vector<int>::reverse iterator
#define ff first
#define ss second
#define ... | replace | 78 | 79 | 78 | 79 | TLE | |
p02599 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define INF (1ll << 62)
#define pb push_back
#define ii pair<int, int>
#define OK (cerr << "OK" << endl)
#define debug(x) cerr << #x " = " << (x) << endl
#define ff first
#define ss second
#define int long long
#define tt tuple<int, int, int>
#define endl '\n'
class Pers... | #include <bits/stdc++.h>
using namespace std;
#define INF (1ll << 62)
#define pb push_back
#define ii pair<int, int>
#define OK (cerr << "OK" << endl)
#define debug(x) cerr << #x " = " << (x) << endl
#define ff first
#define ss second
// #define int long long
#define tt tuple<int, int, int>
#define endl '\n'
class P... | replace | 11 | 12 | 11 | 12 | TLE | |
p02599 | C++ | Time Limit Exceeded | // Mo's algorithm
// 例題:数列の区間内の要素の種類数を求める ABC174 F
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
struct Mo {
vector<int> left, right, index; // offline query
int window; // bucket width
int nl, nr, ptr; // [nl,nr)
vector<int>... | // Mo's algorithm
// 例題:数列の区間内の要素の種類数を求める ABC174 F
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
struct Mo {
vector<int> left, right, index; // offline query
int window; // bucket width
int nl, nr, ptr; // [nl,nr)
vector<int>... | replace | 84 | 85 | 84 | 85 | TLE | |
p02599 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define fs first
#define fst first
#define sc second
#define snd second
#define sz(X) (int)(X).size()
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define fornr(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define forab(i, a... | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define fs first
#define fst first
#define sc second
#define snd second
#define sz(X) (int)(X).size()
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define fornr(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define forab(i, a... | replace | 26 | 27 | 26 | 27 | 0 | |
p02599 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#pragma gcc optimize("O3")
#pragma gcc optimize("unroll-loops")
#ifdef EVAH
#define _WIN32_WINNT 0x0500
#include <windows.h>
#endif
#define openFile(n) \
ShellExecute(nullptr, "open", n, nullptr, nullptr, SW_SHOWN... | #include <bits/stdc++.h>
using namespace std;
#pragma gcc optimize("O3")
#pragma gcc optimize("unroll-loops")
#ifdef EVAH
#define _WIN32_WINNT 0x0500
#include <windows.h>
#endif
#define openFile(n) \
ShellExecute(nullptr, "open", n, nullptr, nullptr, SW_SHOWN... | replace | 27 | 28 | 27 | 28 | TLE | |
p02599 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
constexpr int inf = 1 << 30;
constexpr int mod = 1e9 + 7;
constexpr ll infl = 1ll << 60;
constexpr int nr = 800;
vector<pair<int, int>> mo[nr];
array<pair<int, int>, 500050> query;
int main() {
cin.tie(nullptr);
io... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
constexpr int inf = 1 << 30;
constexpr int mod = 1e9 + 7;
constexpr ll infl = 1ll << 60;
constexpr int nr = 800;
vector<pair<int, int>> mo[nr];
pair<int, int> query[500050];
int main() {
cin.tie(nullptr);
ios::sync... | replace | 11 | 12 | 11 | 12 | TLE | |
p02599 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define BLOCK 750
#define mxn 5000001
using namespace std;
struct query {
int l;
int r;
int i;
};
query Q[mxn];
int ar[mxn], ans[mxn];
int fre[mxn];
int cnt = 0;
bool comp(query a, query b) {
if (a.l / BLOCK != b.l / BLOCK)
return a.l / BLOC... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define BLOCK 750
#define mxn 5000001
using namespace std;
struct query {
int l;
int r;
int i;
};
query Q[mxn];
int ar[mxn], ans[mxn];
int fre[mxn];
int cnt = 0;
bool comp(query a, query b) {
if (a.l / BLOCK != b.l / BLOCK)
return a.l / BLOC... | replace | 35 | 37 | 35 | 37 | TLE | |
p02599 | C++ | Time Limit Exceeded | /*** 𝕒𝕜𝕤𝕙𝕒𝕪𝕜𝕦𝕞𝕒𝕣𝟡𝟡 ***/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
template <typename T>
using id_set =
tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define f(i, x, n) for (i = x; i < n; i++)
#de... | /*** 𝕒𝕜𝕤𝕙𝕒𝕪𝕜𝕦𝕞𝕒𝕣𝟡𝟡 ***/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
template <typename T>
using id_set =
tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define f(i, x, n) for (i = x; i < n; i++)
#de... | replace | 35 | 36 | 35 | 36 | TLE | |
p02599 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
struct ii {
int a, b;
bool operator<(ii o) const { return tie(a, b) < tie(o.a, o.b); }
};
struct iii {
int a, b, c;
bool operator<(iii o) const { return tie(a, b, c) < tie(o.a, o.b, o.c); }
};
const int MOD = 1000000007;
const int INF = 100000... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
struct ii {
int a, b;
bool operator<(ii o) const { return tie(a, b) < tie(o.a, o.b); }
};
struct iii {
int a, b, c;
bool operator<(iii o) const { return tie(a, b, c) < tie(o.a, o.b, o.c); }
};
const int MOD = 1000000007;
const int INF = 100000... | replace | 21 | 22 | 21 | 22 | TLE | |
p02599 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdio>
#include <math.h>
const int mx = 5e5 + 5;
int n, q, a[mx], blk;
struct node {
int l, r, p;
node() {}
node(int _l, int _r, int _p) : l(_l), r(_r), p(_p) {}
bool operator<(const node &ot) {
if (l / blk != ot.l / blk)
return l / blk < ot.l / blk;
return r > ot.... | #include <algorithm>
#include <cstdio>
#include <math.h>
const int mx = 5e5 + 5;
int n, q, a[mx], blk;
struct node {
int l, r, p;
node() {}
node(int _l, int _r, int _p) : l(_l), r(_r), p(_p) {}
bool operator<(const node &ot) {
if (l / blk != ot.l / blk)
return l < ot.l;
return (bool)((r < ot.r) ^... | replace | 12 | 14 | 12 | 14 | TLE | |
p02599 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <map>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
const int maxn = 10000;
int n = 0, q = 0;
struct Query {
int id, l, r;
bool operator<(Query a) const { return r < a.r; }
} query[maxn];
int v[... | #include <algorithm>
#include <iostream>
#include <map>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
const int maxn = 5e5 + 10;
int n = 0, q = 0;
struct Query {
int id, l, r;
bool operator<(Query a) const { return r < a.r; }
} query[maxn];
int... | replace | 9 | 10 | 9 | 10 | 0 | |
p02599 | C++ | Time Limit Exceeded | /*
Created by Rahul Goel.
*/
/*******************************************************************************/
#include <algorithm>
#include <cmath>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#incl... | /*
Created by Rahul Goel.
*/
/*******************************************************************************/
#include <algorithm>
#include <cmath>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#incl... | insert | 92 | 92 | 92 | 94 | TLE | |
p02599 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long
#define endl '\n'
using namespace std;
struct query {
ll left;
ll right;
ll index;
};
ll arr[500001];
query Q[500001];
ll blk = 777; // Block-size=sqrt(n)=sqrt(30000).we precompute it so to prevent
// runtime error.
ll frequency[500001]; // array to k... | #include <bits/stdc++.h>
#define ll long long
#define endl '\n'
using namespace std;
struct query {
ll left;
ll right;
ll index;
};
ll arr[500001];
query Q[500001];
ll blk = 1000; // Block-size=sqrt(n)=sqrt(30000).we precompute it so to prevent
// runtime error.
ll frequency[500001]; // array to... | replace | 14 | 16 | 14 | 16 | TLE | |
p02599 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
struct _ {
ios_base::Init i;
_() { ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); }
} _;
const int sqn = 316;
const int maxn = 5e5;
int n, q;
vector<int> c(maxn + 1, 0);
vector<int> ans(maxn + 1, 0);
vector<int> fre... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
struct _ {
ios_base::Init i;
_() { ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); }
} _;
const int sqn = 710;
const int maxn = 5e5;
int n, q;
vector<int> c(maxn + 1, 0);
vector<int> ans(maxn + 1, 0);
vector<int> fre... | replace | 10 | 11 | 10 | 11 | TLE | |
p02599 | C++ | Time Limit Exceeded | // #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#inc... | // #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#inc... | replace | 51 | 52 | 51 | 52 | TLE | |
p02599 | C++ | Runtime Error | typedef int ll;
typedef long double ld;
#include <bits/stdc++.h>
using namespace std;
template <class Monoid> struct SegTree {
using Func = function<Monoid(Monoid, Monoid)>;
const Func F;
const Monoid UNITY;
int SIZE_R;
vector<Monoid> dat;
SegTree(int n, const Func f, const Monoid &unity) : F(f), UNITY(uni... | typedef int ll;
typedef long double ld;
#include <bits/stdc++.h>
using namespace std;
template <class Monoid> struct SegTree {
using Func = function<Monoid(Monoid, Monoid)>;
const Func F;
const Monoid UNITY;
int SIZE_R;
vector<Monoid> dat;
SegTree(int n, const Func f, const Monoid &unity) : F(f), UNITY(uni... | replace | 68 | 69 | 68 | 69 | 0 | |
p02599 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = (int)1e5 + 5;
const int LogN = (int)20;
int L[4 * N * LogN];
int R[N * 4 * LogN];
int T[N * 4 * LogN];
int version;
int root[N * 4 * LogN];
int src[N];
unordered_map<int, int> pos;
void build(int i, int b, int e) {
if (b == e) {
T[i] = 0;
return;
... | #include <bits/stdc++.h>
using namespace std;
const int N = (int)5e5 + 5;
const int LogN = (int)22;
int L[4 * N * LogN];
int R[N * 4 * LogN];
int T[N * 4 * LogN];
int version;
int root[N * 4 * LogN];
int src[N];
unordered_map<int, int> pos;
void build(int i, int b, int e) {
if (b == e) {
T[i] = 0;
return;
... | replace | 3 | 5 | 3 | 5 | -11 | |
p02599 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ctime>
#include <iostream>
using namespace std;
#define _LL long long
#define rep(i, n) for (_LL i = 0; i < (_LL)(n); i++)
#define vecrep(itr, v) for (auto itr = (v).begin(); itr != (v).end(); itr++)
template <class T> class SegTree {
private:
int _n;
int _d;
template <class U... | #include <bits/stdc++.h>
#include <ctime>
#include <iostream>
using namespace std;
#define _LL long long
#define rep(i, n) for (_LL i = 0; i < (_LL)(n); i++)
#define vecrep(itr, v) for (auto itr = (v).begin(); itr != (v).end(); itr++)
template <class T> class SegTree {
private:
int _n;
int _d;
template <class U... | replace | 149 | 150 | 149 | 153 | 0 | |
p02599 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a = b;
return true;
}
return false;
}
#define all(x) (x).beg... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a = b;
return true;
}
return false;
}
#define all(x) (x).beg... | replace | 22 | 23 | 22 | 23 | TLE | |
p02599 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define DEBUG
#ifdef DEBUG
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1> void __f(const char *name, Arg1 &&arg1) {
cerr << name << " = " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char *names, Arg1 &&arg1, Ar... | #include <bits/stdc++.h>
using namespace std;
#define DEBUG
#ifdef DEBUG
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1> void __f(const char *name, Arg1 &&arg1) {
cerr << name << " = " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char *names, Arg1 &&arg1, Ar... | replace | 50 | 51 | 50 | 51 | 0 | |
p02599 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
const int N = 500000 + 500;
const int B = 1000000 + 1000;
const int M = 200000 + 200;
int Yuyuko;
int n, m;
int b[B], a[N], block[N], ans[M], cans = 1;
struct operation {
int l, r, id;
} o[M];
inline... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
const int N = 500000 + 500;
const int B = 1000000 + 1000;
const int M = 500000 + 200;
int Yuyuko;
int n, m;
int b[B], a[N], block[N], ans[M], cans = 1;
struct operation {
int l, r, id;
} o[M];
inline... | replace | 9 | 10 | 9 | 10 | 0 | |
p02599 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for (ll i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = ve... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for (ll i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = ve... | replace | 48 | 49 | 48 | 49 | 0 | |
p02599 | C++ | Runtime Error | /* 実装例 Atcoder Beginers Contest 174-F Range Set query */
#include <algorithm>
#include <cmath>
#include <iostream>
#include <set>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define ALL(a) (a).begin(), (a).end()
signed main() {
int n, q;
std::cin >> n >> q;
int sq = 2 * sqrt(n);
std::vecto... | /* 実装例 Atcoder Beginers Contest 174-F Range Set query */
#include <algorithm>
#include <cmath>
#include <iostream>
#include <set>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define ALL(a) (a).begin(), (a).end()
signed main() {
int n, q;
std::cin >> n >> q;
int sq = 2 * sqrt(n);
std::vecto... | replace | 17 | 18 | 17 | 18 | 0 | |
p02599 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define N 511111
#define A 1111111
#define BLOCK 555 // ~sqrt(N)
int cnt[A], a[N], ans[N], answer = 0;
struct node {
int L, R, i;
} q[N];
bool cmp(node x, node y) {
if (x.L / BLOCK != y.L / BLOCK) {
// different blocks, so sort by block.
return x.L / BLOCK <... | #include <bits/stdc++.h>
using namespace std;
#define N 511111
#define A 511111
#define BLOCK 710 // ~sqrt(N)
int cnt[A], a[N], ans[N], answer = 0;
struct node {
int L, R, i;
} q[N];
bool cmp(node x, node y) {
if (x.L / BLOCK != y.L / BLOCK) {
// different blocks, so sort by block.
return x.L / BLOCK < ... | replace | 4 | 6 | 4 | 6 | TLE | |
p02599 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int MAX_N = 262144;
vector<int64_t> seg(MAX_N * 2 - 1);
int64_t qu(int a, int b, int k, int l, int r) {
if (r <= a || b <= l) {
return 0;
} else if (a <= l && r <= b) {
return seg[k];
} else {
int64_t X = qu(a, b, k * 2 + 1, l, (l + r) / 2);
int64_t Y... | #include <bits/stdc++.h>
using namespace std;
int MAX_N = 262144 * 2;
vector<int64_t> seg(MAX_N * 2 - 1);
int64_t qu(int a, int b, int k, int l, int r) {
if (r <= a || b <= l) {
return 0;
} else if (a <= l && r <= b) {
return seg[k];
} else {
int64_t X = qu(a, b, k * 2 + 1, l, (l + r) / 2);
int64... | replace | 3 | 4 | 3 | 4 | 0 | |
p02599 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define mod 1000000007
#define fr first
#define val second
#define N 100000000
#define fo(i, m, n) for (int i = m; i < n; i++)
#define M 7
#define fast_io \
ios_base::sync_with_stdio(false); ... | #include <bits/stdc++.h>
#define mod 1000000007
#define fr first
#define val second
#define N 100000000
#define fo(i, m, n) for (int i = m; i < n; i++)
#define M 7
#define fast_io \
ios_base::sync_with_stdio(false); ... | replace | 132 | 133 | 132 | 133 | TLE | |
p02599 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define ff first
#define ss second
int n, q, pos;
int a[30002], tree[4 * 30002], idx[1000002], ans[200002];
pair<int, pair<int, int>> qy[200002];
bool cmp(pair<int, pair<int, int>> a, pair<int, pair<int, int>> b) {
return a.ss.f... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define ff first
#define ss second
int n, q, pos;
int a[500002], tree[4 * 500002], idx[500002], ans[500002];
pair<int, pair<int, int>> qy[500002];
bool cmp(pair<int, pair<int, int>> a, pair<int, pair<int, int>> b) {
return a.ss.... | replace | 8 | 10 | 8 | 10 | 0 | |
p02599 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <chrono>
#include <cmath>
#include <complex>
#include <cstdlib>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <stri... | #include <algorithm>
#include <cassert>
#include <chrono>
#include <cmath>
#include <complex>
#include <cstdlib>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <stri... | replace | 24 | 25 | 24 | 25 | 0 | |
p02599 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ALL(A) (A).begin(), (A).end()
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a ... | #include <bits/stdc++.h>
#define ALL(A) (A).begin(), (A).end()
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, T b) {
if (a ... | insert | 92 | 92 | 92 | 93 | TLE | |
p02599 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
ll n;
ll dat[200005];
void init(ll n_) {
n = 1;
while (n <= n_)
n *= 2;
}
void update(ll k, ll a) {
k += n - 1;
dat[k] = a;
while (0 < k) {
k = (k - 1) / 2;
dat[k] = (dat[2 * k + 1] + dat[2 * k + 2]);
}
}... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
ll n;
ll dat[2000005];
void init(ll n_) {
n = 1;
while (n <= n_)
n *= 2;
}
void update(ll k, ll a) {
k += n - 1;
dat[k] = a;
while (0 < k) {
k = (k - 1) / 2;
dat[k] = (dat[2 * k + 1] + dat[2 * k + 2]);
}
... | replace | 5 | 6 | 5 | 6 | 0 | |
p02599 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <map>
#include <stdio.h>
using namespace std;
const int maxn = 300005;
struct node {
int l, r, sum;
} tree[maxn * 4];
struct ques {
int l, r, index;
} ask[maxn];
int a[maxn];
int ans[maxn];
void build(int i, int left, int right) {
tree[i].l = left, tree[i].r = rig... | #include <algorithm>
#include <iostream>
#include <map>
#include <stdio.h>
using namespace std;
const int maxn = 500005;
struct node {
int l, r, sum;
} tree[maxn * 4];
struct ques {
int l, r, index;
} ask[maxn];
int a[maxn];
int ans[maxn];
void build(int i, int left, int right) {
tree[i].l = left, tree[i].r = rig... | replace | 5 | 6 | 5 | 6 | 0 | |
p02599 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define dofloat cout << fixed << setprecision(8)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define bitcount __builtin_popcount
#define all(vec) vec.begin(), vec.end()
#define rall(vec) vec.rbeg... | #include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define dofloat cout << fixed << setprecision(8)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define bitcount __builtin_popcount
#define all(vec) vec.begin(), vec.end()
#define rall(vec) vec.rbeg... | replace | 77 | 78 | 77 | 78 | TLE | |
p02599 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
const int maxn = 500005;
struct Node {
int sum;
int lson, rson;
} a[maxn * 30];
int tot = 1;
void buildtree(int id, int l, int r) {
if (l == r)
return;
a[id].lson = ++tot;
a[id].rson = ++tot;
int mid = (l + r) / 2;
buil... | #include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
const int maxn = 500005;
struct Node {
int sum;
int lson, rson;
} a[maxn * 60];
int tot = 1;
void buildtree(int id, int l, int r) {
if (l == r)
return;
a[id].lson = ++tot;
a[id].rson = ++tot;
int mid = (l + r) / 2;
buil... | replace | 10 | 11 | 10 | 11 | -11 | |
p02599 | C++ | Time Limit Exceeded | /*
Auther: ghoshashis545 Ashis Ghosh
College: Jalpaiguri Govt Enggineering College
*/
#include <algorithm>
#include <bits/stdc++.h>
#include <string>
using namespace std;
#define ll int
#define int long long
#define ld long double
#define ff first
#define ss string
#define se second
#define endl "\n"
#define al... | /*
Auther: ghoshashis545 Ashis Ghosh
College: Jalpaiguri Govt Enggineering College
*/
#include <algorithm>
#include <bits/stdc++.h>
#include <string>
using namespace std;
#define ll int
#define int long long
#define ld long double
#define ff first
#define ss string
#define se second
#define endl "\n"
#define al... | replace | 56 | 57 | 56 | 57 | TLE | |
p02599 | C++ | Runtime Error | // C++ code to find number of distinct numbers
// in a subarray
#include <bits/stdc++.h>
using namespace std;
const int MAX = 100001;
// structure to store queries
struct Query {
int l, r, idx;
};
// cmp function to sort queries according to r
bool cmp(Query x, Query y) { return x.r < y.r; }
// updating the bit a... | // C++ code to find number of distinct numbers
// in a subarray
#include <bits/stdc++.h>
using namespace std;
const int MAX = 1000001;
// structure to store queries
struct Query {
int l, r, idx;
};
// cmp function to sort queries according to r
bool cmp(Query x, Query y) { return x.r < y.r; }
// updating the bit ... | replace | 5 | 6 | 5 | 6 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.