# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1151360 | byunjaewoo | Stray Cat (JOI20_stray) | C++20 | 34 ms | 13896 KiB |
#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
const int N=20010, INF=1e9;
int a[6]={0, 1, 1, 0, 0, 1};
int dist[N];
vector<pair<int, int>> adj[N];
queue<int> q;
}
vector<int> Mark(int N, int M, int A, int B, vector<int> U, vector<int> V) {
for(int i=0; i<M; i++) adj[U[i]].push_back({V[i], i}), adj[V[i]].push_back({U[i], i});
if(A>=3) {
q.push(0), fill(dist+1, dist+N, INF);
vector<int> ret(M, 0);
int cnt=0;
while(!q.empty()) {
int curr=q.front(); q.pop();
for(auto [next, k]:adj[curr]) {
if(dist[next]>dist[curr]+1) dist[next]=dist[curr]+1, q.push(next);
if(dist[next]>=dist[curr]) ret[k]=dist[curr]%3;
}
}
return ret;
}
vector<int> ret(M, 0);
function<void(int, int, int)> dfs=[&](int curr, int prev, int x) {
for(auto [next, k]:adj[curr]) if(next!=prev) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |