# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
260543 |
2020-08-10T13:50:50 Z |
Saboon |
Stray Cat (JOI20_stray) |
C++14 |
|
67 ms |
16920 KB |
#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;
const int maxn = 20'000 + 10;
int h[maxn];
vector<int> g[maxn];
int Q[maxn], tail, head;
void bfs(int v){
memset(h, -1, sizeof h);
Q[head++] = v;
h[v] = 0;
while (tail < head){
v = Q[tail++];
for (auto u : g[v])
if (h[u] == -1)
h[u] = h[v]+1, Q[head++] = u;
}
}
vector<int> Mark(int n, int m, int A, int B, vector<int> U, vector<int> V) {
vector<int> X(m);
if (A >= 3){
for (int i = 0; i < m; i++){
g[U[i]].push_back(V[i]);
g[V[i]].push_back(U[i]);
}
bfs(0);
for (int i = 0; i < m; i++){
int v = V[i], u = U[i];
if (h[v] == h[u])
X[i] = h[v]%3;
else
X[i] = (max(h[v],h[u])+2)%3;
}
return X;
}
}
#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) {
int a = -1, b = -1;
for (int j = 0; j < A; ++j) {
if (y[j] != 0){
if (a == -1)
a = j;
else
b = j;
}
}
if (b == -1)
return a;
if (a+1 == b)
return a;
return b;
}
Compilation message
Anthony.cpp: In function 'std::vector<int> Mark(int, int, int, int, std::vector<int>, std::vector<int>)':
Anthony.cpp:41:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
50 ms |
15632 KB |
Output is correct |
2 |
Correct |
1 ms |
1792 KB |
Output is correct |
3 |
Correct |
40 ms |
15060 KB |
Output is correct |
4 |
Correct |
60 ms |
16920 KB |
Output is correct |
5 |
Correct |
62 ms |
16920 KB |
Output is correct |
6 |
Correct |
48 ms |
15488 KB |
Output is correct |
7 |
Correct |
51 ms |
15364 KB |
Output is correct |
8 |
Correct |
58 ms |
16100 KB |
Output is correct |
9 |
Correct |
66 ms |
15988 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
50 ms |
15632 KB |
Output is correct |
2 |
Correct |
1 ms |
1792 KB |
Output is correct |
3 |
Correct |
40 ms |
15060 KB |
Output is correct |
4 |
Correct |
60 ms |
16920 KB |
Output is correct |
5 |
Correct |
62 ms |
16920 KB |
Output is correct |
6 |
Correct |
48 ms |
15488 KB |
Output is correct |
7 |
Correct |
51 ms |
15364 KB |
Output is correct |
8 |
Correct |
58 ms |
16100 KB |
Output is correct |
9 |
Correct |
66 ms |
15988 KB |
Output is correct |
10 |
Correct |
44 ms |
13560 KB |
Output is correct |
11 |
Correct |
47 ms |
13796 KB |
Output is correct |
12 |
Correct |
44 ms |
14156 KB |
Output is correct |
13 |
Correct |
48 ms |
14156 KB |
Output is correct |
14 |
Correct |
46 ms |
14180 KB |
Output is correct |
15 |
Correct |
59 ms |
14488 KB |
Output is correct |
16 |
Correct |
56 ms |
16844 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
46 ms |
13232 KB |
Output is correct |
2 |
Correct |
1 ms |
1792 KB |
Output is correct |
3 |
Correct |
43 ms |
12668 KB |
Output is correct |
4 |
Correct |
62 ms |
14708 KB |
Output is correct |
5 |
Correct |
67 ms |
14452 KB |
Output is correct |
6 |
Correct |
45 ms |
13180 KB |
Output is correct |
7 |
Correct |
47 ms |
13192 KB |
Output is correct |
8 |
Correct |
55 ms |
13932 KB |
Output is correct |
9 |
Correct |
53 ms |
13980 KB |
Output is correct |
10 |
Correct |
51 ms |
13704 KB |
Output is correct |
11 |
Correct |
52 ms |
13728 KB |
Output is correct |
12 |
Correct |
53 ms |
13728 KB |
Output is correct |
13 |
Correct |
53 ms |
13692 KB |
Output is correct |
14 |
Correct |
57 ms |
13948 KB |
Output is correct |
15 |
Correct |
57 ms |
13980 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
46 ms |
13232 KB |
Output is correct |
2 |
Correct |
1 ms |
1792 KB |
Output is correct |
3 |
Correct |
43 ms |
12668 KB |
Output is correct |
4 |
Correct |
62 ms |
14708 KB |
Output is correct |
5 |
Correct |
67 ms |
14452 KB |
Output is correct |
6 |
Correct |
45 ms |
13180 KB |
Output is correct |
7 |
Correct |
47 ms |
13192 KB |
Output is correct |
8 |
Correct |
55 ms |
13932 KB |
Output is correct |
9 |
Correct |
53 ms |
13980 KB |
Output is correct |
10 |
Correct |
51 ms |
13704 KB |
Output is correct |
11 |
Correct |
52 ms |
13728 KB |
Output is correct |
12 |
Correct |
53 ms |
13728 KB |
Output is correct |
13 |
Correct |
53 ms |
13692 KB |
Output is correct |
14 |
Correct |
57 ms |
13948 KB |
Output is correct |
15 |
Correct |
57 ms |
13980 KB |
Output is correct |
16 |
Correct |
40 ms |
11640 KB |
Output is correct |
17 |
Correct |
40 ms |
12208 KB |
Output is correct |
18 |
Correct |
43 ms |
12260 KB |
Output is correct |
19 |
Correct |
43 ms |
12140 KB |
Output is correct |
20 |
Correct |
49 ms |
12676 KB |
Output is correct |
21 |
Correct |
49 ms |
12364 KB |
Output is correct |
22 |
Correct |
52 ms |
14624 KB |
Output is correct |
23 |
Correct |
43 ms |
12280 KB |
Output is correct |
24 |
Correct |
44 ms |
12140 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
1536 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
36 ms |
10140 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
38 ms |
10148 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |