# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
484628 |
2021-11-04T21:00:26 Z |
Victor |
Pipes (CEOI15_pipes) |
C++17 |
|
767 ms |
65536 KB |
#include <bits/stdc++.h>
using namespace std;
#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 trav(a, x) for (auto &a : x)
#define all(x) x.begin(), x.end()
#define sz(x) x.size()
#define pb push_back
#define debug(x) cout << #x << " = " << x << endl
#define umap unordered_map
#define uset unordered_set
typedef pair<int, int> ii;
typedef pair<int, ii> iii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<pll> vpll;
const int INF = 1'000'000'007;
set<ii> ans;
int p[100000];
char r[100000];
int find_set(int i) { return p[i] == i ? i : p[i] = find_set(p[i]); }
void union_set(int i, int j) {
i = find_set(i);
j = find_set(j);
if (i == j) return;
if (r[i] < r[j]) swap(i, j);
if (r[i] == r[j]) ++r[i];
p[j] = i;
}
bitset<17> edges[6000000];
int main() {
cin.tie(0)->sync_with_stdio(0);
cin.exceptions(cin.failbit);
int n, m;
cin >> n >> m;
rep(i,0,n){
p[i]=i;
r[i]=0;
}
rep(i, 0, m) {
int u, v;
cin >> u >> v;
--u;
--v;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Wrong number of edges |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
332 KB |
Wrong number of edges |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
71 ms |
972 KB |
Output is correct |
2 |
Incorrect |
69 ms |
972 KB |
Wrong number of edges |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
131 ms |
1500 KB |
Output is correct |
2 |
Incorrect |
141 ms |
1484 KB |
Wrong number of edges |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
196 ms |
1444 KB |
Output is correct |
2 |
Incorrect |
161 ms |
1612 KB |
Wrong number of edges |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
232 ms |
908 KB |
Output is correct |
2 |
Incorrect |
200 ms |
716 KB |
Wrong number of edges |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
358 ms |
1100 KB |
Output is correct |
2 |
Incorrect |
361 ms |
716 KB |
Wrong number of edges |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
471 ms |
864 KB |
Output is correct |
2 |
Runtime error |
467 ms |
41992 KB |
Memory limit exceeded |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
600 ms |
964 KB |
Output is correct |
2 |
Runtime error |
590 ms |
53700 KB |
Memory limit exceeded |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
767 ms |
1264 KB |
Output is correct |
2 |
Runtime error |
752 ms |
65536 KB |
Memory limit exceeded |