# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
411093 | 2021-05-24T10:54:17 Z | 장태환(#7543) | Stray Cat (JOI20_stray) | C++17 | 73 ms | 21856 KB |
#include "Anthony.h" #include <vector> #include <string.h> #include <queue> using namespace std; namespace { int FunctionExample(int i, int A) { return i % A; } } // namespace vector<int>x; int dist[200100]; vector<pair<int,int>>link[200100]; std::vector<int> Mark(int N, int M, int A, int B, std::vector<int> U, std::vector<int> V) { std::vector<int> X(M); int i; for (i = 0; i < M; i++) { link[U[i]].push_back({ V[i],i }); link[V[i]].push_back({ U[i],i }); } queue<int>x; x.push(0); memset(dist, 1, sizeof(dist)); dist[0] = 0; while (x.size()) { auto a = x.front(); x.pop(); for (i = 0; i < link[a].size(); i++) { if (dist[link[a][i].first] > dist[a] + 1) { dist[link[a][i].first] = dist[a] + 1; X[link[a][i].second]=dist[a]%3; x.push(link[a][i].first); } if (dist[link[a][i].first] == dist[a] ) { X[link[a][i].second] = dist[a] % 3; } } } return X; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 50 ms | 20684 KB | Output is correct |
2 | Correct | 5 ms | 6040 KB | Output is correct |
3 | Correct | 41 ms | 19980 KB | Output is correct |
4 | Correct | 73 ms | 21856 KB | Output is correct |
5 | Correct | 60 ms | 21736 KB | Output is correct |
6 | Correct | 46 ms | 20444 KB | Output is correct |
7 | Correct | 46 ms | 20584 KB | Output is correct |
8 | Correct | 56 ms | 21248 KB | Output is correct |
9 | Correct | 59 ms | 21348 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 50 ms | 20684 KB | Output is correct |
2 | Correct | 5 ms | 6040 KB | Output is correct |
3 | Correct | 41 ms | 19980 KB | Output is correct |
4 | Correct | 73 ms | 21856 KB | Output is correct |
5 | Correct | 60 ms | 21736 KB | Output is correct |
6 | Correct | 46 ms | 20444 KB | Output is correct |
7 | Correct | 46 ms | 20584 KB | Output is correct |
8 | Correct | 56 ms | 21248 KB | Output is correct |
9 | Correct | 59 ms | 21348 KB | Output is correct |
10 | Correct | 50 ms | 18656 KB | Output is correct |
11 | Correct | 54 ms | 18676 KB | Output is correct |
12 | Incorrect | 39 ms | 18628 KB | Wrong Answer [6] |
13 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 48 ms | 18328 KB | Output is correct |
2 | Correct | 5 ms | 6004 KB | Output is correct |
3 | Correct | 46 ms | 17720 KB | Output is correct |
4 | Correct | 59 ms | 19660 KB | Output is correct |
5 | Correct | 59 ms | 19592 KB | Output is correct |
6 | Correct | 46 ms | 18364 KB | Output is correct |
7 | Correct | 46 ms | 18340 KB | Output is correct |
8 | Correct | 67 ms | 18924 KB | Output is correct |
9 | Correct | 55 ms | 18992 KB | Output is correct |
10 | Correct | 47 ms | 18696 KB | Output is correct |
11 | Correct | 50 ms | 18648 KB | Output is correct |
12 | Correct | 50 ms | 18684 KB | Output is correct |
13 | Correct | 50 ms | 18680 KB | Output is correct |
14 | Correct | 54 ms | 18960 KB | Output is correct |
15 | Correct | 54 ms | 18924 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 48 ms | 18328 KB | Output is correct |
2 | Correct | 5 ms | 6004 KB | Output is correct |
3 | Correct | 46 ms | 17720 KB | Output is correct |
4 | Correct | 59 ms | 19660 KB | Output is correct |
5 | Correct | 59 ms | 19592 KB | Output is correct |
6 | Correct | 46 ms | 18364 KB | Output is correct |
7 | Correct | 46 ms | 18340 KB | Output is correct |
8 | Correct | 67 ms | 18924 KB | Output is correct |
9 | Correct | 55 ms | 18992 KB | Output is correct |
10 | Correct | 47 ms | 18696 KB | Output is correct |
11 | Correct | 50 ms | 18648 KB | Output is correct |
12 | Correct | 50 ms | 18684 KB | Output is correct |
13 | Correct | 50 ms | 18680 KB | Output is correct |
14 | Correct | 54 ms | 18960 KB | Output is correct |
15 | Correct | 54 ms | 18924 KB | Output is correct |
16 | Correct | 41 ms | 16720 KB | Output is correct |
17 | Correct | 42 ms | 16712 KB | Output is correct |
18 | Incorrect | 40 ms | 16748 KB | Wrong Answer [6] |
19 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 6000 KB | Wrong Answer [2] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 12 ms | 7628 KB | Wrong Answer [2] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 13 ms | 7668 KB | Wrong Answer [2] |
2 | Halted | 0 ms | 0 KB | - |