#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
struct edge {
int from, to, idx;
};
vector< vector<edge> > g;
vector<int> solve1234(int N, int M, vector<int> U, vector<int> V) {
queue<int> q;
q.push(0);
vector<int> dist(N, -1), ans(M);
dist[0] = 0;
while (!q.empty()) {
int u = q.front(); q.pop();
for (auto& e : g[u]) {
if (dist[e.to] == -1) {
dist[e.to] = dist[u] + 1;
q.push(e.to);
}
}
}
for (int i = 0; i < M; i++) {
ans[i] = min(dist[U[i]], dist[V[i]]) % 3;
}
return ans;
}
vector<int> solve567(int N, int M, vector<int> U, vector<int> V) {
}
}
vector<int> Mark(int N, int M, int A, int B, vector<int> U, vector<int> V) {
g.resize(N);
for (int i = 0; i < M; i++) {
g[U[i]].push_back({U[i], V[i], i});
g[V[i]].push_back({V[i], U[i], i});
}
if (A >= 3) {
return solve1234(N, M, U, V);
} else {
return solve567(N, M, U, V);
}
}
#include "Catherine.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
int A, B;
}
void Init(int A, int B) {
::A = A; ::B = B;
}
int Move(vector<int> y) {
if (A >= 3) {
for (int i = 0; i < 3; i++) {
if (y[i] != 0 && y[(i + 1) % 3] != 0) {
return i;
}
}
for (int i = 0; i < 3; i++) {
if (y[i] != 0) {
return i;
}
}
} else {
}
}
Compilation message
Anthony.cpp: In function 'std::vector<int> {anonymous}::solve567(int, int, std::vector<int>, std::vector<int>)':
Anthony.cpp:33:3: warning: no return statement in function returning non-void [-Wreturn-type]
}
^
Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:28:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
55 ms |
16404 KB |
Output is correct |
2 |
Correct |
9 ms |
776 KB |
Output is correct |
3 |
Correct |
47 ms |
15748 KB |
Output is correct |
4 |
Correct |
69 ms |
17452 KB |
Output is correct |
5 |
Correct |
69 ms |
17444 KB |
Output is correct |
6 |
Correct |
53 ms |
16128 KB |
Output is correct |
7 |
Correct |
56 ms |
16088 KB |
Output is correct |
8 |
Correct |
63 ms |
16976 KB |
Output is correct |
9 |
Correct |
64 ms |
16716 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
55 ms |
16404 KB |
Output is correct |
2 |
Correct |
9 ms |
776 KB |
Output is correct |
3 |
Correct |
47 ms |
15748 KB |
Output is correct |
4 |
Correct |
69 ms |
17452 KB |
Output is correct |
5 |
Correct |
69 ms |
17444 KB |
Output is correct |
6 |
Correct |
53 ms |
16128 KB |
Output is correct |
7 |
Correct |
56 ms |
16088 KB |
Output is correct |
8 |
Correct |
63 ms |
16976 KB |
Output is correct |
9 |
Correct |
64 ms |
16716 KB |
Output is correct |
10 |
Correct |
57 ms |
14296 KB |
Output is correct |
11 |
Correct |
50 ms |
14168 KB |
Output is correct |
12 |
Correct |
49 ms |
14212 KB |
Output is correct |
13 |
Correct |
50 ms |
14192 KB |
Output is correct |
14 |
Correct |
56 ms |
14448 KB |
Output is correct |
15 |
Correct |
59 ms |
14752 KB |
Output is correct |
16 |
Correct |
71 ms |
17080 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
53 ms |
13456 KB |
Output is correct |
2 |
Correct |
9 ms |
772 KB |
Output is correct |
3 |
Correct |
45 ms |
13084 KB |
Output is correct |
4 |
Correct |
64 ms |
14708 KB |
Output is correct |
5 |
Correct |
71 ms |
14912 KB |
Output is correct |
6 |
Correct |
50 ms |
13564 KB |
Output is correct |
7 |
Correct |
51 ms |
13440 KB |
Output is correct |
8 |
Correct |
57 ms |
14152 KB |
Output is correct |
9 |
Correct |
60 ms |
14272 KB |
Output is correct |
10 |
Correct |
57 ms |
14004 KB |
Output is correct |
11 |
Correct |
55 ms |
14020 KB |
Output is correct |
12 |
Correct |
54 ms |
14032 KB |
Output is correct |
13 |
Correct |
55 ms |
14012 KB |
Output is correct |
14 |
Correct |
61 ms |
14072 KB |
Output is correct |
15 |
Correct |
63 ms |
14068 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
53 ms |
13456 KB |
Output is correct |
2 |
Correct |
9 ms |
772 KB |
Output is correct |
3 |
Correct |
45 ms |
13084 KB |
Output is correct |
4 |
Correct |
64 ms |
14708 KB |
Output is correct |
5 |
Correct |
71 ms |
14912 KB |
Output is correct |
6 |
Correct |
50 ms |
13564 KB |
Output is correct |
7 |
Correct |
51 ms |
13440 KB |
Output is correct |
8 |
Correct |
57 ms |
14152 KB |
Output is correct |
9 |
Correct |
60 ms |
14272 KB |
Output is correct |
10 |
Correct |
57 ms |
14004 KB |
Output is correct |
11 |
Correct |
55 ms |
14020 KB |
Output is correct |
12 |
Correct |
54 ms |
14032 KB |
Output is correct |
13 |
Correct |
55 ms |
14012 KB |
Output is correct |
14 |
Correct |
61 ms |
14072 KB |
Output is correct |
15 |
Correct |
63 ms |
14068 KB |
Output is correct |
16 |
Correct |
47 ms |
11940 KB |
Output is correct |
17 |
Correct |
47 ms |
11928 KB |
Output is correct |
18 |
Correct |
48 ms |
11976 KB |
Output is correct |
19 |
Correct |
48 ms |
12252 KB |
Output is correct |
20 |
Correct |
54 ms |
12908 KB |
Output is correct |
21 |
Correct |
51 ms |
12780 KB |
Output is correct |
22 |
Correct |
68 ms |
15044 KB |
Output is correct |
23 |
Correct |
51 ms |
12380 KB |
Output is correct |
24 |
Correct |
50 ms |
12400 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
9 ms |
848 KB |
Wrong Answer [1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
17 ms |
4352 KB |
Wrong Answer [1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
19 ms |
4352 KB |
Wrong Answer [1] |
2 |
Halted |
0 ms |
0 KB |
- |