# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
513218 |
2022-01-17T04:14:59 Z |
8e7 |
Stray Cat (JOI20_stray) |
C++17 |
|
47 ms |
15880 KB |
#include "Anthony.h"
#include <vector>
#include <bits/stdc++.h>
#define maxn 20005
#define pii pair<int, int>
using namespace std;
namespace {
vector<int> adj[maxn];
const int inf = 8e7;
};
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]);
queue<int> que;
que.push(0);
vector<int> X(M), d(M, inf);
d[0] = 0;
while (que.size()) {
int cur = que.front();que.pop();
for (int v:adj[cur]) {
if (d[cur] + 1 < d[v]) {
d[v] = d[cur] + 1;
que.push(v);
}
}
}
for (int i = 0; i < M; ++i) {
if (d[U[i]] > d[V[i]]) swap(U[i], V[i]);
X[i] = d[U[i]] % 3;
}
return X;
}
#include "Catherine.h"
#include <vector>
using namespace std;
namespace {
int A, B;
};
void Init(int A, int B) {
::A = A;
::B = B;
}
int Move(vector<int> y) {
int cnt = (y[0] ? 1 : 0) + (y[1] ? 1 : 0) + (y[2] ? 1 : 0);
if (cnt == 1) {
for (int i = 0;i < 3;i++) {
if (y[i]) return i;
}
} else {
if (y[0] && y[1]) return 0;
else if (y[1] && y[2]) return 1;
else return 2;
}
return -1;
}
/*
7 6 2 6 1
0 2
0 4
1 2
1 3
1 5
4 6
*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
43 ms |
15648 KB |
Output is correct |
2 |
Correct |
1 ms |
1052 KB |
Output is correct |
3 |
Correct |
30 ms |
15024 KB |
Output is correct |
4 |
Correct |
47 ms |
15880 KB |
Output is correct |
5 |
Incorrect |
39 ms |
15080 KB |
Wrong Answer [5] |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
43 ms |
15648 KB |
Output is correct |
2 |
Correct |
1 ms |
1052 KB |
Output is correct |
3 |
Correct |
30 ms |
15024 KB |
Output is correct |
4 |
Correct |
47 ms |
15880 KB |
Output is correct |
5 |
Incorrect |
39 ms |
15080 KB |
Wrong Answer [5] |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
32 ms |
13212 KB |
Output is correct |
2 |
Correct |
1 ms |
1024 KB |
Output is correct |
3 |
Correct |
28 ms |
12880 KB |
Output is correct |
4 |
Correct |
43 ms |
13568 KB |
Output is correct |
5 |
Incorrect |
30 ms |
12800 KB |
Wrong Answer [5] |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
32 ms |
13212 KB |
Output is correct |
2 |
Correct |
1 ms |
1024 KB |
Output is correct |
3 |
Correct |
28 ms |
12880 KB |
Output is correct |
4 |
Correct |
43 ms |
13568 KB |
Output is correct |
5 |
Incorrect |
30 ms |
12800 KB |
Wrong Answer [5] |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
1016 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
8 ms |
2540 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
7 ms |
2548 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |