# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
411096 | 2021-05-24T10:59:41 Z | 장태환(#7543) | Stray Cat (JOI20_stray) | C++17 | 73 ms | 21364 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++) { X[i] = -1; 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); } } } for (i = 0; i < M; i++) { if (X[i] == -1) X[i] = dist[U[i]] % 3; } return X; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 53 ms | 20340 KB | Output is correct |
2 | Correct | 5 ms | 6008 KB | Output is correct |
3 | Correct | 41 ms | 19796 KB | Output is correct |
4 | Correct | 69 ms | 21364 KB | Output is correct |
5 | Correct | 62 ms | 21284 KB | Output is correct |
6 | Correct | 47 ms | 20180 KB | Output is correct |
7 | Correct | 48 ms | 20068 KB | Output is correct |
8 | Correct | 61 ms | 20660 KB | Output is correct |
9 | Correct | 64 ms | 20752 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 53 ms | 20340 KB | Output is correct |
2 | Correct | 5 ms | 6008 KB | Output is correct |
3 | Correct | 41 ms | 19796 KB | Output is correct |
4 | Correct | 69 ms | 21364 KB | Output is correct |
5 | Correct | 62 ms | 21284 KB | Output is correct |
6 | Correct | 47 ms | 20180 KB | Output is correct |
7 | Correct | 48 ms | 20068 KB | Output is correct |
8 | Correct | 61 ms | 20660 KB | Output is correct |
9 | Correct | 64 ms | 20752 KB | Output is correct |
10 | Incorrect | 40 ms | 18164 KB | Wrong Answer [6] |
11 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 48 ms | 17804 KB | Output is correct |
2 | Correct | 5 ms | 6012 KB | Output is correct |
3 | Correct | 40 ms | 17512 KB | Output is correct |
4 | Correct | 63 ms | 19224 KB | Output is correct |
5 | Correct | 73 ms | 19088 KB | Output is correct |
6 | Correct | 46 ms | 17872 KB | Output is correct |
7 | Correct | 49 ms | 17900 KB | Output is correct |
8 | Correct | 57 ms | 18484 KB | Output is correct |
9 | Correct | 57 ms | 18440 KB | Output is correct |
10 | Correct | 53 ms | 18232 KB | Output is correct |
11 | Correct | 48 ms | 18340 KB | Output is correct |
12 | Correct | 54 ms | 18244 KB | Output is correct |
13 | Correct | 52 ms | 18280 KB | Output is correct |
14 | Correct | 58 ms | 18440 KB | Output is correct |
15 | Correct | 68 ms | 18504 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 48 ms | 17804 KB | Output is correct |
2 | Correct | 5 ms | 6012 KB | Output is correct |
3 | Correct | 40 ms | 17512 KB | Output is correct |
4 | Correct | 63 ms | 19224 KB | Output is correct |
5 | Correct | 73 ms | 19088 KB | Output is correct |
6 | Correct | 46 ms | 17872 KB | Output is correct |
7 | Correct | 49 ms | 17900 KB | Output is correct |
8 | Correct | 57 ms | 18484 KB | Output is correct |
9 | Correct | 57 ms | 18440 KB | Output is correct |
10 | Correct | 53 ms | 18232 KB | Output is correct |
11 | Correct | 48 ms | 18340 KB | Output is correct |
12 | Correct | 54 ms | 18244 KB | Output is correct |
13 | Correct | 52 ms | 18280 KB | Output is correct |
14 | Correct | 58 ms | 18440 KB | Output is correct |
15 | Correct | 68 ms | 18504 KB | Output is correct |
16 | Correct | 55 ms | 16304 KB | Output is correct |
17 | Correct | 44 ms | 16412 KB | Output is correct |
18 | Incorrect | 38 ms | 16348 KB | Wrong Answer [6] |
19 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 6 ms | 6000 KB | Wrong Answer [2] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 13 ms | 7160 KB | Wrong Answer [2] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 13 ms | 7108 KB | Wrong Answer [2] |
2 | Halted | 0 ms | 0 KB | - |