QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#339836 | #7760. 化学实验 | ClHg2 | Compile Error | / | / | C++14 | 2.2kb | 2024-02-27 22:36:03 | 2024-02-27 22:36:04 |
Judging History
This is the latest submission verdict.
- [2024-02-27 22:36:04]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2024-02-27 22:36:03]
- Submitted
answer
#include <bits/stdc++.h>
#define FOR(i, l, r) for (int i = l; i < (r); ++i)
#define F0R(i, r) FOR (i, 0, r)
#define ROF(i, l, r) for (int i = r; i-- > (l);)
#define R0F(i, r) ROF (i, 0, r)
#define rep(n) F0R (_, n)
#define each(i, x) for (auto& i : x)
using namespace std;
using ll = long long;
using db = long double;
using str = string;
using pi = pair<int, int>;
#define mp make_pair
#define f first
#define s second
#define ttt template <typename T
ttt > using vec = vector<T>;
ttt, size_t n > using arr = array<T, n>;
using vi = vec<int>;
using vb = vec<bool>;
using vl = vec<ll>;
using vpi = vec<pi>;
#define sz(x) int((x).size())
#define all(x) begin(x), end(x)
#define rsz resize
#define pb push_back
#define eb emplace_back
#define il inline
ttt > il bool ckmin(T& x, const T& y) { return y < x ? x = y, true : false; }
ttt > il bool ckmax(T& x, const T& y) { return x < y ? x = y, true : false; }
struct Node {
int sz, lsz, mx, p, l, r;
};
struct Lct {
vec<Node> t;
Lct(int n) : t(n + 1) {}
bool is_rt(int o) const { return o != t[t[o].p].l && o != t[t[o].p].r; }
void pull(int o) {
t[o].sz = t[o].lsz + t[t[o].l].sz + t[t[o].r].sz;
t[o].mx = max({o, t[t[o].l].mx, t[t[o].r].mx});
}
void rot(int o) {
Node &x = t[o], &y = t[x.p];
if (o == y.l)
t[x.r].p = x.p, y.l = x.r, x.r = x.p;
else
t[x.l].p = x.p, y.r = x.l, x.l = x.p;
if (!is_rt(x.p)) (x.p == t[y.p].l ? t[y.p].l : t[y.p].r) = o;
pull(x.p), pull(o), x.p = y.p, y.p = o;
}
void splay(int o) {
for (; !is_rt(o); rot(o)) {
int p = t[o].p;
rot((o == t[p].l) == (p == t[t[p].p].l) ? p : o);
}
}
int access(int o) {
int p = 0;
for (; o; p = o, o = t[o].p)
t[o].lsz += t[p].sz - t[t[o].r].sz, t[o].r = p, pull(o);
return p;
}
int split(int o, int v) {
int p = -1, q = 0;
while ((q = o)) {
if (o >= v)
p = o, o = t[o].r;
else
o = t[o].l;
}
return splay(q), splay(p), p;
}
void unite(int o1, int o2) {
access(o1);
int p = access(o2);
if (o1 == p || o2 == p) return;
access(p), splay(o1), splay(o2);
p = split(o1, t[o2].mx);
}
};
Details
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x24): undefined reference to `main' collect2: error: ld returned 1 exit status