# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
758732 |
2023-06-15T08:15:14 Z |
siewjh |
Stray Cat (JOI20_stray) |
C++17 |
|
36 ms |
16508 KB |
#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
}
vector<int> Mark(int N, int M, int A, int B, vector<int> U, vector<int> V) {
vector<vector<pair<int, int>>> adj(N);
for (int i = 0; i < M; i++){
adj[U[i]].push_back({V[i], i});
adj[V[i]].push_back({U[i], i});
}
vector<int> dist(N, -1), marking(M);
dist[0] = 0;
queue<int> q;
q.push(0);
while (!q.empty()){
int x = q.front(); q.pop();
for (auto nxt : adj[x]){
int nn = nxt.first, edge = nxt.second;
if (dist[nn] != -1){
if (dist[nn] == dist[x] - 1) continue; // already marked
else marking[edge] = dist[x] % 3;
}
else{
marking[edge] = dist[x] % 3;
dist[nn] = dist[x] + 1;
q.push(nn);
}
}
}
return marking;
}
#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) {
int types = 0;
for (int i = 0; i < 3; i++)
if (y[i])
types++;
if (types == 1){
for (int i = 0; i < 3; i++)
if (y[i])
return i;
}
else{ // types == 2
for (int i = 0; i < 3; i++)
if (!y[i])
return (i + 1) % 3;
}
return -1; // will never happen
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
30 ms |
15564 KB |
Output is correct |
2 |
Correct |
0 ms |
512 KB |
Output is correct |
3 |
Correct |
24 ms |
14860 KB |
Output is correct |
4 |
Correct |
34 ms |
16476 KB |
Output is correct |
5 |
Correct |
34 ms |
16508 KB |
Output is correct |
6 |
Correct |
28 ms |
15316 KB |
Output is correct |
7 |
Correct |
27 ms |
15288 KB |
Output is correct |
8 |
Correct |
32 ms |
16040 KB |
Output is correct |
9 |
Correct |
32 ms |
16068 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
30 ms |
15564 KB |
Output is correct |
2 |
Correct |
0 ms |
512 KB |
Output is correct |
3 |
Correct |
24 ms |
14860 KB |
Output is correct |
4 |
Correct |
34 ms |
16476 KB |
Output is correct |
5 |
Correct |
34 ms |
16508 KB |
Output is correct |
6 |
Correct |
28 ms |
15316 KB |
Output is correct |
7 |
Correct |
27 ms |
15288 KB |
Output is correct |
8 |
Correct |
32 ms |
16040 KB |
Output is correct |
9 |
Correct |
32 ms |
16068 KB |
Output is correct |
10 |
Correct |
25 ms |
13312 KB |
Output is correct |
11 |
Correct |
26 ms |
13372 KB |
Output is correct |
12 |
Correct |
31 ms |
13240 KB |
Output is correct |
13 |
Correct |
26 ms |
13308 KB |
Output is correct |
14 |
Correct |
27 ms |
13636 KB |
Output is correct |
15 |
Correct |
28 ms |
13980 KB |
Output is correct |
16 |
Correct |
32 ms |
16044 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
27 ms |
13116 KB |
Output is correct |
2 |
Correct |
0 ms |
588 KB |
Output is correct |
3 |
Correct |
25 ms |
12604 KB |
Output is correct |
4 |
Correct |
32 ms |
14388 KB |
Output is correct |
5 |
Correct |
32 ms |
14288 KB |
Output is correct |
6 |
Correct |
27 ms |
13140 KB |
Output is correct |
7 |
Correct |
33 ms |
13012 KB |
Output is correct |
8 |
Correct |
32 ms |
13752 KB |
Output is correct |
9 |
Correct |
28 ms |
13664 KB |
Output is correct |
10 |
Correct |
27 ms |
13604 KB |
Output is correct |
11 |
Correct |
27 ms |
13496 KB |
Output is correct |
12 |
Correct |
27 ms |
13504 KB |
Output is correct |
13 |
Correct |
27 ms |
13516 KB |
Output is correct |
14 |
Correct |
30 ms |
13844 KB |
Output is correct |
15 |
Correct |
36 ms |
13792 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
27 ms |
13116 KB |
Output is correct |
2 |
Correct |
0 ms |
588 KB |
Output is correct |
3 |
Correct |
25 ms |
12604 KB |
Output is correct |
4 |
Correct |
32 ms |
14388 KB |
Output is correct |
5 |
Correct |
32 ms |
14288 KB |
Output is correct |
6 |
Correct |
27 ms |
13140 KB |
Output is correct |
7 |
Correct |
33 ms |
13012 KB |
Output is correct |
8 |
Correct |
32 ms |
13752 KB |
Output is correct |
9 |
Correct |
28 ms |
13664 KB |
Output is correct |
10 |
Correct |
27 ms |
13604 KB |
Output is correct |
11 |
Correct |
27 ms |
13496 KB |
Output is correct |
12 |
Correct |
27 ms |
13504 KB |
Output is correct |
13 |
Correct |
27 ms |
13516 KB |
Output is correct |
14 |
Correct |
30 ms |
13844 KB |
Output is correct |
15 |
Correct |
36 ms |
13792 KB |
Output is correct |
16 |
Correct |
24 ms |
11496 KB |
Output is correct |
17 |
Correct |
23 ms |
11516 KB |
Output is correct |
18 |
Correct |
25 ms |
11464 KB |
Output is correct |
19 |
Correct |
26 ms |
11472 KB |
Output is correct |
20 |
Correct |
27 ms |
12008 KB |
Output is correct |
21 |
Correct |
26 ms |
11784 KB |
Output is correct |
22 |
Correct |
30 ms |
13904 KB |
Output is correct |
23 |
Correct |
25 ms |
11564 KB |
Output is correct |
24 |
Correct |
25 ms |
11540 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
640 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
2656 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
2640 KB |
Wrong Answer [2] |
2 |
Halted |
0 ms |
0 KB |
- |