Submission #1151360

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11513602025-02-16 15:59:47byunjaewooStray Cat (JOI20_stray)C++20
15 / 100
34 ms13896 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) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...