#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pii pair<long long, long long>
#define fr first
#define se second
const int MAXN = 1e5 + 10;
vector<pii> adj[MAXN];
vector<int> bEdges;
vector<pii> edges;
int h[MAXN];
int change[MAXN];
bool vis[MAXN];
void dfs(int node, int caller) {
vis[node] = 1;
for (auto [u, z] : adj[node]) {
if (u == caller) continue;
if (vis[u]) bEdges.push_back(z);
else {
h[u] = h[node] + 1;
dfs(u, node);
}
}
}
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int n, m;
cin >> n >> m;
for (int i = 1; i <= n; i++) cin >> change[i];
for (int i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
edges.push_back({a, b});
adj[a].push_back({b, i});
adj[b].push_back({a, i});
}
if (m > (n + 1)) {
cout << "0\n";
}
//dfs(1, 0);
//if (bEdges.size() > 1) {
// cout << "0\n";
// return 0;
//}
//for (auto k : bEdges) {
// auto u = edges[k];
// if (((h[u.fr] + h[u.se] + 1) % 2) == 0) {
// cout << "0\n";
// return 0;
// }
//}
//cout << "oi\n";
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
4188 KB |
Output isn't correct |
2 |
Incorrect |
1 ms |
4188 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
4188 KB |
Output isn't correct |
4 |
Incorrect |
22 ms |
12492 KB |
Output isn't correct |
5 |
Incorrect |
1 ms |
4188 KB |
Output isn't correct |
6 |
Incorrect |
1 ms |
4188 KB |
Output isn't correct |
7 |
Incorrect |
1 ms |
4188 KB |
Output isn't correct |
8 |
Incorrect |
1 ms |
4188 KB |
Output isn't correct |
9 |
Incorrect |
1 ms |
4188 KB |
Output isn't correct |
10 |
Incorrect |
1 ms |
4188 KB |
Output isn't correct |
11 |
Incorrect |
1 ms |
4188 KB |
Output isn't correct |
12 |
Incorrect |
1 ms |
4188 KB |
Output isn't correct |
13 |
Incorrect |
23 ms |
10960 KB |
Output isn't correct |
14 |
Incorrect |
26 ms |
11980 KB |
Output isn't correct |
15 |
Incorrect |
25 ms |
12432 KB |
Output isn't correct |
16 |
Incorrect |
28 ms |
11236 KB |
Output isn't correct |
17 |
Incorrect |
23 ms |
12492 KB |
Output isn't correct |
18 |
Incorrect |
23 ms |
12560 KB |
Output isn't correct |
19 |
Incorrect |
26 ms |
12492 KB |
Output isn't correct |
20 |
Incorrect |
1 ms |
4188 KB |
Output isn't correct |
21 |
Incorrect |
1 ms |
4300 KB |
Output isn't correct |
22 |
Incorrect |
22 ms |
12608 KB |
Output isn't correct |
23 |
Incorrect |
18 ms |
10952 KB |
Output isn't correct |
24 |
Incorrect |
24 ms |
12480 KB |
Output isn't correct |
25 |
Incorrect |
22 ms |
11196 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
4188 KB |
Output isn't correct |
2 |
Incorrect |
1 ms |
4184 KB |
Output isn't correct |
3 |
Incorrect |
23 ms |
11964 KB |
Output isn't correct |
4 |
Incorrect |
23 ms |
12688 KB |
Output isn't correct |
5 |
Correct |
22 ms |
12428 KB |
Output is correct |
6 |
Correct |
89 ms |
44184 KB |
Output is correct |
7 |
Incorrect |
1 ms |
4184 KB |
Output isn't correct |
8 |
Incorrect |
1 ms |
4184 KB |
Output isn't correct |
9 |
Incorrect |
1 ms |
4188 KB |
Output isn't correct |
10 |
Incorrect |
1 ms |
4188 KB |
Output isn't correct |
11 |
Incorrect |
1 ms |
4188 KB |
Output isn't correct |
12 |
Correct |
1 ms |
4188 KB |
Output is correct |
13 |
Correct |
1 ms |
4188 KB |
Output is correct |
14 |
Incorrect |
1 ms |
4188 KB |
Output isn't correct |
15 |
Incorrect |
1 ms |
4188 KB |
Output isn't correct |
16 |
Incorrect |
1 ms |
4188 KB |
Output isn't correct |
17 |
Incorrect |
2 ms |
4188 KB |
Output isn't correct |
18 |
Incorrect |
1 ms |
4188 KB |
Output isn't correct |
19 |
Incorrect |
1 ms |
4188 KB |
Output isn't correct |
20 |
Correct |
1 ms |
4188 KB |
Output is correct |
21 |
Correct |
1 ms |
4300 KB |
Output is correct |
22 |
Incorrect |
1 ms |
4188 KB |
Output isn't correct |
23 |
Incorrect |
18 ms |
11104 KB |
Output isn't correct |
24 |
Incorrect |
26 ms |
12612 KB |
Output isn't correct |
25 |
Incorrect |
21 ms |
11964 KB |
Output isn't correct |
26 |
Incorrect |
23 ms |
12740 KB |
Output isn't correct |
27 |
Incorrect |
24 ms |
12492 KB |
Output isn't correct |
28 |
Correct |
23 ms |
13060 KB |
Output is correct |
29 |
Correct |
84 ms |
37752 KB |
Output is correct |
30 |
Incorrect |
22 ms |
12236 KB |
Output isn't correct |
31 |
Incorrect |
26 ms |
12492 KB |
Output isn't correct |
32 |
Incorrect |
34 ms |
12520 KB |
Output isn't correct |
33 |
Incorrect |
26 ms |
12748 KB |
Output isn't correct |
34 |
Incorrect |
23 ms |
12680 KB |
Output isn't correct |
35 |
Incorrect |
23 ms |
12492 KB |
Output isn't correct |
36 |
Correct |
23 ms |
12736 KB |
Output is correct |
37 |
Correct |
93 ms |
44164 KB |
Output is correct |
38 |
Incorrect |
23 ms |
12664 KB |
Output isn't correct |
39 |
Incorrect |
24 ms |
12492 KB |
Output isn't correct |
40 |
Incorrect |
24 ms |
12744 KB |
Output isn't correct |
41 |
Incorrect |
26 ms |
12664 KB |
Output isn't correct |
42 |
Incorrect |
33 ms |
12484 KB |
Output isn't correct |
43 |
Incorrect |
24 ms |
12492 KB |
Output isn't correct |
44 |
Correct |
22 ms |
12236 KB |
Output is correct |
45 |
Correct |
80 ms |
40428 KB |
Output is correct |
46 |
Incorrect |
26 ms |
12492 KB |
Output isn't correct |
47 |
Incorrect |
23 ms |
12488 KB |
Output isn't correct |
48 |
Incorrect |
23 ms |
12512 KB |
Output isn't correct |
49 |
Incorrect |
22 ms |
11980 KB |
Output isn't correct |
50 |
Incorrect |
22 ms |
12672 KB |
Output isn't correct |
51 |
Incorrect |
23 ms |
12672 KB |
Output isn't correct |
52 |
Correct |
26 ms |
12484 KB |
Output is correct |
53 |
Correct |
79 ms |
39600 KB |
Output is correct |
54 |
Incorrect |
27 ms |
12404 KB |
Output isn't correct |