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
p02794
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { long N; cin >> N; vector<vector<pair<long, long>>> A(N); for (long i = 0; i < N - 1; i++) { long a, b; cin >> a >> b; A[a - 1].push_back(pair<long, long>(b - 1, i)); A[b - 1].push_back(pair<long, long>(a - 1, i)); } long M; cin >> ...
#include <bits/stdc++.h> using namespace std; int main() { long N; cin >> N; vector<vector<pair<long, long>>> A(N); for (long i = 0; i < N - 1; i++) { long a, b; cin >> a >> b; A[a - 1].push_back(pair<long, long>(b - 1, i)); A[b - 1].push_back(pair<long, long>(a - 1, i)); } long M; cin >> ...
replace
41
42
41
43
0
p02794
C++
Runtime Error
#include <bits/stdc++.h> #define watch(x) cout << (#x) << " is " << (x) << endl typedef long long ll; using namespace std; int static fast = []() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); return 0; }(); int main() { int n, m, a, b, src, dst; cin >> n; unordered_map<int, vector<int>> e; ma...
#include <bits/stdc++.h> #define watch(x) cout << (#x) << " is " << (x) << endl typedef long long ll; using namespace std; int static fast = []() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); return 0; }(); int main() { int n, m, a, b, src, dst; cin >> n; unordered_map<int, vector<int>> e; ma...
replace
28
30
28
30
0
p02794
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>; struct Edge { int to, id; Edge(int to, int id) : to(to), id(id) {} }; vector<Edge> g[55]; vector<int> es; bool dfs(int v, int tv, int p = -1) { if (v == tv) return t...
#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>; struct Edge { int to, id; Edge(int to, int id) : to(to), id(id) {} }; vector<Edge> g[55]; vector<int> es; bool dfs(int v, int tv, int p = -1) { if (v == tv) return t...
replace
30
31
30
31
0
p02794
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 50; const int BIT = (1 << 20); int n, m, d[N]; vector<int> g[N]; ll bit[BIT]; vector<int> v; void dfs_pre(int fa, int u, int src, int dest, int idx) { v.push_back(u); if (u == dest) { for (int i = 1; i < v.size(); i++) { int...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 52; const int BIT = (1 << 20); int n, m, d[N]; vector<int> g[N]; ll bit[BIT]; vector<int> v; void dfs_pre(int fa, int u, int src, int dest, int idx) { v.push_back(u); if (u == dest) { for (int i = 1; i < v.size(); i++) { int...
replace
3
4
3
4
0
p02794
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; typedef pair<int, int> Pi; typedef vector<ll> Vec; typedef vector<int> Vi; typedef vector<string> Vs; typedef vector<P> VP; typedef vector<vector<ll>> VV; typedef vector<vector<int>> VVi; #define REP(i, a, b) for (ll i = (a);...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; typedef pair<int, int> Pi; typedef vector<ll> Vec; typedef vector<int> Vi; typedef vector<string> Vs; typedef vector<P> VP; typedef vector<vector<ll>> VV; typedef vector<vector<int>> VVi; #define REP(i, a, b) for (ll i = (a);...
replace
202
203
202
204
TLE
p02794
C++
Runtime Error
#include <bits/stdc++.h> #define R register #define ll long long #define sum(a, b, mod) (((a) + (b)) % mod) const int MaxN = 5e5 + 10; const ll mod = 1ll << 62; struct edge { int next, to; }; edge e[MaxN << 1]; int n, m, cnt; int head[MaxN], f[MaxN], u[MaxN], v[MaxN]; std::bitset<510> q[25], t[1 << 16]; ll fast_...
#include <bits/stdc++.h> #define R register #define ll long long #define sum(a, b, mod) (((a) + (b)) % mod) const int MaxN = 5e5 + 10; const ll mod = 1ll << 62; struct edge { int next, to; }; edge e[MaxN << 1]; int n, m, cnt; int head[MaxN], f[MaxN], u[MaxN], v[MaxN]; std::bitset<510> q[25], t[1 << 20]; ll fast_...
replace
16
17
16
17
0
p02794
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define INF 1000000001 using ll = long long; using Graph = vector<vector<int>>; vector<pair<int, int>> ab; map<pair<int, int>, int> m; bool dfs(Graph &G, int v, int p, int g, ll &c) { for (auto nv : G.at(v)) { if (nv == p) { continue; } if (nv == g) { ...
#include <bits/stdc++.h> using namespace std; #define INF 1000000001 using ll = long long; using Graph = vector<vector<int>>; vector<pair<int, int>> ab; map<pair<int, int>, int> m; bool dfs(Graph &G, int v, int p, int g, ll &c) { for (auto nv : G.at(v)) { if (nv == p) { continue; } if (nv == g) { ...
replace
61
62
61
62
0
p02794
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef unsigned long ul; typedef unsigned long long ull; typedef long long ll; typedef vector<ll> vint; typedef vector<vector<ll>> vvint; typedef vector<vector<vector<ll>>> vvvint; typedef vector<string> vstring; typedef vector<vector<string>> vvstring; typedef vector<cha...
#include <bits/stdc++.h> using namespace std; typedef unsigned long ul; typedef unsigned long long ull; typedef long long ll; typedef vector<ll> vint; typedef vector<vector<ll>> vvint; typedef vector<vector<vector<ll>>> vvvint; typedef vector<string> vstring; typedef vector<vector<string>> vvstring; typedef vector<cha...
replace
425
432
425
430
0
p02794
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define REP(i, m, n) for (int i = (m); i < (int)(n); i++) #define RREP(i, m, n) for (int i = (int)(n - 1); i >= m; i--) #define rep(i, n) REP(i, 0, n) #define rrep(i, n) RREP(i, 0, n) #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() #define au...
#include <bits/stdc++.h> using namespace std; #define REP(i, m, n) for (int i = (m); i < (int)(n); i++) #define RREP(i, m, n) for (int i = (int)(n - 1); i >= m; i--) #define rep(i, n) REP(i, 0, n) #define rrep(i, n) RREP(i, 0, n) #define all(a) (a).begin(), (a).end() #define rall(a) (a).rbegin(), (a).rend() #define au...
replace
107
108
107
108
0
p02794
C++
Runtime Error
// Link : https://atcoder.jp/contests/abc152/tasks/abc152_f #include <bits/stdc++.h> using namespace std; #define ll long long #define N 51 #define M 8 vector<int> edge[N]; int a[N], b[N]; int anc[N]; int parEdge[N], depth[N]; void dfs(int node, int par) { for (int i = 0; i < edge[node].size(); ++i) { int eid...
// Link : https://atcoder.jp/contests/abc152/tasks/abc152_f #include <bits/stdc++.h> using namespace std; #define ll long long #define N 51 #define M 8 vector<int> edge[N]; int a[N], b[N]; int anc[N]; int parEdge[N], depth[N]; void dfs(int node, int par) { for (int i = 0; i < edge[node].size(); ++i) { int eid...
replace
30
31
30
31
0
p02794
C++
Runtime Error
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define fst first #define snd second using namespace std; typedef long long ll; typedef double db; typedef long double ldb; const int inf = 1e9 + 10; const int maxn = 55; ll dp[maxn]; int xx[maxn], n, m; vector<pair<int, int>> g[maxn]; bool dfs(int ...
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define fst first #define snd second using namespace std; typedef long long ll; typedef double db; typedef long double ldb; const int inf = 1e9 + 10; const int maxn = 55; ll dp[1 << 21]; int xx[maxn], n, m; vector<pair<int, int>> g[maxn]; bool dfs(i...
replace
14
15
14
15
0
p02794
C++
Runtime Error
#include <cstdio> #include <cstring> #include <iostream> #include <utility> #include <vector> using namespace std; typedef pair<int, int> ii; int n, m; vector<ii> al[100]; ii path[100]; bool onpath[100][100]; int depth[100]; int parent[100]; int edge[100]; void dfs(int i, int p) { for (auto &it : al[i]) { if ...
#include <cstdio> #include <cstring> #include <iostream> #include <utility> #include <vector> using namespace std; typedef pair<int, int> ii; int n, m; vector<ii> al[100]; ii path[100]; bool onpath[100][100]; int depth[100]; int parent[100]; int edge[100]; void dfs(int i, int p) { for (auto &it : al[i]) { if ...
replace
46
47
46
47
0
p02794
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; const int N = 55, M = 21; int n; vector<pair<int, int>> g[N]; int m; int pt[M]; bool prec(int st, int en, int id, int par = -1) { if (st == en) return true; for (auto p : g[st]) if (p.first != par) { if (prec(p.first, en, id, st))...
#include <bits/stdc++.h> using namespace std; using ll = long long; const int N = 55, M = 21; int n; vector<pair<int, int>> g[N]; int m; int pt[N]; bool prec(int st, int en, int id, int par = -1) { if (st == en) return true; for (auto p : g[st]) if (p.first != par) { if (prec(p.first, en, id, st))...
replace
10
11
10
11
-11
p02794
C++
Runtime Error
#include <bits/stdc++.h> int ri() { int n; scanf("%d", &n); return n; } #define MOD 1000000007 template <int mod> struct ModInt { int x; ModInt() : x(0) {} ModInt(long long y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {} ModInt &operator+=(const ModInt &p) { if ((x += p.x) >= mod) x -= ...
#include <bits/stdc++.h> int ri() { int n; scanf("%d", &n); return n; } #define MOD 1000000007 template <int mod> struct ModInt { int x; ModInt() : x(0) {} ModInt(long long y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {} ModInt &operator+=(const ModInt &p) { if ((x += p.x) >= mod) x -= ...
replace
135
136
135
137
0
p02794
C++
Runtime Error
#include <bits/stdc++.h> int ri() { int n; scanf("%d", &n); return n; } #define MOD 1000000007 template <int mod> struct ModInt { int x; ModInt() : x(0) {} ModInt(long long y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {} ModInt &operator+=(const ModInt &p) { if ((x += p.x) >= mod) x -= ...
#include <bits/stdc++.h> int ri() { int n; scanf("%d", &n); return n; } #define MOD 1000000007 template <int mod> struct ModInt { int x; ModInt() : x(0) {} ModInt(long long y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {} ModInt &operator+=(const ModInt &p) { if ((x += p.x) >= mod) x -= ...
replace
135
137
135
136
0
p02794
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; const int N = 50; vector<int> edges[N]; int tin[N], tout[N], timer, lca[N][N], p[N], add[N]; int ql[N], qr[N]; int n, m; void dfs(int v, int _p) { tin[v] = timer++; p[v] = _p; for (int u : edges[v]) { if (u == _p) continue; dfs(u, v); } tout[v] = ...
#include <bits/stdc++.h> using namespace std; const int N = 50; vector<int> edges[N]; int tin[N], tout[N], timer, lca[N][N], p[N], add[N]; int ql[N], qr[N]; int n, m; void dfs(int v, int _p) { tin[v] = timer++; p[v] = _p; for (int u : edges[v]) { if (u == _p) continue; dfs(u, v); } tout[v] = ...
replace
35
37
35
37
TLE
p02794
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using i64 = long long; #define rep(i, s, e) for (i64(i) = (s); (i) < (e); (i)++) #define rev(i, s, e) for (i64(i) = (s); (i)-- > (e);) #define all(x) x.begin(), x.end() template <class T> static inline std::vector<T> ndvec(size_t &&n, T val) noexcept { return std::vector...
#include <bits/stdc++.h> using namespace std; using i64 = long long; #define rep(i, s, e) for (i64(i) = (s); (i) < (e); (i)++) #define rev(i, s, e) for (i64(i) = (s); (i)-- > (e);) #define all(x) x.begin(), x.end() template <class T> static inline std::vector<T> ndvec(size_t &&n, T val) noexcept { return std::vector...
replace
31
32
31
32
0
p02794
C++
Runtime Error
#define HAVE_STRUCT_TIMESPEC #include <bits/stdc++.h> using namespace std; vector<pair<int, int>> v[57]; long long dp[1 << 20]; int x[57]; bool dfs(int a, int b, int c, int d) { if (a == c) return 1; for (auto it : v[a]) { if (it.first != b && dfs(it.first, a, c, d)) { x[it.second] ^= 1 << d; re...
#define HAVE_STRUCT_TIMESPEC #include <bits/stdc++.h> using namespace std; vector<pair<int, int>> v[57]; long long dp[1 << 20]; int x[57]; bool dfs(int a, int b, int c, int d) { if (a == c) return 1; for (auto it : v[a]) { if (it.first != b && dfs(it.first, a, c, d)) { x[it.second] ^= 1 << d; re...
replace
23
24
23
24
0
p02794
C++
Runtime Error
// #undef _DEBUG // #pragma GCC optimize("Ofast") // 不動小数点の計算高速化 // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace std::chrono; #define int long long...
// #undef _DEBUG // #pragma GCC optimize("Ofast") // 不動小数点の計算高速化 // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace std::chrono; #define int long long...
replace
7,721
7,722
7,721
7,722
0
p02794
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define ll long long #define pb push_back #define pii pair<int, int> #define mp make_pair #define fi first #define se second #define eb emplace_back using namespace std; const int mod = 1e9 + 7; const int maxn = 2e5 + 233; vector<int> g[maxn]; int f[maxn], u[maxn], v[maxn], d[maxn]; ll p[100]; ...
#include <bits/stdc++.h> #define ll long long #define pb push_back #define pii pair<int, int> #define mp make_pair #define fi first #define se second #define eb emplace_back using namespace std; const int mod = 1e9 + 7; const int maxn = 2e5 + 233; vector<int> g[maxn]; int f[maxn], u[maxn], v[maxn], d[maxn]; ll p[100]; ...
replace
14
15
14
15
TLE
p02794
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define _overload3(_1, _2, _3, name, ...) name #define _rep(i, n) repi(i, 0, n) #define repi(i, a, b) for (ll i = (a); i < (b); ++i) #define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__) #define ALL(x) x.begin(), x.end() #define chmax(x, y) x = max(x, y) #define chmin(x, y) x = mi...
#include <bits/stdc++.h> #define _overload3(_1, _2, _3, name, ...) name #define _rep(i, n) repi(i, 0, n) #define repi(i, a, b) for (ll i = (a); i < (b); ++i) #define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__) #define ALL(x) x.begin(), x.end() #define chmax(x, y) x = max(x, y) #define chmin(x, y) x = mi...
replace
175
178
175
177
TLE
p02795
C++
Runtime Error
#include <algorithm> #include <cctype> #include <cfloat> #include <climits> #include <cmath> #include <iomanip> #include <iostream> #include <string> #include <vector> #define PB push_back #define ll long long #define ull unsigned long long #define uint unsigned #define PIE (3.14159265358979323846) #define MOD 10000000...
#include <algorithm> #include <cctype> #include <cfloat> #include <climits> #include <cmath> #include <iomanip> #include <iostream> #include <string> #include <vector> #define PB push_back #define ll long long #define ull unsigned long long #define uint unsigned #define PIE (3.14159265358979323846) #define MOD 10000000...
replace
27
28
27
28
0
p02795
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long #define PI pair<int, int> #define ff first #define ss second #define boost \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) // #include "...
#include <bits/stdc++.h> using namespace std; #define int long long #define PI pair<int, int> #define ff first #define ss second #define boost \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) // #include "...
delete
13
17
13
13
0
p02795
C++
Time Limit Exceeded
#include <stdio.h> int main() { int h, w, k, omen; scanf("%d %d %d", &h, &w, &k); if (h > w) omen = h; int count = 1; for (int i = omen; i < k; i += omen) { count++; } printf("%d\n", count); return 0; }
#include <stdio.h> int main() { int h, w, k, omen; scanf("%d %d %d", &h, &w, &k); if (h > w) omen = h; else omen = w; int count = 1; for (int i = omen; i < k; i += omen) { count++; } printf("%d\n", count); return 0; }
insert
6
6
6
8
TLE
p02795
C++
Runtime Error
#define __USE_MINGW_ANSI_STDIO #define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> #include <unordered_map> #include <unordered_set> using namespace std; typedef long long ll; typedef long long ull; typedef pair<int, int> ii; #define all(v) ((v).begin()), ((v).end()) #define sz(v) ((int)((v).size())) #define en...
#define __USE_MINGW_ANSI_STDIO #define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> #include <unordered_map> #include <unordered_set> using namespace std; typedef long long ll; typedef long long ull; typedef pair<int, int> ii; #define all(v) ((v).begin()), ((v).end()) #define sz(v) ((int)((v).size())) #define en...
replace
22
30
22
30
0
p02795
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int m, h, w, n, ans = 0; int main() { cin >> h >> w >> n; if (h < w) swap(h, w); if (n <= h) { cout << "1"; return 0; } else { ans += n / h; n %= h; if (n % (h - ans) == 0) m = n / (h - ans); else m = n / (h - ans) + 1; }...
#include <bits/stdc++.h> using namespace std; int m, h, w, n, ans = 0; int main() { cin >> h >> w >> n; if (h < w) swap(h, w); if (n <= h) { cout << "1"; return 0; } else { ans += n / h; n %= h; if (n == 0) { cout << ans; return 0; } if (n % (h - ans) == 0) m...
insert
16
16
16
20
0
p02795
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define mod 1000000007 using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif ll int h, w, n, r, s, res = 0; cin >> h...
#include <bits/stdc++.h> #define ll long long #define mod 1000000007 using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ll int h, w, n, r, s, res = 0; cin >> h >> w >> n; r = max(h, w); s = min(h, w); while (n > 0) { n -= r; res++; } cout << ...
replace
9
13
9
10
0
p02795
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int H, W, N; cin >> H >> W >> N; cout << N / max(H, W) + N % (N / max(H, W) * max(H, W)) / min(H, W); }
#include <bits/stdc++.h> using namespace std; int main() { int H, W, N; cin >> H >> W >> N; if (N % (max(H, W)) == 0) { cout << N / max(H, W); } else { cout << N / (max(H, W)) + 1; } }
replace
5
6
5
10
0
p02795
C++
Runtime Error
#define _USE_MATH_DEFINES #include <bits/stdc++.h> #define ll long long #define pb push_back #define mp make_pair #define ff first #define ss second #define vi vector<int> #define br cout << "\n"; #define all(x) (x).begin(), (x).end() #define tr(c, i) for (auto i : c) #define pii pair<int, int> #define fast_io() ...
#define _USE_MATH_DEFINES #include <bits/stdc++.h> #define ll long long #define pb push_back #define mp make_pair #define ff first #define ss second #define vi vector<int> #define br cout << "\n"; #define all(x) (x).begin(), (x).end() #define tr(c, i) for (auto i : c) #define pii pair<int, int> #define fast_io() ...
replace
33
42
33
34
0
p02795
C++
Time Limit Exceeded
#include <cmath> #include <iostream> using namespace std; int main() { int h, w, n; cin >> h; cin >> w; cin >> n; int a = max(h, w); int count = 0; while (1) { if (n >= a) { n -= a; count++; } if (n <= 0) { break; } } cout << count << endl; return 0; }
#include <cmath> #include <iostream> using namespace std; int main() { int h, w, n; cin >> h; cin >> w; cin >> n; int a = max(h, w); int count = 0; while (1) { n -= a; count++; if (n <= 0) { break; } } cout << count << endl; return 0; }
replace
15
20
15
17
TLE
p02795
C++
Time Limit Exceeded
#include <iostream> int main() { int h; int w; int n; int paintNum = 0; std::cin >> h >> w >> n; while (n > 0) { if (w > h) { paintNum++; n -= w; } else if (h > w) { paintNum++; n -= h; } } std::cout << paintNum << std::endl; return 0; }
#include <iostream> int main() { int h; int w; int n; int paintNum = 0; std::cin >> h >> w >> n; while (n > 0) { if (w > h) { paintNum++; n -= w; } else { paintNum++; n -= h; } } std::cout << paintNum << std::endl; return 0; }
replace
12
13
12
13
TLE
p02795
C++
Time Limit Exceeded
#include <algorithm> #include <iostream> #include <math.h> #include <stdio.h> #include <string> using namespace std; int main() { int N, H, W, B; cin >> H; cin >> W; cin >> N; B = 0; int i; for (i = 0; B < N; i++) { if (W > H) { B += W; } if (H > W) { B += H; } } cout <<...
#include <algorithm> #include <iostream> #include <math.h> #include <stdio.h> #include <string> using namespace std; int main() { int N, H, W, B; cin >> H; cin >> W; cin >> N; B = 0; int i; for (i = 0; B < N; i++) { if (W > H) { B += W; } else { B += H; } } cout << i << endl...
replace
19
21
19
20
TLE
p02795
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; int main() { int h, w, n; cin >> h >> w >> n; int a = max(h, w); int k = n / a; if (n % k != 0) k++; cout << k << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int h, w, n; cin >> h >> w >> n; int a = max(h, w); if (n >= a) { int k = n / a; if (n % a != 0) k++; cout << k << endl; } else cout << 1 << endl; }
replace
6
10
6
13
0
p02795
C++
Runtime Error
/* LANG:C++ PROB: */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <functional> #include <iostream> #define mp make_pair #define mt make_tuple #define fi first #define se second #define pb push_back #define all(x) (x).begin(), (x).end() #define rall(x)...
/* LANG:C++ PROB: */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <functional> #include <iostream> #define mp make_pair #define mt make_tuple #define fi first #define se second #define pb push_back #define all(x) (x).begin(), (x).end() #define rall(x)...
replace
67
68
67
69
2
p02795
C++
Runtime Error
#define ll long long #define MOD 1000000007 #define mp make_pair #define pb push_back #define ff first #define ss second #define set2d(array, val, m, n) memset(array, val, sizeof(array[0][0]) * m * n); #include <bits/stdc++.h> using namespace std; ll gcd(ll a, ll b) { if (!b) return a; return gcd(b, a % b); } l...
#define ll long long #define MOD 1000000007 #define mp make_pair #define pb push_back #define ff first #define ss second #define set2d(array, val, m, n) memset(array, val, sizeof(array[0][0]) * m * n); #include <bits/stdc++.h> using namespace std; ll gcd(ll a, ll b) { if (!b) return a; return gcd(b, a % b); } l...
replace
35
39
35
39
0
Time elapsed: 29ms
p02796
Python
Time Limit Exceeded
N = int(input()) R = sorted([list(map(int, input().split())) for i in range(N)]) T = [] for i in range(N): T.append([R[i][0] + R[i][1], R[i][0] - R[i][1]]) T.sort() while len(T) - 1 > 0: t = T.pop(0) i = 1 while len(T) and t[0] > T[0][1]: N -= 1 i += 1 T.pop(0) print(N)
N = int(input()) X = [list(map(int, input().split())) for i in range(N)] LR = [[x[0] - x[1], x[0] + x[1]] for x in X] LR.sort(key=lambda x: x[1]) A = 1 right = LR[0][1] for i in range(1, N): if right <= LR[i][0]: A += 1 right = LR[i][1] print(A)
replace
1
14
1
12
TLE
p02796
Python
Time Limit Exceeded
#!/usr/bin/env python3 (n,), *r = [[*map(int, i.split())] for i in open(0)] s = sorted([[x + l, x - l] for x, l in r]) c = 0 p = 0 while s: c += 1 p = s[0][0] s = [i for i in s if i[1] >= p] print(c)
#!/usr/bin/env python3 (n,), *r = [[*map(int, i.split())] for i in open(0)] s = sorted([[x + l, x - l] for x, l in r]) c = 1 p = s[0][0] for i in s[1:]: if i[1] >= p: c += 1 p = i[0] print(c)
replace
3
9
3
9
TLE
p02796
C++
Runtime Error
/** * author : The San Cao (caothesan@gmail.com) * created : 2020.02.08 10:32:46 +07 */ #include <algorithm> #include <iostream> #include <utility> #include <vector> using namespace std; const int maxn = 1e5 + 10; int n; int t[maxn]; vector<pair<int, int>> robots; void update(int x, int v) { for (; x < m...
/** * author : The San Cao (caothesan@gmail.com) * created : 2020.02.08 10:32:46 +07 */ #include <algorithm> #include <iostream> #include <utility> #include <vector> using namespace std; const int maxn = 2e5 + 10; int n; int t[maxn]; vector<pair<int, int>> robots; void update(int x, int v) { for (; x < m...
replace
12
13
12
13
0
p02796
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; struct player { ll x; ll b; }; const int MAXN = 1100; player A[MAXN]; bool player_compare(player p1, player p2) { return (p1.x + p1.b) < (p2.x + p2.b); } int main() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); int n; cin >> ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; struct player { ll x; ll b; }; const int MAXN = 100100; player A[MAXN]; bool player_compare(player p1, player p2) { return (p1.x + p1.b) < (p2.x + p2.b); } int main() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); int n; cin >...
replace
9
10
9
10
0
p02796
C++
Runtime Error
#include <bits/stdc++.h> #define ll long long #define mod 1000000007 using namespace std; typedef pair<ll, ll> P; const ll INF = 1e18; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endi...
#include <bits/stdc++.h> #define ll long long #define mod 1000000007 using namespace std; typedef pair<ll, ll> P; const ll INF = 1e18; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ll int n, i; cin >> n; ll int x[n], l[n]; for (i = 0; i < n; i++) { cin >> x[i] >> l[i]...
delete
11
15
11
11
0
p02796
C++
Runtime Error
#include <algorithm> #include <cstring> #include <iostream> #include <math.h> #include <stdio.h> using namespace std; struct Meet { int beg; int end; int num; } meet[1000]; class setMeet { public: void init(); void solve(); private: int n, ans; }; void setMeet::init() { int s, e; cin >> n; int i; ...
#include <algorithm> #include <cstring> #include <iostream> #include <math.h> #include <stdio.h> using namespace std; struct Meet { int beg; int end; int num; } meet[100000]; class setMeet { public: void init(); void solve(); private: int n, ans; }; void setMeet::init() { int s, e; cin >> n; int i; ...
replace
10
11
10
11
0
p02796
C++
Time Limit Exceeded
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iterator> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; struct Sect { int L, R; int x, len; int size; }; Sect sects[100010]; int n; bool compare(const ...
#include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iterator> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; struct Sect { int L, R; int x, len; int size; }; Sect sects[100010]; int n; bool compare(const ...
replace
54
59
54
59
TLE
p02796
C++
Runtime Error
#include <algorithm> #include <cstdio> using namespace std; struct node { int s; int f; } a[1100]; int cmp(const node &x, const node &y) { return x.f < y.f; } int n; int main() { scanf("%d", &n); int x, y; for (int i = 1; i <= n; i++) { scanf("%d%d", &x, &y); int t = x, tt = y; x = t - tt; y =...
#include <algorithm> #include <cstdio> using namespace std; struct node { int s; int f; } a[110000]; int cmp(const node &x, const node &y) { return x.f < y.f; } int n; int main() { scanf("%d", &n); int x, y; for (int i = 1; i <= n; i++) { scanf("%d%d", &x, &y); int t = x, tt = y; x = t - tt; y...
replace
6
7
6
7
0
p02796
C++
Runtime Error
#include <algorithm> #include <climits> #include <cmath> #include <iostream> #include <math.h> #include <string> #include <tuple> #include <vector> using namespace std; int n, t = 0, ans = 0; const int MAX_N = 10000; pair<int, int> robo[MAX_N]; int main() { cin >> n; // vector<robop> robo(n); int p1, p2; for...
#include <algorithm> #include <climits> #include <cmath> #include <iostream> #include <math.h> #include <string> #include <tuple> #include <vector> using namespace std; int n, t = 0, ans = 0; const int MAX_N = 100000; pair<int, int> robo[MAX_N]; int main() { cin >> n; // vector<robop> robo(n); int p1, p2; fo...
replace
12
13
12
13
0
p02796
C++
Runtime Error
#include <bits/stdc++.h> #include <chrono> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; #define ordered_set \ tree<int, null_type, less<int>, rb_tree_tag, ...
#include <bits/stdc++.h> #include <chrono> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; #define ordered_set \ tree<int, null_type, less<int>, rb_tree_tag, ...
replace
81
82
81
82
0
p02796
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int N = 100010; int f[N], n, ans = 1, b[N], tot; // f[i]表示i必选的最大价值. struct node { int x, y; } a[N]; struct Tree { int l, r, dat; #define l(x) t[x].l #define r(x) t[x].r #define dat(x) t[x].dat } t[N << 3]; inline bool cmp(node x, node y) { return x.x < y.x; } inli...
#include <bits/stdc++.h> using namespace std; const int N = 100010; int f[N], n, ans = 1, b[N << 1], tot; // f[i]表示i必选的最大价值. struct node { int x, y; } a[N]; struct Tree { int l, r, dat; #define l(x) t[x].l #define r(x) t[x].r #define dat(x) t[x].dat } t[N << 3]; inline bool cmp(node x, node y) { return x.x < y.x; }...
replace
3
4
3
4
0
p02796
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int qmax(int a, int b) { return (a > b) ? a : b; } int n; int l[100100], r[100100]; vector<int> robot[100100]; int dp[200200]; map<int, int> mp; set<int> s; int main() { scanf("%d", &n); rep(i, n) { int x, L; scan...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int qmax(int a, int b) { return (a > b) ? a : b; } int n; int l[100100], r[100100]; vector<int> robot[200200]; int dp[200200]; map<int, int> mp; set<int> s; int main() { scanf("%d", &n); rep(i, n) { int x, L; scan...
replace
8
9
8
9
0
p02796
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; inline int read() { int n = 0; bool b = 1; char c = getchar(); while (c < '0' || c > '9') { if (c == '-') b = 0; c = getchar(); } while (c >= '0' && c <= '9') n = (n << 3) + (n << 1) + (c ^ 48), c = getchar(); return b ? n : -n; } struct dala...
#include <bits/stdc++.h> using namespace std; inline int read() { int n = 0; bool b = 1; char c = getchar(); while (c < '0' || c > '9') { if (c == '-') b = 0; c = getchar(); } while (c >= '0' && c <= '9') n = (n << 3) + (n << 1) + (c ^ 48), c = getchar(); return b ? n : -n; } struct dala...
replace
18
19
18
19
0
p02796
C++
Time Limit Exceeded
/** * Libraries */ #include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <unordered_map> #include <vector> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> using namespace std; /** * macros */ #define rep(...
/** * Libraries */ #include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <unordered_map> #include <vector> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> using namespace std; /** * macros */ #define rep(...
insert
94
94
94
95
TLE
p02796
C++
Runtime Error
#include <bits/stdc++.h> #define fi first #define se second #define mp make_pair #define ss(x) (int)x.size() #define pb push_back #define ll long long #define ld double #define cat(x) cerr << #x << " = " << x << endl #define FOR(i, n) for (int i = 0; i < n; ++i) #define DOW(i, n) for (int i = n - 1; 0 <= i; --i) #defin...
#include <bits/stdc++.h> #define fi first #define se second #define mp make_pair #define ss(x) (int)x.size() #define pb push_back #define ll long long #define ld double #define cat(x) cerr << #x << " = " << x << endl #define FOR(i, n) for (int i = 0; i < n; ++i) #define DOW(i, n) for (int i = n - 1; 0 <= i; --i) #defin...
replace
15
16
15
16
0
p02796
C++
Runtime Error
#include <algorithm> #include <iostream> using namespace std; struct line { int l, r; } a[101]; bool operator<(const line &a, const line &b) { return a.r < b.r; } int main() { int n, tot = 1; cin >> n; for (int i = 1, x, L; i <= n; i++) { cin >> x >> L; a[i].l = x - L; a[i].r = x + L; } sort(a ...
#include <algorithm> #include <iostream> using namespace std; struct line { int l, r; } a[100010]; bool operator<(const line &a, const line &b) { return a.r < b.r; } int main() { int n, tot = 1; cin >> n; for (int i = 1, x, L; i <= n; i++) { cin >> x >> L; a[i].l = x - L; a[i].r = x + L; } sort...
replace
6
7
6
7
0
p02796
C++
Runtime Error
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; struct node { int s, e; } list[40010]; bool cmp(node x, node y) { return x.e < y.e; } int main() { int n; while (~scanf("%d", &n)) { int x, l; for (int i = 0; i < n; i++) { scanf("%d %d", &x, &l); ...
#include <algorithm> #include <cstdio> #include <cstring> #include <iostream> using namespace std; struct node { int s, e; } list[100005]; bool cmp(node x, node y) { return x.e < y.e; } int main() { int n; while (~scanf("%d", &n)) { int x, l; for (int i = 0; i < n; i++) { scanf("%d %d", &x, &l); ...
replace
7
8
7
8
0
p02796
C++
Runtime Error
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() #define MOD 1000000007 using namespace std; bool compare(pair<int, int> a, pair<int, int> b) { return a.first < b.first; } int main() { int n; cin >> n; vector<pair<int, int>> arm(n); vector<pair<int, int>> range(n); for (int i = 0; i < n; i+...
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() #define MOD 1000000007 using namespace std; bool compare(pair<int, int> a, pair<int, int> b) { return a.first < b.first; } int main() { int n; cin >> n; vector<pair<int, int>> arm(n); vector<pair<int, int>> range(n); for (int i = 0; i < n; i+...
replace
25
27
25
29
0
p02796
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define rep(i, l, r) for (register int i = l; i <= r; i++) #define per(i, r, l) for (register int i = r; i >= l; i--) #define srep(i, l, r) for (register int i = l; i < r; i++) #define sper(i, r, l) for (register int i = r; i > l; i--) #define maxn 200020 #define ll long long int using namespac...
#include <bits/stdc++.h> #define rep(i, l, r) for (register int i = l; i <= r; i++) #define per(i, r, l) for (register int i = r; i >= l; i--) #define srep(i, l, r) for (register int i = l; i < r; i++) #define sper(i, r, l) for (register int i = r; i > l; i--) #define maxn 200020 #define ll long long int using namespac...
insert
27
27
27
28
TLE
p02796
C++
Runtime Error
#include <algorithm> #include <cstring> #include <ctype.h> #include <iostream> #include <map> #include <queue> #include <stack> #include <stdio.h> #include <string.h> #include <vector> using namespace std; struct aera { int start; int end; }; bool cmp(aera a, aera b) { if (a.end != b.end) return a.end < b....
#include <algorithm> #include <cstring> #include <ctype.h> #include <iostream> #include <map> #include <queue> #include <stack> #include <stdio.h> #include <string.h> #include <vector> using namespace std; struct aera { int start; int end; }; bool cmp(aera a, aera b) { if (a.end != b.end) return a.end < b....
replace
26
27
26
27
0
p02796
C++
Runtime Error
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int n; cin >> n; vector<pair<int, int>> xl(n); vector<pair<int, int>> state(n); for (int i = 0; i < n; i++) { cin >> xl[i].first >> xl[i].second; state[i].first = xl[i].firs...
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int n; cin >> n; vector<pair<int, int>> xl(n); vector<pair<int, int>> state(n); for (int i = 0; i < n; i++) { cin >> xl[i].first >> xl[i].second; state[i].first = xl[i].firs...
replace
20
21
20
21
0
p02796
C++
Time Limit Exceeded
#include <cmath> #include <iostream> #include <algorithm> #include <array> #include <limits> #include <queue> #include <unordered_set> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> x(n); vector<int> l(n); vector<tuple<int, int, int>> intervals(n); for (int i = 0; i < n;...
#include <cmath> #include <iostream> #include <algorithm> #include <array> #include <limits> #include <queue> #include <unordered_set> #include <vector> using namespace std; int main() { int n; cin >> n; vector<int> x(n); vector<int> l(n); vector<tuple<int, int, int>> intervals(n); for (int i = 0; i < n;...
replace
27
37
27
39
TLE
p02797
C++
Runtime Error
#define ll long long #define MOD 1000000007 #define mp make_pair #define pb push_back #define ff first #define ss second #define set2d(array, val, m, n) memset(array, val, sizeof(array[0][0]) * m * n); #include <bits/stdc++.h> using namespace std; ll gcd(ll a, ll b) { if (!b) return a; return gcd(b, a % b); } l...
#define ll long long #define MOD 1000000007 #define mp make_pair #define pb push_back #define ff first #define ss second #define set2d(array, val, m, n) memset(array, val, sizeof(array[0][0]) * m * n); #include <bits/stdc++.h> using namespace std; ll gcd(ll a, ll b) { if (!b) return a; return gcd(b, a % b); } l...
replace
35
39
35
39
TLE
p02797
C++
Runtime Error
#include <bits/stdc++.h> #include <unistd.h> using namespace std; using i64 = std::int64_t; namespace io { constexpr int is = 1 << 17; char ib[is], *ip = ib + is, it; inline char getc() { if (ip == ib + is) { read(STDIN_FILENO, ib, is); ip = ib; } return *ip++; } inline i64 scan() { i64 r = 0; if (i...
#include <bits/stdc++.h> #include <unistd.h> using namespace std; using i64 = std::int64_t; namespace io { constexpr int is = 1 << 17; char ib[is], *ip = ib + is, it; inline char getc() { if (ip == ib + is) { read(STDIN_FILENO, ib, is); ip = ib; } return *ip++; } inline i64 scan() { i64 r = 0; if (i...
replace
58
59
58
59
0
p02797
C++
Runtime Error
#include <bits/stdc++.h> #include <unistd.h> char buf[1000000]; signed main() { int n, k; char s[11]; scanf("%d %d %s", &n, &k, s); char *p = buf; size_t len = strlen(s); s[len++] = ' '; int i = 0; for (; i < k; i++) { strcpy(p, s); p += len; } for (; i < n; i++) { strcpy(p, "7 "); ...
#include <bits/stdc++.h> #include <unistd.h> char buf[1000000]; signed main() { int n, k; char s[11]; scanf("%d %d %s", &n, &k, s); char *p = buf; size_t len = strlen(s); s[len++] = ' '; int i = 0; for (; i < k; i++) { strcpy(p, s); p += len; if (p - buf > 10000) { write(STDOUT_FILENO...
insert
15
15
15
19
0
p02797
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; #define rep(i, a, b) for (int i = a; i < b; i++) #define per(i, a, b) for (int i = b - 1; i >= a; i--) #define ifor(n) for (int i = 0; i < n; i++) #define jfor(n) for (int j = 0; j < n; j++) #define Ifor(n) for (int i = ...
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; typedef long long ll; #define rep(i, a, b) for (int i = a; i < b; i++) #define per(i, a, b) for (int i = b - 1; i >= a; i--) #define ifor(n) for (int i = 0; i < n; i++) #define jfor(n) for (int j = 0; j < n; j++) #define Ifor(n) for (int i = ...
replace
14
26
14
23
TLE
p02797
C++
Runtime Error
#include <bits/stdc++.h> #define FIXED_FLOAT(x) std::fixed << std::setprecision(2) << (x) #define what_is(x) cerr << #x << " is " << x << endl; #define error(args...) \ { \ string _s ...
#include <bits/stdc++.h> #define FIXED_FLOAT(x) std::fixed << std::setprecision(2) << (x) #define what_is(x) cerr << #x << " is " << x << endl; #define error(args...) \ { \ string _s ...
replace
55
58
55
62
0
p02797
C++
Runtime Error
#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> using namespace std; #define int long long // 禁忌 using ll = long long; using lld = long double; #define P pair<ll, ll> #define Vi vector<ll> #define VVi vector<vector<ll>> #define Vd vector<double> #defi...
#include <bits/stdc++.h> using namespace std; #define int long long // 禁忌 using ll = long long; using lld = long double; #define P pair<ll, ll> #define Vi vector<ll> #define VVi vector<vector<ll>> #define Vd vector<double> #define Vb vector<bool> #define Vs vector<string> #define Vc vector<char> #define M map<ll, ll> ...
delete
0
3
0
0
0
p02797
C++
Runtime Error
#define __mode_debug__ /* ξ ll _ll_ / ∞ \ │* A *│ │* C *│ │* 祈 *│ │* 願 *│ │* *│  ̄ ̄ ̄ ̄ ̄ */ // C++14 (GCC 5.4.1) #include <bits/stdc++.h> using namespace std; #ifdef __mode_debug__ #define DBG #else #define DBG if (false) #endif #define LLINF (1LL << 60) using ll = long long; #define mod (1e...
#define __mode_debug__ /* ξ ll _ll_ / ∞ \ │* A *│ │* C *│ │* 祈 *│ │* 願 *│ │* *│  ̄ ̄ ̄ ̄ ̄ */ // C++14 (GCC 5.4.1) #include <bits/stdc++.h> using namespace std; #ifdef __mode_debug__ #define DBG #else #define DBG if (false) #endif #define LLINF (1LL << 60) using ll = long long; #define mod (1e...
replace
133
151
133
139
0
p02797
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define inf INT_MAX #define INF LLONG_MAX #define ll long long #define ull unsigned long long #define M (int)(1e9 + 7) #define P pair<int, int> #define FOR(i, m, n) for (int i = (int)m; i < (int)n; i++) #define RFOR(i, m, n) for (int i = (int)m; i >= (int)n; i--) #define ...
#include <bits/stdc++.h> using namespace std; #define inf INT_MAX #define INF LLONG_MAX #define ll long long #define ull unsigned long long #define M (int)(1e9 + 7) #define P pair<int, int> #define FOR(i, m, n) for (int i = (int)m; i < (int)n; i++) #define RFOR(i, m, n) for (int i = (int)m; i >= (int)n; i--) #define ...
replace
39
40
39
47
0
p02797
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; int main() { int n, k, s; cin >> n >> k >> s; // 4 2 3 // 1 1 1 1 // 5 3 100 // 100 100 100 1 1 vector<int> ans; for (int i = 0; i < k; ++i) { ans.push_back(s); } int tmp = s; while (!(1 <= tmp && tmp <= 1e9) or tmp == s) ++tmp; for (int ...
#include <bits/stdc++.h> using namespace std; int main() { int n, k, s; cin >> n >> k >> s; // 4 2 3 // 1 1 1 1 // 5 3 100 // 100 100 100 1 1 vector<int> ans; for (int i = 0; i < k; ++i) { ans.push_back(s); } int tmp = s; while (!(1 <= tmp && tmp <= 1e9) or tmp == s) tmp = (tmp + 1) % ...
replace
19
20
19
20
TLE
p02797
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define M 1000000007 #define pb emplace_back #define f first #define s second #define rep(i, st, ed) for (ll i = st; i < ed; ++i) #define repn(i, st, ed) for (ll i = st; i <= ed; ++i) #define repb(i, ed, st) for (ll i = ed; i >= st; --i) #define all(v) v.begin(), v.end() ...
#include <bits/stdc++.h> using namespace std; #define M 1000000007 #define pb emplace_back #define f first #define s second #define rep(i, st, ed) for (ll i = st; i < ed; ++i) #define repn(i, st, ed) for (ll i = st; i <= ed; ++i) #define repb(i, ed, st) for (ll i = ed; i >= st; --i) #define all(v) v.begin(), v.end() ...
replace
118
131
118
124
0
p02797
Python
Runtime Error
def prime_decomposition(n): ret = set() x = n divisor = 2 while x % divisor == 0: x //= divisor ret.add(divisor) divisor = 3 while divisor * divisor <= n: while x % divisor == 0: x //= divisor ret.add(divisor) divisor += 2 if x > 1:...
def prime_decomposition(n): ret = set() x = n divisor = 2 while x % divisor == 0: x //= divisor ret.add(divisor) divisor = 3 while divisor * divisor <= n: while x % divisor == 0: x //= divisor ret.add(divisor) divisor += 2 if x > 1:...
replace
30
31
30
34
0
p02797
Python
Runtime Error
from sys import stdin N, K, S = [int(x) for x in stdin.readline().rstrip().split()] ans = [S] * K n = (N - K) // (S - 1) ans.extend([S + 1] * (N - K)) print(*ans)
from sys import stdin N, K, S = [int(x) for x in stdin.readline().rstrip().split()] ans = [S] * K if S == 10**9: ans.extend([1] * (N - K)) else: ans.extend([S + 1] * (N - K)) print(*ans)
replace
5
7
5
9
0
p02797
Python
Runtime Error
N, K, S = map(int, input().split()) M = 1_000_000_000 _S = M - 1 if S == M else M print(" ".join(list(map(str, [S] * K + [_S] * (N - K)))))
N, K, S = map(int, input().split()) M = 1000000000 _S = M - 1 if S == M else M print(" ".join(list(map(str, [S] * K + [_S] * (N - K)))))
replace
2
3
2
3
0
p02797
C++
Runtime Error
#include <bits/stdc++.h> #define pb push_back #define INF (ll)1e9 using namespace std; using ll = long long; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); ll n, k, s; cin >> n >> k >> s; vector<ll> ans; ll left, right; if (k == n) { while (k--) { ans.pb(s); } for (ll i...
#include <bits/stdc++.h> #define pb push_back #define INF (ll)1e9 using namespace std; using ll = long long; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); ll n, k, s; cin >> n >> k >> s; vector<ll> ans; ll left, right; if (k == n) { while (k--) { ans.pb(s); } for (ll i...
insert
31
31
31
40
0
p02797
C++
Runtime Error
/** * author : The San Cao (caothesan@gmail.com) * created : 2020.02.08 11:01:47 +07 */ #include <algorithm> #include <iostream> #include <utility> #include <vector> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(NULL); int n, k, s; cin >> n >> k >> s; vector<int> result(k ...
/** * author : The San Cao (caothesan@gmail.com) * created : 2020.02.08 11:01:47 +07 */ #include <algorithm> #include <iostream> #include <utility> #include <vector> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(NULL); int n, k, s; cin >> n >> k >> s; for (int i = 0; i < n...
replace
17
26
17
19
0
p02797
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define int long long int mt19937 rng(std::chrono::duration_cast<std::chrono::nanoseconds>( chrono::high_resolution_clock::now().time_since_epoch()) .count()); #define mp make_pair #define pb push_back #define F first #define S second const i...
#include <bits/stdc++.h> using namespace std; #define int long long int mt19937 rng(std::chrono::duration_cast<std::chrono::nanoseconds>( chrono::high_resolution_clock::now().time_since_epoch()) .count()); #define mp make_pair #define pb push_back #define F first #define S second const i...
delete
30
35
30
30
-11
p02797
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n, k, s; cin >> n >> k >> s; ll a[n]; for (int i = 0; i < k; i++) { a[i] = s; } ll temp = s / (n - k); if (temp > 1) temp = 1; else temp = 10; for (int i = k; i < n; i++) { a[i] = temp; } for (int i...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n, k, s; cin >> n >> k >> s; ll a[n]; for (int i = 0; i < k; i++) { a[i] = s; } ll temp = 1000000000; if (s == temp) temp = 999999999; for (int i = k; i < n; i++) { a[i] = temp; } for (int i = 0; i < n; ...
replace
10
15
10
14
0
p02797
C++
Runtime Error
#include <algorithm> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <memory> #include <queue> #include <set> #include <sstream> #include <stack> #include...
#include <algorithm> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <functional> #include <iostream> #include <map> #include <memory> #include <queue> #include <set> #include <sstream> #include <stack> #include...
replace
48
49
48
50
0
p02797
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define repr(i, n) for (int i = (n); i >= 0; --i) #define FOR(i, m, n) for (int i = (m); i < (n); ++i) #define FORR(i, m, n) for (int i = (m); i >= (n); --i) #define equals(a, b) (fabs((a) - (b)) < EPS) using namespace std; typedef long long ll; c...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define repr(i, n) for (int i = (n); i >= 0; --i) #define FOR(i, m, n) for (int i = (m); i < (n); ++i) #define FORR(i, m, n) for (int i = (m); i >= (n); --i) #define equals(a, b) (fabs((a) - (b)) < EPS) using namespace std; typedef long long ll; c...
replace
14
16
14
16
0
p02797
C++
Runtime Error
#include <bits/stdc++.h> #define For(i, a, b) for (int(i) = (a); (i) < (b); ++(i)) #define rFor(i, a, b) for (int(i) = (a)-1; (i) >= (b); --(i)) #define rep(i, n) For((i), 0, (n)) #define rrep(i, n) rFor((i), (n), 0) #define fi first #define se second using namespace std; typedef long long lint; typedef unsigned long l...
#include <bits/stdc++.h> #define For(i, a, b) for (int(i) = (a); (i) < (b); ++(i)) #define rFor(i, a, b) for (int(i) = (a)-1; (i) >= (b); --(i)) #define rep(i, n) For((i), 0, (n)) #define rrep(i, n) rFor((i), (n), 0) #define fi first #define se second using namespace std; typedef long long lint; typedef unsigned long l...
replace
36
50
36
39
0
p02797
Python
Runtime Error
import sys import numpy as np read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(500000) N, K, S = map(int, read().split()) S_half = [S // 2, S - S // 2] ans = [] for _ in range(N // 2 + 1): ans += S_half ans = np.array(ans[:N]) i = 0 c...
import sys import numpy as np read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(500000) N, K, S = map(int, read().split()) if S != 1: ans = [S - 1] * N else: ans = [S + 1] * N for i in range(K): ans[i] = S print(*ans)
replace
10
31
10
16
TLE
p02797
C++
Runtime Error
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; signed main(void) { int n, m, k, s; cin >> n >> k >> s; vector<int> v; rep(i, k) { v.push_back(s); } m = n - k; v.erase(v.begin()); rep(i, m) { v.push_back(1); } v.push_back(s - m); sort(v.begin(), v.end());...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; signed main(void) { int n, m, k, s; cin >> n >> k >> s; vector<int> v; rep(i, k) { v.push_back(s); } if (s < 1000000000) { rep(i, n - k) v.push_back(s + 1); } else { rep(i, n - k) v.push_back(1); } rep...
replace
9
14
9
14
0
p02798
C++
Time Limit Exceeded
#include <cassert> #include <cstdio> #include <cstdlib> #include <iomanip> #include <iostream> #include <algorithm> #include <cmath> #include <functional> #include <bitset> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <unordered_map> #include <unordered_s...
#include <cassert> #include <cstdio> #include <cstdlib> #include <iomanip> #include <iostream> #include <algorithm> #include <cmath> #include <functional> #include <bitset> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <unordered_map> #include <unordered_s...
insert
307
307
307
310
TLE
p02798
C++
Time Limit Exceeded
#include <bits/stdc++.h> using namespace std; using lint = long long; const lint mod = 1e9 + 7; #define all(x) (x).begin(), (x).end() #define bitcount(n) __builtin_popcountl((lint)(n)) #define fcout cout << fixed << setprecision(15) #define highest(x) (63 - __builtin_clzl(x)) #define rep(i, n) for (int i = 0; i < n; i+...
#include <bits/stdc++.h> using namespace std; using lint = long long; const lint mod = 1e9 + 7; #define all(x) (x).begin(), (x).end() #define bitcount(n) __builtin_popcountl((lint)(n)) #define fcout cout << fixed << setprecision(15) #define highest(x) (63 - __builtin_clzl(x)) #define rep(i, n) for (int i = 0; i < n; i+...
replace
156
157
156
157
TLE
p02798
C++
Runtime Error
/*** author: yuji9511 ***/ #include <bits/stdc++.h> using namespace std; using ll = long long; using lpair = pair<ll, ll>; const ll MOD = 1e9 + 7; const ll INF = 1e18; #define rep(i, m, n) for (ll i = (m); i < (n); i++) #define rrep(i, m, n) for (ll i = (m); i >= (n); i--) #define printa(x, n) ...
/*** author: yuji9511 ***/ #include <bits/stdc++.h> using namespace std; using ll = long long; using lpair = pair<ll, ll>; const ll MOD = 1e9 + 7; const ll INF = 1e18; #define rep(i, m, n) for (ll i = (m); i < (n); i++) #define rrep(i, m, n) for (ll i = (m); i >= (n); i--) #define printa(x, n) ...
insert
73
73
73
77
0
p02798
C++
Runtime Error
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <memory> #include <numeric> #include <queue> #include <set> #include <...
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <memory> #include <numeric> #include <queue> #include <set> #include <...
replace
74
76
74
75
-6
f1bfa46b-4be9-44f4-8984-40112c55b262.out: /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02798/C++/s747951614.cpp:73: int main(): Assertion `ans%2==0' failed.
p02798
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) int n, a[2][20], ans = 1e9; int main() { scanf("%d", &n); rep(o, 2) rep(i, n) scanf("%d", a[o] + i); rep(bt, 1 << n) { int rev[20] = {}, c[] = {-1, -2}; bool ok = true; vector<int> v[51]; rep(i, n) v[a[bt...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) int n, a[2][20], ans = 1e9; int main() { scanf("%d", &n); rep(o, 2) rep(i, n) scanf("%d", a[o] + i); rep(bt, 1 << n) { int rev[40] = {}, c[] = {-2, -1}; bool ok = true; vector<int> v[51]; rep(i, n) v[a[bt...
replace
8
9
8
9
0
p02798
C++
Time Limit Exceeded
#include <bits/stdc++.h> #define long long long using namespace std; const int N = 1e6, inf = 1e9; int aa[18 + 2], bb[18 + 2], dp[18 + 2][2][(1 << 18) + 2], n, pre[18 + 2][(1 << 18) + 2]; inline int dfs(int last, int f, int msk) { if (msk == (1 << n) - 1) return 0; if (dp[last][f][msk] != -1) return dp[...
#include <bits/stdc++.h> #define long long long using namespace std; const int N = 1e6, inf = 1e9; int aa[18 + 2], bb[18 + 2], dp[18 + 2][2][(1 << 18) + 2], n, pre[18 + 2][(1 << 18) + 2]; inline int dfs(int last, int f, int msk) { if (msk == (1 << n) - 1) return 0; if (dp[last][f][msk] != -1) return dp[...
replace
28
29
28
29
TLE
p02798
C++
Time Limit Exceeded
#pragma GCC optimize("Ofast,inline,unroll-loops,fast-math") #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <memory> #include <queue> #include <random> #include <set> #include <ss...
#pragma GCC optimize("Ofast,inline,unroll-loops,fast-math") #include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <list> #include <map> #include <memory> #include <queue> #include <random> #include <set> #include <ss...
insert
46
46
46
52
TLE
p02798
C++
Time Limit Exceeded
#include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <complex> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> #include <casser...
#include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <complex> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> #include <casser...
delete
74
76
74
74
TLE
p02798
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll MOD = 1e9 + 7; const ll INF = 1e18; vector<ll> A, B; ll n; ll cnt(vector<ll> P, ll x) { vector<pair<ll, ll>> odd, even, U(n); ll ret = 0; for (ll i = 0; i < n; i++) { // iが偶数番目でそのカードが表で終わると決めた or // iが奇数番目でそのカードが裏で終わると決めた ...
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll MOD = 1e9 + 7; const ll INF = 1e18; vector<ll> A, B; ll n; ll cnt(vector<ll> P, ll x) { vector<pair<ll, ll>> odd, even, U(n); ll ret = 0; for (ll i = 0; i < n; i++) { // iが偶数番目でそのカードが表で終わると決めた or // iが奇数番目でそのカードが裏で終わると決めた ...
replace
25
26
25
27
0
p02798
C++
Time Limit Exceeded
#define _USE_MATH_DEFINES #include <algorithm> #include <climits> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; int A[18]; int B[18]; int dp[1 << 18][1...
#define _USE_MATH_DEFINES #include <algorithm> #include <climits> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; int A[18]; int B[18]; int dp[1 << 18][1...
insert
79
79
79
82
TLE
p02798
C++
Time Limit Exceeded
#define DEBUG 0 #include <bits/stdc++.h> #define loop(n) \ for (lint ngtkana_is_a_genius = 0; ngtkana_is_a_genius < lint(n); \ ngtkana_is_a_genius++) #define rep(i, begin, end) for (lint i = lint(begin); (i) < lint(end); i++) #define all...
#define DEBUG 0 #include <bits/stdc++.h> #define loop(n) \ for (lint ngtkana_is_a_genius = 0; ngtkana_is_a_genius < lint(n); \ ngtkana_is_a_genius++) #define rep(i, begin, end) for (lint i = lint(begin); (i) < lint(end); i++) #define all...
replace
322
323
322
327
TLE
p02798
C++
Runtime Error
#include <bits/stdc++.h> #define MOD 1000000007LL using namespace std; typedef long long ll; typedef pair<int, int> P; int n; int a[51], b[51]; int dp[1 << 18][51]; int INF = 1 << 25; int main(void) { scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%d", &a[i]); } for (int i = 0; i < n; i++) { sc...
#include <bits/stdc++.h> #define MOD 1000000007LL using namespace std; typedef long long ll; typedef pair<int, int> P; int n; int a[51], b[51]; int dp[1 << 18][51]; int INF = 1 << 25; int main(void) { scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%d", &a[i]); } for (int i = 0; i < n; i++) { sc...
replace
19
20
19
20
0
p02798
C++
Runtime Error
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <cmath> #include <ctime> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_set> #include <utility> #include <vector> using namesp...
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <cmath> #include <ctime> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_set> #include <utility> #include <vector> using namesp...
replace
187
188
187
188
0
p02799
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (ll(i) = (0); (i) < (n); ++i) #define REV(i, n) for (ll(i) = (n)-1; (i) >= 0; --i) #define PB push_back #define EB emplace_back #define MP make_pair #define FI first #define SE second #define SHOW1d(v, n) ...
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for (ll(i) = (0); (i) < (n); ++i) #define REV(i, n) for (ll(i) = (n)-1; (i) >= 0; --i) #define PB push_back #define EB emplace_back #define MP make_pair #define FI first #define SE second #define SHOW1d(v, n) ...
replace
87
89
87
89
0
p02799
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> pii; #define pb push_back #define mp make_pair #define fi first #define se second #define sz(a) int(a.size()) const int N = 1e5 + 10; int gi() { int x = 0, o = 1; char ch = getchar(); while ((ch < '...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> pii; #define pb push_back #define mp make_pair #define fi first #define se second #define sz(a) int(a.size()) const int N = 2e5 + 10; int gi() { int x = 0, o = 1; char ch = getchar(); while ((ch < '...
replace
10
11
10
11
0
p02799
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<ll, ll> P; #define fi first #define se second #define repl(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++) #define rep(i, n) repl(i, 0, n) #define all(x) (x).begin(), (x).end() #define dbg(x) cout << #x "=...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<ll, ll> P; #define fi first #define se second #define repl(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++) #define rep(i, n) repl(i, 0, n) #define all(x) (x).begin(), (x).end() #define dbg(x) cout << #x "=...
replace
30
33
30
33
0
p02799
C++
Runtime Error
// #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
141
142
141
142
-6
a361971e-bfaf-4f3f-81cf-c43749f0a1cf.out: /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02799/C++/s352175599.cpp:161: int main(): Assertion `ans[i] > 0' failed.
p02799
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; const int MAXN = 100010; int n, m; int a[MAXN]; vector<int> g[MAXN]; pair<int, int> edges[MAXN]; string ansS; map<pair<int, int>, int> ansC; int visited[MAXN]; int dfs(int v, int cost, int color) { ansS[v] = (color ? 'B' : 'W'); visited[v] = 1; int found = 0; ...
#include <bits/stdc++.h> using namespace std; const int MAXN = 200010; int n, m; int a[MAXN]; vector<int> g[MAXN]; pair<int, int> edges[MAXN]; string ansS; map<pair<int, int>, int> ansC; int visited[MAXN]; int dfs(int v, int cost, int color) { ansS[v] = (color ? 'B' : 'W'); visited[v] = 1; int found = 0; ...
replace
4
5
4
5
0
p02799
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) struct edge { ll to; ll cost, num; edge() {} edge(ll to, ll cost, ll num) : to(to), cost(cost), num(num){}; }; int main() { ll n, m; cin >> n >> m; vector<vector<edge>> g(n); vector<vec...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) struct edge { ll to; ll cost, num; edge() {} edge(ll to, ll cost, ll num) : to(to), cost(cost), num(num){}; }; int main() { ll n, m; cin >> n >> m; vector<vector<edge>> g(n); vector<vec...
replace
35
36
35
36
0
p02799
C++
Runtime Error
#include "bits/stdc++.h" using namespace std; #define FAST \ ios_base::sync_with_stdio(false); \ cin.tie(0); #define pb push_back #define eb emplace_back #define ins insert #define f first #define s second ...
#include "bits/stdc++.h" using namespace std; #define FAST \ ios_base::sync_with_stdio(false); \ cin.tie(0); #define pb push_back #define eb emplace_back #define ins insert #define f first #define s second ...
replace
43
44
43
44
0
p02799
C++
Runtime Error
#include <bits/stdc++.h> using namespace std; using ll = long long; mt19937 mt(736); class dsu { vector<int> par, siz; public: dsu(int n) : par(n, -1), siz(n, 1) {} int get_par(int v) { return par[v] == -1 ? v : get_par(par[v]); } bool unite(int a, int b) { a = get_par(a); b = get_par(b); if...
#include <bits/stdc++.h> using namespace std; using ll = long long; mt19937 mt(736); class dsu { vector<int> par, siz; public: dsu(int n) : par(n, -1), siz(n, 1) {} int get_par(int v) { return par[v] == -1 ? v : get_par(par[v]); } bool unite(int a, int b) { a = get_par(a); b = get_par(b); if...
replace
115
117
115
119
0