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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
p03108 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
const int INF = 1 << 30;
const int MOD = 1e9 + 7;
con... | #include <algorithm>
#include <cmath>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
const int INF = 1 << 30;
const int MOD = 1e9 + 7;
con... | replace | 44 | 45 | 44 | 45 | 0 | |
p03108 | C++ | Runtime Error | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <list>
#include <math.h>
#include <numeric>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<ULL> VULL;
class MYCP {
public:
sta... | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <list>
#include <math.h>
#include <numeric>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<ULL> VULL;
class MYCP {
public:
sta... | insert | 503 | 503 | 503 | 505 | 0 | |
p03108 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define RANGE(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
using namespace std;
struct union_find {
vector<ll> par;
vector<ll> size;
union_find(ll n) : par(n), size(n) {
RANGE(i, n) {
par[i] = i;
size[i] = 1;
}
}
void union_tree(ll i, ll j) {
ll ... | #include <bits/stdc++.h>
#define RANGE(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
using namespace std;
struct union_find {
vector<ll> par;
vector<ll> size;
union_find(ll n) : par(n), size(n) {
RANGE(i, n) {
par[i] = i;
size[i] = 1;
}
}
void union_tree(ll i, ll j) {
ll ... | replace | 25 | 29 | 25 | 34 | TLE | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define For(i, n) for (int i = 0; i < n; i++)
#define Fre(i, a, b) for (int i = a; i < b; i++)
#define sf(n) scanf("%d", &n)
#define sff(a, b) scanf("%d %d", &a, &b)
#define sfff(a, b, c) scanf("%d %d %d", &a,... | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define For(i, n) for (int i = 0; i < n; i++)
#define Fre(i, a, b) for (int i = a; i < b; i++)
#define sf(n) scanf("%d", &n)
#define sff(a, b) scanf("%d %d", &a, &b)
#define sfff(a, b, c) scanf("%d %d %d", &a,... | replace | 68 | 72 | 68 | 69 | 0 | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr long long MOD = 1000000007;
constexpr long long INF = 1LL << 60;
const long double PI = acosl(-1.0);
constexpr long double EPS = 1e-11;
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr long long MOD = 1000000007;
constexpr long long INF = 1LL << 60;
const long double PI = acosl(-1.0);
constexpr long double EPS = 1e-11;
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return ... | insert | 67 | 67 | 67 | 69 | 0 | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define ve vector
struct UnionFind {
vector<int> d;
UnionFind(int n = 0) : d(n, -1) {}
int find(int x) {
if (d[x] < 0)
return x;
return d[x] = find(d[x]);
... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define ve vector
struct UnionFind {
vector<int> d;
UnionFind(int n = 0) : d(n, -1) {}
int find(int x) {
if (d[x] < 0)
return x;
return d[x] = find(d[x]);
... | replace | 45 | 46 | 45 | 46 | -6 | free(): invalid pointer
|
p03108 | 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 | 66 | 68 | 66 | 71 | -6 | malloc(): corrupted top size
|
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
using namespace __gnu_pbds;
// find_by_order gives kth-largest element
// order_of_key gives the number of items in the set that are... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
using namespace __gnu_pbds;
// find_by_order gives kth-largest element
// order_of_key gives the number of items in the set that are... | replace | 44 | 45 | 44 | 45 | 0 | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int gcd(int a, int b) { return (b == 0) ? a : gcd(b, a % b); }
#define CIN(T, x) \
T x; \
cin >> x;
#define CINS(... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int gcd(int a, int b) { return (b == 0) ? a : gcd(b, a % b); }
#define CIN(T, x) \
T x; \
cin >> x;
#define CINS(... | replace | 25 | 28 | 25 | 28 | 0 | |
p03108 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int N_MAX = 100001;
typedef pair<int, int> P;
int main() {
long long n, m;
cin >> n >> m;
P b[N_MAX];
int c[N_MAX], nc[N_MAX], pc[N_MAX], pi[N_MAX];
long long res[N_MAX];
int i1, i2, s1, s2, p, pt;
long long c1, c2;
for (int... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int N_MAX = 100001;
typedef pair<int, int> P;
int main() {
long long n, m;
cin >> n >> m;
P b[N_MAX];
int c[N_MAX], nc[N_MAX], pc[N_MAX], pi[N_MAX];
long long res[N_MAX];
int i1, i2, s1, s2, p, pt;
long long c1, c2;
for (int... | insert | 31 | 31 | 31 | 35 | TLE | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
long long n, m;
long long f[10001], yh[10001];
long long bb(long long p) {
if (f[p] == p)
return p;
return f[p] = bb(f[p]);
}
int main() {
cin >> n >> m;
long long i, x[m + 1], y[m + 1], ans[m], j, k, s, z = n;
for (i = 1; i <= n; i++) {
f[i] = i;
yh[i... | #include <bits/stdc++.h>
using namespace std;
long long n, m;
long long f[100010], yh[100010];
long long bb(long long p) {
if (f[p] == p)
return p;
return f[p] = bb(f[p]);
}
int main() {
cin >> n >> m;
long long i, x[m + 1], y[m + 1], ans[m], j, k, s, z = n;
for (i = 1; i <= n; i++) {
f[i] = i;
yh... | replace | 3 | 4 | 3 | 4 | 0 | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const ll MOD = 1000000007;
class UnionFind {
public:
vector<int> par;
vector<int> rank;
UnionFind(int n) { init(n); }
void init(int n) {
par.resize(n);
for (int i = 0; i < n; i++) {
par[i] = i;
}
... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const ll MOD = 1000000007;
class UnionFind {
public:
vector<int> par;
vector<int> rank;
UnionFind(int n) { init(n); }
void init(int n) {
par.resize(n);
for (int i = 0; i < n; i++) {
par[i] = i;
}
... | replace | 56 | 57 | 56 | 57 | 0 | |
p03108 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define REP(i, n) for (ll i = 0; i < (ll)n; i++)
#define INF 1000000000000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define REP(i, n) for (ll i = 0; i < (ll)n; i++)
#define INF 1000000000000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
... | replace | 64 | 65 | 64 | 69 | 0 | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < n; i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define inf LLONG_MAX
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
struct UnionFind {
vll par;
vll count;
UnionFi... | #include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < n; i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define inf LLONG_MAX
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
struct UnionFind {
vll par;
vll count;
UnionFi... | replace | 50 | 51 | 50 | 54 | 0 | |
p03108 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;
struct node {
int p;
int v;
int s;
};
int get_pid(vector<node> &vec, int i) {
while (i != vec[i].p)
i = vec[i].p;
return i;
}
int main() {
int n, m;
cin >> n >> m;
vector<node> vec(n + 1);
for... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;
struct node {
int p;
int v;
int s;
};
int get_pid(vector<node> &vec, int i) {
int p = i;
while (p != vec[p].p)
p = vec[p].p;
int c = i;
while (c != vec[c].p) {
int n = vec[c].p;
vec[c].p = ... | replace | 14 | 17 | 14 | 24 | TLE | |
p03108 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
typedef long long ll;
int an = 0;
const ll INF = 1e18;
const ll MOD = 1e9 + 7;
typedef pair<int, int> P;
const int xx[4] = {1, -1, 0, 0}, yy[4] = {0, 0, 1, -1};
struct tp {
int x, y;
ll cs;
};
const int wd = 1000001;
s... | #include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
typedef long long ll;
int an = 0;
const ll INF = 1e18;
const ll MOD = 1e9 + 7;
typedef pair<int, int> P;
const int xx[4] = {1, -1, 0, 0}, yy[4] = {0, 0, 1, -1};
struct tp {
int x, y;
ll cs;
};
const int wd = 1000001;
s... | replace | 54 | 55 | 54 | 55 | 0 | |
p03108 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<int> A(M), B(M);
for (int i = 0; i < M; i++) {
cin >> A[i] >> B[i];
A[i]--;
B[i]--;
}
vector<long long> ans(M + 1);
vector<int> Tree(N, -1);
vector<int> Treesize(N, 1);
long long fuben = (long long... | #include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<int> A(M), B(M);
for (int i = 0; i < M; i++) {
cin >> A[i] >> B[i];
A[i]--;
B[i]--;
}
vector<long long> ans(M + 1);
vector<int> Tree(N, -1);
vector<int> Treesize(N, 1);
long long fuben = (long long... | insert | 29 | 29 | 29 | 31 | TLE | |
p03108 | C++ | Runtime Error | #include <algorithm>
#include <cstdint>
#include <iostream>
#include <vector>
using namespace std;
struct UnionFind {
std::vector<std::size_t> par;
std::vector<std::size_t> _size;
UnionFind(std::size_t N) : par(N), _size(N, 1) {
for (std::size_t i = 0; i < N; i++) {
par[i] = i;
}
}
std::size... | #include <algorithm>
#include <cstdint>
#include <iostream>
#include <vector>
using namespace std;
struct UnionFind {
std::vector<std::size_t> par;
std::vector<std::size_t> _size;
UnionFind(std::size_t N) : par(N), _size(N, 1) {
for (std::size_t i = 0; i < N; i++) {
par[i] = i;
}
}
std::size... | insert | 53 | 53 | 53 | 55 | 0 | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// #define int long long
#define rep(i, n) for (long long i = (long long)(0); i < (long long)(n); ++i)
#define reps(i, n) for (long long i = (long long)(1); i <= (long long)(n); ++i)
#define rrep(i, n) for (long long i = ((long long)(n)-1); i >= 0; i--)
#define rreps(i, n)... | #include <bits/stdc++.h>
using namespace std;
// #define int long long
#define rep(i, n) for (long long i = (long long)(0); i < (long long)(n); ++i)
#define reps(i, n) for (long long i = (long long)(1); i <= (long long)(n); ++i)
#define rrep(i, n) for (long long i = ((long long)(n)-1); i >= 0; i--)
#define rreps(i, n)... | replace | 96 | 97 | 96 | 97 | 0 | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// #define int long long
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define ir... | #include <bits/stdc++.h>
using namespace std;
// #define int long long
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define ir... | replace | 100 | 101 | 100 | 101 | 0 | |
p03108 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <time.h>
#include <tuple>
#include <utili... | #include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <time.h>
#include <tuple>
#include <utili... | insert | 79 | 79 | 79 | 80 | 0 | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define _GLIBCXX_DEBUG
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vd = vector<double>;
using vvi = vector<vi>;
using vvll = v... | #include <bits/stdc++.h>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define _GLIBCXX_DEBUG
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vd = vector<double>;
using vvi = vector<vi>;
using vvll = v... | replace | 73 | 75 | 73 | 75 | 0 | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
long long inf = LLONG_MAX;
vector<long long> id;
long long find(long long i) {
if (id[i] <= 0)
return i;
return id[i] = find(id[i]);
}
long long unio(long long i, long long j) {
long long u = find(i);
long long k = find(j);
if (find(i)... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
long long inf = LLONG_MAX;
vector<long long> id;
long long find(long long i) {
if (id[i] <= 0)
return i;
return id[i] = find(id[i]);
}
long long unio(long long i, long long j) {
long long u = find(i);
long long k = find(j);
if (find(i)... | replace | 25 | 33 | 25 | 26 | 0 | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
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 > b) {
a =... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
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 > b) {
a =... | replace | 48 | 49 | 48 | 53 | 0 | |
p03108 | C++ | Runtime Error |
#include <algorithm>
#include <bits/stdc++.h>
#include <iomanip>
#include <iostream>
#include <map>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, a, b) for (long long i = (a), i##Len_ = (b); i < i##Len_; i++)
typedef long ll;
// abc120
// i番... |
#include <algorithm>
#include <bits/stdc++.h>
#include <iomanip>
#include <iostream>
#include <map>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, a, b) for (long long i = (a), i##Len_ = (b); i < i##Len_; i++)
typedef long ll;
// abc120
// i番... | delete | 66 | 69 | 66 | 66 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
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 > b) {
a = b;
return 1;
}
return 0;
}
const long long INF = 1LL << 60;
long long dp[100100];
... | #include <bits/stdc++.h>
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 > b) {
a = b;
return 1;
}
return 0;
}
const long long INF = 1LL << 60;
long long dp[100100];
... | replace | 67 | 68 | 67 | 68 | -6 | free(): invalid pointer
|
p03108 | C++ | Runtime Error | #include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <strin... | #include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <strin... | replace | 150 | 151 | 150 | 151 | 0 | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
class union_find {
public:
using tp = std::vector<size_t>::size_type;
// 取り扱う型.
explicit union_find(const tp n)
: parent(n), rank(n, 0), cache(), element(n, 1) {
for (tp i = 0; i < n; i++) {
parent[i] = i;
}
cache.reserve(n);
}
tp root(tp n) {
// 番号nの親を求め... | #include <bits/stdc++.h>
class union_find {
public:
using tp = std::vector<size_t>::size_type;
// 取り扱う型.
explicit union_find(const tp n)
: parent(n), rank(n, 0), cache(), element(n, 1) {
for (tp i = 0; i < n; i++) {
parent[i] = i;
}
cache.reserve(n);
}
tp root(tp n) {
// 番号nの親を求め... | replace | 92 | 93 | 92 | 93 | 0 | |
p03108 | C++ | Time Limit Exceeded | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#def... | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#def... | replace | 51 | 53 | 51 | 58 | TLE | |
p03108 | C++ | Runtime Error | #include <iostream>
#include <utility>
#include <vector>
using namespace std;
struct unionfind {
vector<int> p, sz;
unionfind(int n) {
p = vector<int>(n, -1);
sz = vector<int>(n, 1);
}
int root(int x) {
if (p[x] == -1) {
return x;
} else {
p[x] = root(p[x]);
return p[x];
}
... | #include <iostream>
#include <utility>
#include <vector>
using namespace std;
struct unionfind {
vector<int> p, sz;
unionfind(int n) {
p = vector<int>(n, -1);
sz = vector<int>(n, 1);
}
int root(int x) {
if (p[x] == -1) {
return x;
} else {
p[x] = root(p[x]);
return p[x];
}
... | insert | 34 | 34 | 34 | 36 | 0 | |
p03108 | C++ | Runtime Error | // includes
#include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
... | // includes
#include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
... | replace | 98 | 99 | 98 | 99 | 0 | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (signed i = 0; i < n; ++i)
#define repi(n) rep(i, n)
#define int long long
#define str string
#define vint vector<int>
#define pint pair<int, int>
#define pb(a) push_back(a)
#define all(v) v.begin(), v.end()
#define yn(b) cout << ((b) ? "Yes" : "No") <... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (signed i = 0; i < n; ++i)
#define repi(n) rep(i, n)
#define int long long
#define str string
#define vint vector<int>
#define pint pair<int, int>
#define pb(a) push_back(a)
#define all(v) v.begin(), v.end()
#define yn(b) cout << ((b) ? "Yes" : "No") <... | replace | 64 | 65 | 64 | 65 | 0 | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
struct UnionFind {
vector<ll> par;
vector<ll> rank;
vector<ll> sz;
UnionFind(ll n) : par(n), rank(n), sz(n) {
for (ll i = 0; i < n; i++) {
par[i] = i;
rank[i] = 0;
sz[i] = 1;
}
}
ll root(ll x) {
if (par[x] == x... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
struct UnionFind {
vector<ll> par;
vector<ll> rank;
vector<ll> sz;
UnionFind(ll n) : par(n), rank(n), sz(n) {
for (ll i = 0; i < n; i++) {
par[i] = i;
rank[i] = 0;
sz[i] = 1;
}
}
ll root(ll x) {
if (par[x] == x... | replace | 53 | 54 | 53 | 54 | 0 | |
p03108 | C++ | Time Limit Exceeded | #include <iostream>
#include <vector>
using namespace std;
struct UnionFind {
vector<int> par;
vector<long> sizes;
UnionFind(int N) : par(N), sizes(N) {
for (int i = 0; i < N; ++i) {
par[i] = i;
sizes[i] = 1;
}
}
int root(int x) { return par[x] == x ? x : root(par[x]); }
void unite(int ... | #include <iostream>
#include <vector>
using namespace std;
struct UnionFind {
vector<int> par;
vector<long> sizes;
UnionFind(int N) : par(N), sizes(N) {
for (int i = 0; i < N; ++i) {
par[i] = i;
sizes[i] = 1;
}
}
int root(int x) { return par[x] == x ? x : root(par[x]); }
void unite(int ... | replace | 18 | 20 | 18 | 27 | TLE | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
#define SORT(x) sort((x).begin(), (x).end())
#define ALL(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < n; i++)
#define reps(i, m, n) for (int i = m; i < n; i++)
#define repr(i, m, n) for (int i = m; i >= n; i--)
#define db(x) cout << #x << "=" << x << endl
template <class T> b... | #include <bits/stdc++.h>
#define SORT(x) sort((x).begin(), (x).end())
#define ALL(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < n; i++)
#define reps(i, m, n) for (int i = m; i < n; i++)
#define repr(i, m, n) for (int i = m; i >= n; i--)
#define db(x) cout << #x << "=" << x << endl
template <class T> b... | replace | 82 | 83 | 82 | 83 | 0 | |
p03108 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cstdio>
#include <functional>
#include <iterator>
#include <map>
#include <vector>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vll = vector<ll>;
using vvll = vector<vll>;
struct v_t {
int p;
vi c;
};
... | #include <algorithm>
#include <cstdio>
#include <functional>
#include <iterator>
#include <map>
#include <vector>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vll = vector<ll>;
using vvll = vector<vll>;
struct v_t {
int p;
vi c;
};
... | replace | 38 | 39 | 38 | 39 | TLE | |
p03108 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
class UnionFind {
public:
vector<int> parent;
UnionFind(int n) { parent = vector<int>(n, -1); }
int root(int a) {
if (parent[a] < 0)
return a;
return parent[a] = root(parent[a]);
}
int size(int a) { return -parent[root(a)]; }
int con... | #include <iostream>
#include <vector>
using namespace std;
class UnionFind {
public:
vector<int> parent;
UnionFind(int n) { parent = vector<int>(n, -1); }
int root(int a) {
if (parent[a] < 0)
return a;
return parent[a] = root(parent[a]);
}
int size(int a) { return -parent[root(a)]; }
int con... | insert | 35 | 35 | 35 | 37 | 0 | |
p03108 | C++ | Runtime Error | #include <algorithm>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef int itn;
const ll LINF = 1e18;
const int INF = 1e8;
//... | #include <algorithm>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef int itn;
const ll LINF = 1e18;
const int INF = 1e8;
//... | replace | 95 | 98 | 95 | 98 | 0 | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, m, n) for (int i = m; i < n; ++i)
#define rem(i, m, n) for (int i = m; i >= n; --i)
typedef long long ll;
#define mod 1000000007
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> boo... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, m, n) for (int i = m; i < n; ++i)
#define rem(i, m, n) for (int i = m; i >= n; --i)
typedef long long ll;
#define mod 1000000007
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> boo... | replace | 52 | 53 | 52 | 53 | 0 | |
p03108 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define MOD 1000000007
struct UnionFind {
vector<int> data;... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define MOD 1000000007
struct UnionFind {
vector<int> data;... | insert | 43 | 43 | 43 | 44 | 0 | |
p03108 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define MOD 1000000007
#define REP(i, N) for (int i = 0; i < N; ++i)
#define REP1(i, N) for (int i = 1; i <= N; ++i)
#define RREP(i, N) for (int i = N - 1; i >= 0; --i)
#define ALL(a) a.begin... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define MOD 1000000007
#define REP(i, N) for (int i = 0; i < N; ++i)
#define REP1(i, N) for (int i = 1; i <= N; ++i)
#define RREP(i, N) for (int i = N - 1; i >= 0; --i)
#define ALL(a) a.begin... | replace | 59 | 60 | 59 | 60 | 0 | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep2(x, fr, to) for (int x = (fr); x < (to); x++)
#define rep(x, to) for (int x = 0; x < (to); x++)
#define repr(x, fr, to) for (int x = (fr); x >= (to); x--)
#define all(c) c.begin(), c.end()
#define sz(v) (int)v.size()
using namespace std;
typedef long long ll;
typedef vector<int> V... | #include <bits/stdc++.h>
#define rep2(x, fr, to) for (int x = (fr); x < (to); x++)
#define rep(x, to) for (int x = 0; x < (to); x++)
#define repr(x, fr, to) for (int x = (fr); x >= (to); x--)
#define all(c) c.begin(), c.end()
#define sz(v) (int)v.size()
using namespace std;
typedef long long ll;
typedef vector<int> V... | replace | 49 | 50 | 49 | 50 | 0 | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define PI arccos(-1)
#define rep(i, N) for (int i = 0; i < (N); i++)
#define REP(i, a, N) for (int i = a; i < (N); i++)
#define rrep(i, N, k) \
for (int i = (N); i >= (k); i--) ... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define PI arccos(-1)
#define rep(i, N) for (int i = 0; i < (N); i++)
#define REP(i, a, N) for (int i = a; i < (N); i++)
#define rrep(i, N, k) \
for (int i = (N); i >= (k); i--) ... | replace | 36 | 37 | 36 | 38 | 0 | |
p03108 | C++ | Runtime Error | #include <iostream>
using namespace std;
#ifdef DEBUG
#define IFD if (true)
#else
#define IFD if (false)
#endif
#include <vector>
// 要素個数カウント付き Union Find
// 要素の型。int か long あたりを想定
template <typename T_uf_data>
class UnionFind {
private:
std::vector<T_uf_data> par; // 親 (parent) を指す
std::vector<T_uf_data> rnk;... | #include <iostream>
using namespace std;
#ifdef DEBUG
#define IFD if (true)
#else
#define IFD if (false)
#endif
#include <vector>
// 要素個数カウント付き Union Find
// 要素の型。int か long あたりを想定
template <typename T_uf_data>
class UnionFind {
private:
std::vector<T_uf_data> par; // 親 (parent) を指す
std::vector<T_uf_data> rnk;... | replace | 74 | 75 | 74 | 75 | 0 | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
struct UnionFind {
vector<int> par;
// 正の場合、親を表す
// 負の場合、根で数値は連結成分のサイズ
UnionFind(int n) : par(n, -1) {}
int root(int x) {
if (par[x] < 0) {
return x;
} else... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
struct UnionFind {
vector<int> par;
// 正の場合、親を表す
// 負の場合、根で数値は連結成分のサイズ
UnionFind(int n) : par(n, -1) {}
int root(int x) {
if (par[x] < 0) {
return x;
} else... | insert | 52 | 52 | 52 | 54 | 0 | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
#define int long long
#define double long double
#define rep(i, a, n) for (int i = (int)(a); (i) < (int)(n); ++(i))
#define repe(i, a, n) for (int i = (int)(a); (i) <= (int)(n); ++(i))
#define repif(i, a, x) for (int i = (int)(a); (x); ++(i))
#define repr(i, a, n) for (int i = ((int)(a)-1); (i)... | #include <bits/stdc++.h>
#define int long long
#define double long double
#define rep(i, a, n) for (int i = (int)(a); (i) < (int)(n); ++(i))
#define repe(i, a, n) for (int i = (int)(a); (i) <= (int)(n); ++(i))
#define repif(i, a, x) for (int i = (int)(a); (x); ++(i))
#define repr(i, a, n) for (int i = ((int)(a)-1); (i)... | insert | 83 | 83 | 83 | 85 | 0 | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
struct UnionFind {
vector<int> par;
vector<int> siz;
UnionFind(int n) : par(n), siz(n) {
for (int i = 0; i < n; i++) {
par[i] = i;
siz[i] = 1;
}
}
int root(int x) {
if (par[x] == x)
return x;
else
re... | #include <bits/stdc++.h>
using namespace std;
#define int long long
struct UnionFind {
vector<int> par;
vector<int> siz;
UnionFind(int n) : par(n), siz(n) {
for (int i = 0; i < n; i++) {
par[i] = i;
siz[i] = 1;
}
}
int root(int x) {
if (par[x] == x)
return x;
else
re... | insert | 50 | 50 | 50 | 52 | 0 | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
struct union_find {
vector<int> par;
union_find(int n) : par(n, -1) {}
int root(int x) {
if (par[x] < 0)
return x;
else
return par[x] = root(par[x]);
}
bool unite(int x, int y) {
int rx = root(x);
int ry = root... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
struct union_find {
vector<int> par;
union_find(int n) : par(n, -1) {}
int root(int x) {
if (par[x] < 0)
return x;
else
return par[x] = root(par[x]);
}
bool unite(int x, int y) {
int rx = root(x);
int ry = root... | replace | 44 | 45 | 44 | 45 | -6 | Fatal glibc error: malloc assertion failure in sysmalloc: (old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)
|
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
class UnionFind {
public:
vector<int> par;
UnionFind(int N) { par = vector<int>(N, -1); }
int root(int x) {
if (par[x] < 0)
return x;
return par[x] = root(par[x]);
}
int size(int x) { return -par[root(x)]; }
int connect(int x, int y) {
x ... | #include <bits/stdc++.h>
using namespace std;
class UnionFind {
public:
vector<int> par;
UnionFind(int N) { par = vector<int>(N, -1); }
int root(int x) {
if (par[x] < 0)
return x;
return par[x] = root(par[x]);
}
int size(int x) { return -par[root(x)]; }
int connect(int x, int y) {
x ... | replace | 38 | 39 | 38 | 39 | 0 | |
p03108 | C++ | Runtime Error | #include <assert.h>
#include <bits/stdc++.h>
using namespace std;
struct UnionFind {
vector<int> data;
UnionFind(int size) { data.resize(size, -1); }
int find(int now) {
return (data[now] < 0 ? now : data[now] = find(data[now]));
}
int size(int now) { return -data[find(now)]; }
bool same(int x, int y)... | #include <assert.h>
#include <bits/stdc++.h>
using namespace std;
struct UnionFind {
vector<int> data;
UnionFind(int size) { data.resize(size, -1); }
int find(int now) {
return (data[now] < 0 ? now : data[now] = find(data[now]));
}
int size(int now) { return -data[find(now)]; }
bool same(int x, int y)... | replace | 35 | 36 | 35 | 36 | -6 | free(): invalid pointer
|
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
typedef long long ll;
vector<ll> parent(100010, -1);
ll N, M, x, y;
ll find(ll x) { return parent[x] < 0 ? x : parent[x] = find(parent[x]); }
void unite(ll x, ll y) {
if (find(x) != find(y)) {
if (parent[x] > pare... | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
typedef long long ll;
vector<ll> parent(100010, -1);
ll N, M, x, y;
ll find(ll x) { return parent[x] < 0 ? x : parent[x] = find(parent[x]); }
void unite(ll x, ll y) {
x = find(x), y = find(y);
if (x != y) {
if (... | replace | 10 | 11 | 10 | 12 | 0 | |
p03108 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define INF 100000000
#define ll long long int
using namespace std;
/*
vector <int> dx = {1,0,-1,0};
vector <int> dy = {0,1,0,-1};
*/
struct Node {
ll parent;
ll size;
};
... | #include <algorithm>
#include <bitset>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define INF 100000000
#define ll long long int
using namespace std;
/*
vector <int> dx = {1,0,-1,0};
vector <int> dy = {0,1,0,-1};
*/
struct Node {
ll parent;
ll size;
};
... | replace | 100 | 103 | 100 | 112 | TLE | |
p03108 | C++ | Time Limit Exceeded | #include <iostream>
#include <vector>
using namespace std;
class UnionFind {
public:
vector<long long> par;
vector<long long> size;
UnionFind(long long N) : par(N), size(N, 1) {
for (long long i = 1; i < N; i++) {
par[i] = i;
}
}
long long root(long long x) {
while (par[x] != x) {
x... | #include <iostream>
#include <vector>
using namespace std;
class UnionFind {
public:
vector<long long> par;
vector<long long> size;
UnionFind(long long N) : par(N), size(N, 1) {
for (long long i = 1; i < N; i++) {
par[i] = i;
}
}
long long root(long long x) {
while (par[x] != x) {
x... | replace | 25 | 26 | 25 | 26 | TLE | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i, n) for (auto i = 0; i < n; i++)
#define REPR(i, n) for (auto i = n - 1; i >= 0; i--)
typedef pair<ll, ll> LP;
const ll mod = 1e9 + 7;
struct UnionFind {
vector<int> data;
// dataの各要素について
// 負の値:その集合のルートであること示す。また、その絶対値は集合の要素数となっ... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i, n) for (auto i = 0; i < n; i++)
#define REPR(i, n) for (auto i = n - 1; i >= 0; i--)
typedef pair<ll, ll> LP;
const ll mod = 1e9 + 7;
struct UnionFind {
vector<int> data;
// dataの各要素について
// 負の値:その集合のルートであること示す。また、その絶対値は集合の要素数となっ... | replace | 58 | 61 | 58 | 61 | 0 | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
#define all(x) (x).beg... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
#define all(x) (x).beg... | replace | 90 | 91 | 90 | 91 | 0 | |
p03108 | C++ | Time Limit Exceeded | // #pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
#define String std::string
#define fir first
#define sec second
#define mp std::make_pair
#define Pair std::pair<int, int>
#define Map std::map<int, int>
#define Vector std::vector<int>
typedef long long ll;
typedef unsigned long long ull;
const i... | // #pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
#define String std::string
#define fir first
#define sec second
#define mp std::make_pair
#define Pair std::pair<int, int>
#define Map std::map<int, int>
#define Vector std::vector<int>
typedef long long ll;
typedef unsigned long long ull;
const i... | replace | 37 | 38 | 37 | 38 | TLE | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rp(i, k, n) for (int i = k; i < n; i++)
typedef long long ll;
typedef double ld;
template <class T> inline bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, const T &b) {
if (b < a... | #include <bits/stdc++.h>
using namespace std;
#define rp(i, k, n) for (int i = k; i < n; i++)
typedef long long ll;
typedef double ld;
template <class T> inline bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> inline bool chmin(T &a, const T &b) {
if (b < a... | replace | 85 | 86 | 85 | 86 | 0 | |
p03108 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <tupl... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <tupl... | replace | 49 | 50 | 49 | 50 | 0 | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define EPS (1e-10)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
class UnionFind {
vector<int> par, sz;
public:
UnionFind() {}
UnionFind(... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define EPS (1e-10)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
class UnionFind {
vector<int> par, sz;
public:
UnionFind() {}
UnionFind(... | replace | 47 | 48 | 47 | 52 | 0 | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define MP make_pair
#define PB push_back
#define ALL(x) (x).begin(), (x).end()
#define REP(i, n) for (int i = 0; i < (n); i++)
#define REP1(i, n) for (int i = 1; i < (n); i++)
#define REP2(i, d, n) for (int i = (d); i < (n); i++)
#define RREP(i, n) for (int i = (n); i >= ... | #include <bits/stdc++.h>
using namespace std;
#define MP make_pair
#define PB push_back
#define ALL(x) (x).begin(), (x).end()
#define REP(i, n) for (int i = 0; i < (n); i++)
#define REP1(i, n) for (int i = 1; i < (n); i++)
#define REP2(i, d, n) for (int i = (d); i < (n); i++)
#define RREP(i, n) for (int i = (n); i >= ... | insert | 53 | 53 | 53 | 57 | 0 | |
p03108 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll par[100005], sum[100005], bridg[100005][2], ans[100005];
ll find(ll x) { return par[x] == x ? x : find(par[x]); }
int main() {
ll n, m;
cin >> n >> m;
for (int i = 0; i < n; i++) {
par[i] = i;
sum[i] = 1;
}
for (int i = 0; i < m; i... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll par[100005], sum[100005], bridg[100005][2], ans[100005];
ll find(ll x) { return par[x] == x ? x : par[x] = find(par[x]); }
int main() {
ll n, m;
cin >> n >> m;
for (int i = 0; i < n; i++) {
par[i] = i;
sum[i] = 1;
}
for (int i = 0;... | replace | 4 | 5 | 4 | 5 | TLE | |
p03108 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f first
#define s second
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define IOS \
ios... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f first
#define s second
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define IOS \
ios... | replace | 11 | 12 | 11 | 16 | TLE | |
p03108 | C++ | Runtime Error | // だーれだ?
// qqqqqqHHMqqqqqHf!(:;jHmmkf``(:;jkqqqqqqqqqmMH#HMqqK_````````````````(kqqqqqqHMMM
// qqqqqqHHmqqqqH=` :;;jkqH=?~..;;jqqqqqqqqqmM#HM#MHH!````
// ```````..-``dqWbWkRqHMMM qqqqqqMHmqqqK!``.;;;dqH:
// ```.?TUqqHmqqqqmHHHM4Mqkt..```` ..JgHHW@P`.HHkqHHHqM#NN
// qqqqqmHMmqHTYWHgHmmgHR...``` :;Jkq9qqqqqgMH#1dHk$...-... | // だーれだ?
// qqqqqqHHMqqqqqHf!(:;jHmmkf``(:;jkqqqqqqqqqmMH#HMqqK_````````````````(kqqqqqqHMMM
// qqqqqqHHmqqqqH=` :;;jkqH=?~..;;jqqqqqqqqqmM#HM#MHH!````
// ```````..-``dqWbWkRqHMMM qqqqqqMHmqqqK!``.;;;dqH:
// ```.?TUqqHmqqqqmHHHM4Mqkt..```` ..JgHHW@P`.HHkqHHHqM#NN
// qqqqqmHMmqHTYWHgHmmgHR...``` :;Jkq9qqqqqgMH#1dHk$...-... | replace | 169 | 170 | 169 | 170 | 0 | |
p03108 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long
using namespace std;
const int _M = 1e5 + 40;
ll a[_M], t[_M], ans[_M], k = 0;
struct {
int x, y;
} e[_M];
int fd(int x) { return x == a[x] ? x : fd(a[x]); }
int main() {
int n, m;
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; i++)
a[i] = i, t[i] = 1;
f... | #include <bits/stdc++.h>
#define ll long long
using namespace std;
const int _M = 1e5 + 40;
ll a[_M], t[_M], ans[_M], k = 0;
struct {
int x, y;
} e[_M];
int fd(int x) { return x == a[x] ? x : a[x] = fd(a[x]); }
int main() {
int n, m;
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; i++)
a[i] = i, t[i] =... | replace | 13 | 14 | 13 | 14 | TLE | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
struct UnionFind {
vector<int> par;
UnionFind(int n) : par(n, -1) {}
void init(int n) { par.assign(n, -1); }
int root(int x) {
if (par[x] < 0)
return x;
else
return par[x] = root(par[x]);
}
bool issame(int x, int y) { return root(x) == ro... | #include <bits/stdc++.h>
using namespace std;
struct UnionFind {
vector<int> par;
UnionFind(int n) : par(n, -1) {}
void init(int n) { par.assign(n, -1); }
int root(int x) {
if (par[x] < 0)
return x;
else
return par[x] = root(par[x]);
}
bool issame(int x, int y) { return root(x) == ro... | insert | 39 | 39 | 39 | 41 | 0 | |
p03108 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
#define rep(i, n) for (ll i = 0; i < n; i++)
#define dup(x, y) (((x) + (y)-1) / (y)) // dup * y >= x なる最小のdup.
using namespace s... | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
#define rep(i, n) for (ll i = 0; i < n; i++)
#define dup(x, y) (((x) + (y)-1) / (y)) // dup * y >= x なる最小のdup.
using namespace s... | insert | 38 | 38 | 38 | 43 | TLE | |
p03108 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
#define rep(i, n) for (ll i = 0; i < n; i++)
#define dup(x, y) (((x) + (y)-1) / (y)) // dup * y >= x なる最小のdup.
using namespace s... | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
#define rep(i, n) for (ll i = 0; i < n; i++)
#define dup(x, y) (((x) + (y)-1) / (y)) // dup * y >= x なる最小のdup.
using namespace s... | replace | 38 | 43 | 38 | 43 | TLE | |
p03108 | C++ | Runtime Error | #include <iostream>
typedef long long ll;
using namespace std;
ll parent[10001];
ll s[10001];
ll input[10001][2];
ll ans[10001];
ll sum;
ll Find(ll x) {
if (x == parent[x]) {
return x;
} else {
ll p = Find(parent[x]);
parent[x] = p;
return p;
}
}
void Union(ll x, ll y) {
x = Find(x);
y = Find(... | #include <iostream>
typedef long long ll;
using namespace std;
ll parent[100001];
ll s[100001];
ll input[100001][2];
ll ans[100001];
ll sum;
ll Find(ll x) {
if (x == parent[x]) {
return x;
} else {
ll p = Find(parent[x]);
parent[x] = p;
return p;
}
}
void Union(ll x, ll y) {
x = Find(x);
y = F... | replace | 3 | 7 | 3 | 7 | 0 | |
p03108 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define lp(i, n) for (int i = 0; i < n; ++i)
#define all(v) v.begin(), v.end()
#define sz(v) (int(v.size()))
typedef unsigned long long ul;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vector<int>> vii;
type... | #include <bits/stdc++.h>
using namespace std;
#define lp(i, n) for (int i = 0; i < n; ++i)
#define all(v) v.begin(), v.end()
#define sz(v) (int(v.size()))
typedef unsigned long long ul;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vector<int>> vii;
type... | replace | 40 | 44 | 40 | 50 | TLE | |
p03108 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define lli long long int
#define REP(i, n) for (int i = 0; i < n; i++)
#define REP2(i, n) for (int i = 1; i <= n; i++)
#define DEBUG 0
typedef struct UnionFind {
vector<... | #include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define lli long long int
#define REP(i, n) for (int i = 0; i < n; i++)
#define REP2(i, n) for (int i = 1; i <= n; i++)
#define DEBUG 0
typedef struct UnionFind {
vector<... | replace | 72 | 73 | 72 | 73 | 0 | |
p03108 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
class QuickUnion {
public:
vector<int> id;
vector<long long int> size;
void init(long long int s) {
id.resize(s);
iota(id.begin(), id.end(), 0);
vector<long long int> vec(s, 1LL);
size = vec;
}
int root(int i) {
while (i != id[i])
i = id... | #include <bits/stdc++.h>
using namespace std;
class QuickUnion {
public:
vector<int> id;
vector<long long int> size;
void init(long long int s) {
id.resize(s);
iota(id.begin(), id.end(), 0);
vector<long long int> vec(s, 1LL);
size = vec;
}
int root(int i) {
while (i != id[i])
i = id... | replace | 25 | 27 | 25 | 32 | TLE | |
p03108 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
// しょっぱなやばい、とけなそう感・・・
// 方針たたんな
// 最後から見るか。
// 連結数はN(N-1)/2。最後は-1;
// 毎回すべての連結確認する、はむりむり
// 1[2,3,,,10] 2[3,4,,,10] 3[4,5,,,10]みたいな
// 和を足せばいい?
// んなことないか。1-2,1-3,2-3で1-2きれても3連結
// 孤立した島の積をとるか
// 1-2-3,4-5-6だったら3*3=9がだめ 3+3+3
// 1,2,3,4,5だったら?5*4/2 4+4... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
// しょっぱなやばい、とけなそう感・・・
// 方針たたんな
// 最後から見るか。
// 連結数はN(N-1)/2。最後は-1;
// 毎回すべての連結確認する、はむりむり
// 1[2,3,,,10] 2[3,4,,,10] 3[4,5,,,10]みたいな
// 和を足せばいい?
// んなことないか。1-2,1-3,2-3で1-2きれても3連結
// 孤立した島の積をとるか
// 1-2-3,4-5-6だったら3*3=9がだめ 3+3+3
// 1,2,3,4,5だったら?5*4/2 4+4... | replace | 38 | 39 | 38 | 39 | TLE | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
// しょっぱなやばい、とけなそう感・・・
// 方針たたんな
// 最後から見るか。
// 連結数はN(N-1)/2。最後は-1;
// 毎回すべての連結確認する、はむりむり
// 1[2,3,,,10] 2[3,4,,,10] 3[4,5,,,10]みたいな
// 和を足せばいい?
// んなことないか。1-2,1-3,2-3で1-2きれても3連結
// 孤立した島の積をとるか
// 1-2-3,4-5-6だったら3*3=9がだめ 3+3+3
// 1,2,3,4,5だったら?5*4/2 4+4... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
// しょっぱなやばい、とけなそう感・・・
// 方針たたんな
// 最後から見るか。
// 連結数はN(N-1)/2。最後は-1;
// 毎回すべての連結確認する、はむりむり
// 1[2,3,,,10] 2[3,4,,,10] 3[4,5,,,10]みたいな
// 和を足せばいい?
// んなことないか。1-2,1-3,2-3で1-2きれても3連結
// 孤立した島の積をとるか
// 1-2-3,4-5-6だったら3*3=9がだめ 3+3+3
// 1,2,3,4,5だったら?5*4/2 4+4... | insert | 39 | 39 | 39 | 40 | -11 | |
p03108 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define rep(i, N) for (int i = 0; i < N; i++)
int node[100010] = {};
cla... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define rep(i, N) for (int i = 0; i < N; i++)
int node[100010] = {};
cla... | replace | 54 | 55 | 54 | 59 | 0 | |
p03108 | C++ | Time Limit Exceeded | #include <iostream>
#include <vector>
typedef long long LL;
using namespace std;
LL ans;
vector<LL> p;
vector<LL> cnt;
LL find_root(LL x) {
if (p[x] != x)
x = find_root(p[x]);
return p[x];
}
void unite(LL x, LL y) {
LL nx = find_root(x);
LL ny = find_root(y);
ans = 0;
if (nx == ny)
return;
else... | #include <iostream>
#include <vector>
typedef long long LL;
using namespace std;
LL ans;
vector<LL> p;
vector<LL> cnt;
LL find_root(LL x) {
if (p[x] != x)
p[x] = find_root(p[x]);
return p[x];
}
void unite(LL x, LL y) {
LL nx = find_root(x);
LL ny = find_root(y);
ans = 0;
if (nx == ny)
return;
e... | replace | 11 | 12 | 11 | 12 | TLE | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for (ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for (ll i = (n)-1; i >= 0; i--)
#define rreps(i, e, n) for (ll i = (n)-1; i >= (e); i--)
#defin... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for (ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for (ll i = (n)-1; i >= 0; i--)
#define rreps(i, e, n) for (ll i = (n)-1; i >= (e); i--)
#defin... | replace | 60 | 61 | 60 | 61 | 0 | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0, i##_len = int(n); i < i##_len; ++i)
#define rep(i, a, b) for (int i = int(a); i < int(b); ++i)
#define All(x) (x).begin(), (x).end()
#define rAll(x) (x).rbegin(), (x).rend()
using namespace std;
using ll = long long;
struct UnionFind {
std::vector<int> par;
... | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0, i##_len = int(n); i < i##_len; ++i)
#define rep(i, a, b) for (int i = int(a); i < int(b); ++i)
#define All(x) (x).begin(), (x).end()
#define rAll(x) (x).rbegin(), (x).rend()
using namespace std;
using ll = long long;
struct UnionFind {
std::vector<int> par;
... | replace | 39 | 40 | 39 | 40 | 0 | |
p03108 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 9;
long long result[maxn];
class dsu {
public:
vector<int> parent, size;
dsu(int n) : parent(n + 1), size(n + 1, 1) {
for (int i = 0; i < n + 1; i++) {
parent[i] = i;
}
}
int find(int u) {
if (u == parent[u])
return ... | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 9;
long long result[maxn];
class dsu {
public:
vector<int> parent, size;
dsu(int n) : parent(n + 1), size(n + 1, 1) {
for (int i = 0; i < n + 1; i++) {
parent[i] = i;
}
}
int find(int u) {
if (u == parent[u])
return ... | replace | 18 | 19 | 18 | 19 | TLE | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
// types
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;
typedef vector<ll> vll;
// macros
#define ALL(a) a.begin(), a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#def... | #include <bits/stdc++.h>
using namespace std;
// types
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;
typedef vector<ll> vll;
// macros
#define ALL(a) a.begin(), a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#def... | replace | 94 | 96 | 94 | 99 | 0 | |
p03108 | C++ | Runtime Error | #include <iostream>
#include <vector>
using namespace std;
class UnionFind {
public:
vector<int> Parent;
UnionFind(int N) { Parent = vector<int>(N, -1); }
int root(int A) {
if (Parent[A] < 0)
return A;
return Parent[A] = root(Parent[A]);
}
int size(int A) { return -Parent[root(A)]; }
bool... | #include <iostream>
#include <vector>
using namespace std;
class UnionFind {
public:
vector<int> Parent;
UnionFind(int N) { Parent = vector<int>(N, -1); }
int root(int A) {
if (Parent[A] < 0)
return A;
return Parent[A] = root(Parent[A]);
}
int size(int A) { return -Parent[root(A)]; }
bool... | replace | 47 | 48 | 47 | 48 | -6 | free(): invalid pointer
|
p03108 | C++ | Runtime Error |
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define bcnt __builtin_popcountll
using namespace std;
typedef long long ll;
ty... |
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define bcnt __builtin_popcountll
using namespace std;
typedef long long ll;
ty... | replace | 84 | 85 | 84 | 85 | -11 | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, m, n) for (long i = m; i < n; i++)
#define repr(i, m, n) for (long i = n - 1; i >= m; i--)
struct UnionFind {
vector<int> par, si;
UnionFind(int N) : par(N), si(N, 1) { rep(i, 0, N) par[i] = i; }
int root(int x) {
if (par[x] == x)
return ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, m, n) for (long i = m; i < n; i++)
#define repr(i, m, n) for (long i = n - 1; i >= m; i--)
struct UnionFind {
vector<int> par, si;
UnionFind(int N) : par(N), si(N, 1) { rep(i, 0, N) par[i] = i; }
int root(int x) {
if (par[x] == x)
return ... | replace | 34 | 35 | 34 | 35 | 0 | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <cmath>
#include <iostream>
#include <string>
#include <unordered_map>
#include <unordered_set>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORR(i, a, b) for (ll i = (a); i <= (b); ... | #include <bits/stdc++.h>
#include <cmath>
#include <iostream>
#include <string>
#include <unordered_map>
#include <unordered_set>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORR(i, a, b) for (ll i = (a); i <= (b); ... | replace | 77 | 78 | 77 | 78 | -11 | |
p03108 | C++ | Time Limit Exceeded | #include <iostream>
#include <vector>
using namespace std;
const int NIL = -1;
long long n, m;
long long p[100009], num[100009];
void init() {
for (int i = 0; i < n; i++) {
p[i] = NIL;
num[i] = 1;
}
}
int parent(int a) {
if (p[a] == NIL)
return a;
return parent(p[a]);
}
bool check(int a, int b)... | #include <iostream>
#include <vector>
using namespace std;
const int NIL = -1;
long long n, m;
long long p[100009], num[100009];
void init() {
for (int i = 0; i < n; i++) {
p[i] = NIL;
num[i] = 1;
}
}
int parent(int a) {
if (p[a] == NIL)
return a;
return parent(p[a]);
}
bool check(int a, int b)... | insert | 33 | 33 | 33 | 35 | TLE | |
p03108 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#in... | #include <algorithm>
#include <bitset>
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#in... | replace | 89 | 90 | 89 | 90 | 0 | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
typedef long long ll;
#define rep(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i)
#define REP(i, num, n) for (ll i = num, i##_len = (n); i < i##_len; ++i)
#define repprev(i, a, b) for (int i = b - 1; i >= a; i--)
#define reprev(i, n) repprev(i, 0, n)
... | #include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
typedef long long ll;
#define rep(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i)
#define REP(i, num, n) for (ll i = num, i##_len = (n); i < i##_len; ++i)
#define repprev(i, a, b) for (int i = b - 1; i >= a; i--)
#define reprev(i, n) repprev(i, 0, n)
... | replace | 106 | 107 | 106 | 107 | -6 | munmap_chunk(): invalid pointer
|
p03108 | C++ | Runtime Error | #pragma gcc optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define PER(i, n) for (int i = (n - 1); i >= 0; --i)
#define ALL(V) (V).begin(), (V).end()
#define SORT(V) sort(ALL(V)) // 小さい方からソート
#define... | #pragma gcc optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define PER(i, n) for (int i = (n - 1); i >= 0; --i)
#define ALL(V) (V).begin(), (V).end()
#define SORT(V) sort(ALL(V)) // 小さい方からソート
#define... | replace | 192 | 194 | 192 | 194 | 0 | |
p03108 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <ve... | #include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <ve... | replace | 20 | 21 | 20 | 21 | 0 | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
const int maxn = 1500 + 5;
ll n1 = 0, n2 = 0;
ll root(ll arr[], ll a) {
while (arr[a] != a) {
arr[a] = arr[arr[a]];
a = arr[a];
}
return a;
}
void unioun(ll arr[], ll size[], ll a, ll b) {
int roota, rootb;
roota = root(arr, a);
... | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
const int maxn = 100000 + 5;
ll n1 = 0, n2 = 0;
ll root(ll arr[], ll a) {
while (arr[a] != a) {
arr[a] = arr[arr[a]];
a = arr[a];
}
return a;
}
void unioun(ll arr[], ll size[], ll a, ll b) {
int roota, rootb;
roota = root(arr, a);
... | replace | 3 | 4 | 3 | 4 | 0 | |
p03108 | Python | Runtime Error | N, M = [int(_) for _ in input().split()]
bridge = [[int(_) for _ in input().split()] for _ in range(M)]
bridge.reverse()
bridge = bridge[:-1]
inconvenience = N * (N - 1) // 2
inconvenience_history = [inconvenience]
class UnionFind:
def __init__(self, N):
self.par = [i for i in range(N + 1)]
self... | N, M = [int(_) for _ in input().split()]
bridge = [[int(_) for _ in input().split()] for _ in range(M)]
bridge.reverse()
bridge = bridge[:-1]
inconvenience = N * (N - 1) // 2
inconvenience_history = [inconvenience]
class UnionFind:
def __init__(self, N):
self.par = [i for i in range(N + 1)]
self... | delete | 47 | 49 | 47 | 47 | AttributeError: 'UnionFind' object has no attribute 'pri' | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03108/Python/s568431545.py", line 49, in <module>
islands.pri()
AttributeError: 'UnionFind' object has no attribute 'pri'
|
p03108 | 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;
// UnionFind
struct UnionFind {
vector<int> d;
UnionFind(int n = 0) : d(n, -1) {} // each node has "minus-size"
int find(int x) {
if (d[x] < 0)
return x;
return d[x] = find(d[x]);
}... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
// UnionFind
struct UnionFind {
vector<int> d;
UnionFind(int n = 0) : d(n, -1) {} // each node has "minus-size"
int find(int x) {
if (d[x] < 0)
return x;
return d[x] = find(d[x]);
}... | insert | 43 | 43 | 43 | 45 | 0 | |
p03108 | Python | Time Limit Exceeded | # -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**7)
class UnionFind:
def __init__(self, n):
# parent[x] < 0 means x is root and abs(parent[x]) == size[x]
self.parent, self.depth = [-1] * (n + 1), [0] * (n + 1)
def find(self, x):
if self.parent[x] < 0:
return ... | # -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**7)
class UnionFind:
def __init__(self, n):
# parent[x] < 0 means x is root and abs(parent[x]) == size[x]
self.parent, self.depth = [-1] * (n + 1), [0] * (n + 1)
def find(self, x):
if self.parent[x] < 0:
return ... | replace | 53 | 54 | 53 | 54 | TLE | |
p03108 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
vector<long long> dsu(100005), cnt(100005, 1);
long long parent(long long x) {
while (dsu[x] != x) {
x = dsu[x];
}
return x;
}
int main() {
srand(42);
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
long long n, m, a1, r1, r2;
cin >>... | #include <bits/stdc++.h>
using namespace std;
vector<long long> dsu(100005), cnt(100005, 1);
long long parent(long long x) {
while (dsu[x] != x) {
dsu[x] = dsu[dsu[x]];
x = dsu[x];
}
return x;
}
int main() {
srand(42);
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
long long ... | insert | 5 | 5 | 5 | 6 | TLE | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rp(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
class UnionFind {
public:
// 親の番号を格納する。親だった場合は-(その集合のサイズ)
vector<int> Parent;
// 作るときはParentの値を全て−1にする
// こうすると全てバラバラになる
UnionFind(int N) { Parent = vector<int>(N, -1); }... | #include <bits/stdc++.h>
#define rp(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
class UnionFind {
public:
// 親の番号を格納する。親だった場合は-(その集合のサイズ)
vector<int> Parent;
// 作るときはParentの値を全て−1にする
// こうすると全てバラバラになる
UnionFind(int N) { Parent = vector<int>(N, -1); }... | replace | 47 | 48 | 47 | 52 | 0 | |
p03108 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
#define all(v) (v).begin(), (v).end()
#define pb(a) push_back(a)
using namespace std;
typedef long long LL;
#define int long long
const LL INF = 999999999999;
struct UnionFind {
vector<int> data;... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
#define all(v) (v).begin(), (v).end()
#define pb(a) push_back(a)
using namespace std;
typedef long long LL;
#define int long long
const LL INF = 999999999999;
struct UnionFind {
vector<int> data;... | replace | 39 | 40 | 39 | 40 | 0 | |
p03108 | Python | Runtime Error | #!/usr/bin/env python3
import sys
try:
from typing import List
except ImportError:
pass
def solve(N: int, M: int, A: "List[int]", B: "List[int]"):
uf = list(range(N))
n = [1] * N
def getpar(a: int):
if a == uf[a]:
return a
uf[a] = getpar(uf[a])
return uf[a]
... | #!/usr/bin/env python3
import sys
try:
from typing import List
except ImportError:
pass
sys.setrecursionlimit(1000000)
def solve(N: int, M: int, A: "List[int]", B: "List[int]"):
uf = list(range(N))
n = [1] * N
def getpar(a: int):
if a == uf[a]:
return a
uf[a] = getp... | insert | 7 | 7 | 7 | 10 | 0 | |
p03108 | Python | Runtime Error | # -*- coding: utf-8 -*-
from scipy.misc import comb
import sys
sys.setrecursionlimit(10000000000)
class UnionFind:
def __init__(self, n):
self.parent = [i for i in range(n + 1)]
self.depth = [1] * (n + 1)
self.count = [1] * (n + 1)
def find(self, x):
if self.parent[x] == x:
... | # -*- coding: utf-8 -*-
from scipy.misc import comb
import sys
sys.setrecursionlimit(1000000000)
class UnionFind:
def __init__(self, n):
self.parent = [i for i in range(n + 1)]
self.depth = [1] * (n + 1)
self.count = [1] * (n + 1)
def find(self, x):
if self.parent[x] == x:
... | replace | 5 | 6 | 5 | 6 | ModuleNotFoundError: No module named 'scipy' | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03108/Python/s305348500.py", line 3, in <module>
from scipy.misc import comb
ModuleNotFoundError: No module named 'scipy'
|
p03108 | Python | Runtime Error | # -*- coding: utf-8 -*-
from scipy.misc import comb
import sys
sys.setrecursionlimit(1000000000)
class UnionFind:
def __init__(self, n):
# parent[x] < 0 means x is root and abs(parent[x]) == size[x]
self.parent, self.depth = [-1] * (n + 1), [0] * (n + 1)
def find(self, x):
if self.p... | # -*- coding: utf-8 -*-
from scipy.misc import comb
import sys
sys.setrecursionlimit(1000000000)
class UnionFind:
def __init__(self, n):
# parent[x] < 0 means x is root and abs(parent[x]) == size[x]
self.parent, self.depth = [-1] * (n + 1), [0] * (n + 1)
def find(self, x):
if self.p... | replace | 48 | 49 | 48 | 49 | ModuleNotFoundError: No module named 'scipy' | Traceback (most recent call last):
File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03108/Python/s430341119.py", line 3, in <module>
from scipy.misc import comb
ModuleNotFoundError: No module named 'scipy'
|
p03108 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <fstream>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
#define REP(i, m, n) for (int i = (m); i < (int)(n); i++)
#define RREP(i, m, n) fo... | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <fstream>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
#define REP(i, m, n) for (int i = (m); i < (int)(n); i++)
#define RREP(i, m, n) fo... | replace | 110 | 111 | 110 | 111 | 0 | |
p03108 | Python | Runtime Error | from collections import deque, Counter
class UnionFind:
def __init__(self, v):
self.v = v
self._tree = list(range(v + 1))
self._counter = Counter(self._tree)
def _root(self, a):
queue = deque()
while self._tree[a] != a:
queue.append(a)
a = self.... | from collections import deque, Counter
class UnionFind:
def __init__(self, v):
self.v = v
self._tree = list(range(v + 1))
self._counter = Counter(self._tree)
def _root(self, a):
queue = deque()
while self._tree[a] != a:
queue.append(a)
a = self.... | replace | 23 | 24 | 23 | 24 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.