#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;
int seq[] = {1, 1, 0, 1, 0, 0};
vector<int> adj[20010];
int dist[20010];
vector<int> Mark(int N, int M, int A, int B, vector<int> U, vector<int> V) {
for (int i=0; i<M; i++) {
adj[U[i]].push_back(V[i]);
adj[V[i]].push_back(U[i]);
}
memset(dist, -1, sizeof(dist));
queue<int> q;
q.push(0);
dist[0] = 0;
while (!q.empty()) {
int x = q.front();
q.pop();
for (auto &y : adj[x]) {
if (dist[y] != -1) {
dist[y] = dist[x] + 1;
q.push(y);
}
}
}
for (int i=0; i<N; i++) {
assert(dist[i] != -1);
}
vector<int> ret(M);
if (A >= 3) {
for (int i=0; i<M; i++) {
ret[i] = min(dist[U[i]], dist[V[i]]) % 3;
}
}
else {
for (int i=0; i<M; i++) {
ret[i] = seq[min(dist[U[i]], dist[V[i]]) % 6];
}
}
return ret;
}
#include "Catherine.h"
#include <bits/stdc++.h>
using namespace std;
int A, B;
void Init(int _A, int _B) {
A = _A;
B = _B;
}
int Move(vector<int> y) {
if (A >= 3) {
if (y[0] && y[1]) return 0;
if (y[1] && y[2]) return 1;
if (y[2] && y[0]) return 2;
if (y[0]) return 0;
if (y[1]) return 1;
if (y[2]) return 2;
assert(0);
}
}
Compilation message
Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:24:1: warning: control reaches end of non-void function [-Wreturn-type]
24 | }
| ^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
6 ms |
3416 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
6 ms |
3416 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
6 ms |
3420 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
6 ms |
3420 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
1628 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
6 ms |
3676 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
6 ms |
3672 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |