#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;
namespace ivan {
vector<vector<pair<int, int>>> adj;
vector<int> dist, c;
void dfs(int u, int p) {
for (auto& [v, id] : adj[u]) if (v != p) {
dist[v] = (dist[u] + 1) % 3;
c[id] = dist[v];
dfs(v, u);
}
}
};
using namespace ivan;
vector<int> Mark(int n, int m, int a, int b,
vector<int> u, vector<int> v) {
vector<int> x(m);
adj.resize(n);
c.resize(m);
dist.assign(n, 0);
for (int i = 0; i < m; i++) {
adj[u[i]].push_back({v[i], i});
adj[v[i]].push_back({u[i], i});
}
dfs(0, -1);
return c;
}
#include "Catherine.h"
#include <bits/stdc++.h>
using namespace std;
namespace ivan {
int a, b;
};
using namespace ivan;
void Init(int A, int B) {
a = A, b = B;
}
int Move(vector<int> cnt) {
set<int> hv;
for (int i = 0; i < a; i++) if (cnt[i]) hv.insert(i);
if ((int) hv.size() == 1) return *hv.begin();
if (!hv.count(1)) return 2;
if (!hv.count(2)) return 0;
if (!hv.count(0)) return 1;
}
Compilation message
Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:16:14: warning: control reaches end of non-void function [-Wreturn-type]
16 | set<int> hv;
| ^~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
30 ms |
16652 KB |
Output is correct |
2 |
Correct |
0 ms |
884 KB |
Output is correct |
3 |
Correct |
24 ms |
15408 KB |
Output is correct |
4 |
Correct |
41 ms |
18336 KB |
Output is correct |
5 |
Correct |
35 ms |
18000 KB |
Output is correct |
6 |
Correct |
27 ms |
16116 KB |
Output is correct |
7 |
Correct |
27 ms |
16216 KB |
Output is correct |
8 |
Correct |
34 ms |
17508 KB |
Output is correct |
9 |
Correct |
36 ms |
17500 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
30 ms |
16652 KB |
Output is correct |
2 |
Correct |
0 ms |
884 KB |
Output is correct |
3 |
Correct |
24 ms |
15408 KB |
Output is correct |
4 |
Correct |
41 ms |
18336 KB |
Output is correct |
5 |
Correct |
35 ms |
18000 KB |
Output is correct |
6 |
Correct |
27 ms |
16116 KB |
Output is correct |
7 |
Correct |
27 ms |
16216 KB |
Output is correct |
8 |
Correct |
34 ms |
17508 KB |
Output is correct |
9 |
Correct |
36 ms |
17500 KB |
Output is correct |
10 |
Runtime error |
377 ms |
524288 KB |
Execution killed with signal 9 |
11 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
26 ms |
14128 KB |
Output is correct |
2 |
Correct |
1 ms |
796 KB |
Output is correct |
3 |
Correct |
23 ms |
13112 KB |
Output is correct |
4 |
Correct |
35 ms |
16120 KB |
Output is correct |
5 |
Correct |
40 ms |
16208 KB |
Output is correct |
6 |
Correct |
27 ms |
13912 KB |
Output is correct |
7 |
Correct |
26 ms |
13956 KB |
Output is correct |
8 |
Correct |
30 ms |
15176 KB |
Output is correct |
9 |
Correct |
31 ms |
15276 KB |
Output is correct |
10 |
Correct |
31 ms |
14784 KB |
Output is correct |
11 |
Correct |
31 ms |
14948 KB |
Output is correct |
12 |
Correct |
34 ms |
14624 KB |
Output is correct |
13 |
Correct |
27 ms |
14680 KB |
Output is correct |
14 |
Correct |
34 ms |
14876 KB |
Output is correct |
15 |
Correct |
33 ms |
14932 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
26 ms |
14128 KB |
Output is correct |
2 |
Correct |
1 ms |
796 KB |
Output is correct |
3 |
Correct |
23 ms |
13112 KB |
Output is correct |
4 |
Correct |
35 ms |
16120 KB |
Output is correct |
5 |
Correct |
40 ms |
16208 KB |
Output is correct |
6 |
Correct |
27 ms |
13912 KB |
Output is correct |
7 |
Correct |
26 ms |
13956 KB |
Output is correct |
8 |
Correct |
30 ms |
15176 KB |
Output is correct |
9 |
Correct |
31 ms |
15276 KB |
Output is correct |
10 |
Correct |
31 ms |
14784 KB |
Output is correct |
11 |
Correct |
31 ms |
14948 KB |
Output is correct |
12 |
Correct |
34 ms |
14624 KB |
Output is correct |
13 |
Correct |
27 ms |
14680 KB |
Output is correct |
14 |
Correct |
34 ms |
14876 KB |
Output is correct |
15 |
Correct |
33 ms |
14932 KB |
Output is correct |
16 |
Runtime error |
359 ms |
524288 KB |
Execution killed with signal 9 |
17 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
796 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
6 ms |
3060 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
6 ms |
3064 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |