# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
747796 | 2023-05-24T18:11:57 Z | finn__ | Stray Cat (JOI20_stray) | C++17 | 39 ms | 15364 KB |
#include "Anthony.h" #include <bits/stdc++.h> using namespace std; std::vector<int> Mark(int n, int m, int a, int b, vector<int> u, vector<int> v) { vector<vector<int>> g(n); for (size_t i = 0; i < m; ++i) g[u[i]].push_back(v[i]), g[v[i]].push_back(u[i]); vector<int> ans(m); if (a >= 3) { queue<int> q; q.push(0); vector<int> d(n, -1); d[0] = 0; while (!q.empty()) { int const x = q.front(); q.pop(); for (auto const &y : g[x]) if (d[y] == -1) { d[y] = d[x] + 1; q.push(y); } } for (size_t i = 0; i < m; ++i) ans[i] = min(d[u[i]], d[v[i]]) % 3; } return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 39 ms | 15364 KB | Output is correct |
2 | Incorrect | 0 ms | 612 KB | Wrong Answer [5] |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 39 ms | 15364 KB | Output is correct |
2 | Incorrect | 0 ms | 612 KB | Wrong Answer [5] |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 33 ms | 12912 KB | Output is correct |
2 | Incorrect | 1 ms | 512 KB | Wrong Answer [5] |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 33 ms | 12912 KB | Output is correct |
2 | Incorrect | 1 ms | 512 KB | Wrong Answer [5] |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 908 KB | Wrong Answer [3] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 30 ms | 10608 KB | Wrong Answer [3] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 33 ms | 10632 KB | Wrong Answer [3] |
2 | Halted | 0 ms | 0 KB | - |