#include <bits/stdc++.h>
using namespace std;
namespace {
template <typename Fun>
struct YCombinator {
template <typename T>
YCombinator(T &&_fun) : fun(forward<T>(_fun)) {}
template <typename... Args>
decltype(auto) operator()(Args &&...args) {
return fun(ref(*this), forward<Args>(args)...);
}
private:
Fun fun;
};
template <typename T>
YCombinator(T &&) -> YCombinator<decay_t<T>>;
struct DSU {
DSU(int n) : e(n, -1) {}
int find(int x) {
return e[x] < 0 ? x : e[x] = find(e[x]);
}
bool same(int x, int y) {
return find(x) == find(y);
}
bool unite(int x, int y) {
x = find(x);
y = find(y);
if (x == y) {
return false;
}
if (e[x] > e[y]) {
swap(x, y);
}
e[x] += e[y];
e[y] = x;
return true;
}
int size(int x) {
return -e[find(x)];
}
int size() const {
return (int)e.size();
}
private:
vector<int> e;
};
} // namespace
void solve() {
int n, m;
cin >> n >> m;
vector<vector<pair<int, int>>> adj(n);
DSU dsu1(n), dsu2(n);
// for (int i = 0; i < m; i++) {
// int u, v;
// cin >> u >> v;
// --u;
// --v;
// if (dsu1.unite(u, v) || dsu2.unite(u, v)) {
// adj[u].emplace_back(v, i);
// adj[v].emplace_back(u, i);
// }
// }
{
// vector<int> tin(n, -1), low(n);
// int timer = 0;
// YCombinator([&](auto self, int u, int p) -> void {
// tin[u] = timer++;
// low[u] = tin[u];
// for (int v : adj[u]) {
// if (tin[v] == -1) {
// self(v, u);
// } else {
// }
// }
// })(0, -1);
}
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
solve();
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Wrong number of edges |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
608 KB |
Wrong number of edges |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
1 ms |
344 KB |
Wrong number of edges |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
604 KB |
Output is correct |
2 |
Incorrect |
1 ms |
604 KB |
Wrong number of edges |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
1112 KB |
Output is correct |
2 |
Incorrect |
1 ms |
1372 KB |
Wrong number of edges |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2552 KB |
Output is correct |
2 |
Incorrect |
1 ms |
2652 KB |
Wrong number of edges |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
2908 KB |
Output is correct |
2 |
Incorrect |
2 ms |
2904 KB |
Wrong number of edges |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
3420 KB |
Output is correct |
2 |
Incorrect |
2 ms |
3420 KB |
Wrong number of edges |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
3440 KB |
Output is correct |
2 |
Incorrect |
2 ms |
3420 KB |
Wrong number of edges |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
3280 KB |
Output is correct |
2 |
Incorrect |
1 ms |
3420 KB |
Wrong number of edges |
3 |
Halted |
0 ms |
0 KB |
- |