# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
49167 | aome | Pipes (BOI13_pipes) | C++17 | 371 ms | 22076 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, m;
int a[N];
int par[N];
int deg[N];
int res[N];
bool vis[N];
vector< pair<int, int> > G[N];
map< pair<int, int>, int > mp;
int main() {
ios::sync_with_stdio(false);
cin >> n >> m;
if (m > n) {
cout << 0; return 0;
}
for (int i = 1; i <= n; ++i) cin >> a[i];
for (int i = 1; i <= m; ++i) {
int u, v; cin >> u >> v;
G[u].push_back({v, i});
G[v].push_back({u, i});
deg[u]++, deg[v]++;
mp[{u, v}] = mp[{v, u}] = i;
}
queue<int> qu;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |